###############################################################################
#
# File:         makefile
# RCS:          $Header: $
# Description:  Makefile for building Emacs under MSDOS with WATCOM C/386
# Author:       Darryl Okahata
# Created:      Fri Mar 19 20:10:28 1993
# Modified:     Thu Apr  1 01:51:15 1993 (darrylo@home) darrylo@dosmachine
# Language:     N/A
# Package:      N/A
# Status:       Experimental (Do Not Distribute)
#
# (C) Copyright 1993, Darryl Okahata, all rights reserved.
#
###############################################################################


# For debugging, use:
CFLAGS=  /d2 /Drcheck /Demacs /DDEBUG_EMACS
# For production code, use (stack overflow checking should always be
# turned on):
CFLAGS=  /oilrt /4r /zp4 /oe=40 /Demacs /DDEBUG_EMACS


# Use the protected-mode compiler, with signed chars:
CC=wcl386 /p /j

.c.obj:
	$(CC) /c $(CFLAGS) $[*


dot = .
lispdir = $(dot)$(dot)/lisp/
etcdir = $(dot)$(dot)/etc/


obj=    dispnew.obj scroll.obj xdisp.obj window.obj \
	term.obj cm.obj $(XOBJ) \
	emacs.obj keyboard.obj macros.obj keymap.obj sysdep.obj \
	buffer.obj filelock.obj insdel.obj marker.obj \
	minibuf.obj fileio.obj dired.obj filemode.obj \
	cmds.obj casefiddle.obj indent.obj search.obj regex.obj undo.obj \
	alloc.obj data.obj doc.obj editfns.obj callint.obj \
	eval.obj fns.obj print.obj lread.obj \
	abbrev.obj syntax.obj  unexec.obj mocklisp.obj bytecode.obj \
	process.obj callproc.obj $(environobj) \
	doprnt.obj \
	dosfns.obj pwd.obj director.obj dpmi.obj \
	mktemp.obj fixpath.obj link.obj random.obj

termcapobj = termcap.obj tparam.obj

mallocobj = alloca.obj malloc.obj

otherobj= firstfil.obj $(termcapobj) lastfile.obj $(mallocobj)

lisp=	$(lispdir)simple.elc $(lispdir)help.elc \
	$(lispdir)files.elc $(lispdir)window.elc \
	$(lispdir)indent.elc $(lispdir)loaddefs.el $(lispdir)paths.el \
	$(lispdir)startup.elc $(lispdir)lisp.elc \
	$(lispdir)page.elc $(lispdir)register.elc \
	$(lispdir)paragraphs.elc $(lispdir)lisp-mode.elc \
	$(lispdir)text-mode.elc $(lispdir)fill.elc \
	$(lispdir)c-mode.elc $(lispdir)isearch.elc \
	$(lispdir)replace.elc $(lispdir)abbrev.elc \
	$(lispdir)buff-menu.elc $(lispdir)subr.elc

all: temacs.exe doc .SYMBOLIC

doc:	$(etcdir)DOC .SYMBOLIC

$(etcdir)DOC: $(etcdir)make-docfile.exe $(obj) $(lisp)
	makedoc.bat

$(etcdir)make-docfile.exe:
	cd $(etcdir); $(MAKE) $(MFLAGS) make-docfile.exe

temacs.exe:   $(obj) $(otherobj)
	wlinkp @temacs.rsp

paths.h: paths.h-dist
	echo paths.h needs to be set up from paths.h-dist
	exit 1

config.h: config.h-dist
	echo config.h needs to be set up from config.h-dist
	exit 1

crt0.obj : crt0.c config.h
	$(CC) -c $(CFLAGS)   crt0.c

install:	temacs.exe .SYMBOLIC
	copy temacs.exe ..\bin

clean:	.SYMBOLIC
	-del *.obj
	-del *.err
	-del temacs.exe
	-del temacs.map

###############################################################################
# DEPENDENCIES (DO NOT CHANGE THIS LINE OR ANYTHING PAST IT)
abbrev.obj:	abbrev.c config.h lisp.h commands.h buffer.h window.h
alloc.obj:	alloc.c config.h lisp.h buffer.h window.h
alloca.obj:	alloca.c config.h
buffer.obj:	buffer.c config.h lisp.h window.h commands.h buffer.h syntax.h
bytecode.obj:	bytecode.c config.h lisp.h buffer.h
callint.obj:	callint.c config.h lisp.h buffer.h commands.h window.h
callproc.obj:	callproc.c config.h lisp.h commands.h buffer.h paths.h
casefidd.obj:	casefidd.c config.h lisp.h buffer.h commands.h syntax.h
cm.obj:	cm.c config.h cm.h termhooks.h
cmds.obj:	cmds.c config.h lisp.h commands.h buffer.h syntax.h
crt0.obj:	crt0.c config.h
data.obj:	data.c config.h lisp.h buffer.h emacssignal.h
director.obj:	director.c dir.h dpmi.h
dired.obj:	dired.c config.h dir.h ndir.h lisp.h buffer.h commands.h regex.h filetypes.h
dispnew.obj:	dispnew.c config.h termchar.h termopts.h cm.h dispextern.h lisp.h buffer.h window.h commands.h
doc.obj:	doc.c config.h lisp.h buffer.h
doprnt.obj:	doprnt.c 
dosfns.obj:	dosfns.c config.h dpmi.h lisp.h buffer.h termchar.h dosfns.h
dpmi.obj:	dpmi.c dpmi.h
editfns.obj:	editfns.c config.h pwd.h lisp.h buffer.h window.h
emacs.obj:	emacs.c config.h lisp.h commands.h
environ.obj:	environ.c config.h lisp.h
eval.obj:	eval.c config.h lisp.h commands.h
fileio.obj:	fileio.c config.h lisp.h dosfns.h pwd.h config.h dir.h buffer.h window.h filetypes.h
filelock.obj:	filelock.c config.h lisp.h paths.h buffer.h pwd.h filetypes.h
filemode.obj:	filemode.c config.h filetypes.h
firstfil.obj:	firstfil.c 
fixpath.obj:	fixpath.c 
fns.obj:	fns.c config.h lisp.h commands.h buffer.h
hftctl.obj:	hftctl.c 
indent.obj:	indent.c config.h lisp.h buffer.h indent.h window.h termchar.h termopts.h
insdel.obj:	insdel.c config.h lisp.h buffer.h window.h
keyboard.obj:	keyboard.c config.h termchar.h termopts.h termhooks.h lisp.h macros.h window.h commands.h buffer.h emacssignal.h
keymap.obj:	keymap.c config.h lisp.h commands.h buffer.h
lastfile.obj:	lastfile.c 
link.obj:	link.c 
lread.obj:	lread.c config.h lisp.h buffer.h paths.h filetypes.h
macros.obj:	macros.c config.h lisp.h macros.h commands.h buffer.h window.h
malloc.obj:	malloc.c config.h lisp.h getpagesize.h
marker.obj:	marker.c config.h lisp.h buffer.h
minibuf.obj:	minibuf.c config.h lisp.h commands.h buffer.h window.h syntax.h dispextern.h
mktemp.obj:	mktemp.c 
mocklisp.obj:	mocklisp.c config.h lisp.h buffer.h
pre-crt0.obj:	pre-crt0.c 
print.obj:	print.c config.h lisp.h buffer.h window.h process.h dispextern.h termchar.h
process.obj:	process.c config.h gettime.h lisp.h window.h buffer.h process.h termhooks.h termopts.h commands.h dispextern.h emacssignal.h
pwd.obj:	pwd.c pwd.h
random.obj:	random.c 
regex.obj:	regex.c config.h lisp.h buffer.h syntax.h regex.h
scroll.obj:	scroll.c config.h termchar.h termhooks.h dispextern.h
search.obj:	search.c config.h lisp.h syntax.h buffer.h commands.h regex.h
sunfns.obj:	sunfns.c config.h lisp.h window.h buffer.h termhooks.h
syntax.obj:	syntax.c config.h lisp.h commands.h buffer.h syntax.h
sysdep.obj:	sysdep.c config.h lisp.h filetypes.h termhooks.h termchar.h termopts.h dispextern.h ndir.h emacssignal.h dosfns.h dpmi.h
term.obj:	term.c config.h termhooks.h termchar.h termopts.h cm.h
termcap.obj:	termcap.c config.h
terminfo.obj:	terminfo.c 
tparam.obj:	tparam.c config.h
undo.obj:	undo.c config.h lisp.h buffer.h
unexaix.obj:	unexaix.c config.h getpagesize.h
unexconv.obj:	unexconv.c config.h getpagesize.h
unexec.obj:	unexec.c config.h getpagesize.h
unexelf.obj:	unexelf.c 
unexenix.obj:	unexenix.c config.h
unexfx28.obj:	unexfx28.c 
unexhp9k.obj:	unexhp9k.c 
unexmips.obj:	unexmips.c config.h getpagesize.h
unexnext.obj:	unexnext.c 
unexshm.obj:	unexshm.c config.h paths.h lisp.h
window.obj:	window.c config.h lisp.h buffer.h window.h commands.h indent.h termchar.h
x11fns.obj:	x11fns.c config.h x11term.h dispextern.h termchar.h gettime.h lisp.h window.h
x11term.obj:	x11term.c config.h lisp.h x11term.h X11/Xresource.h gettime.h dispextern.h termhooks.h termopts.h termchar.h sink11.h sink11mask.h xkeys-aix.h
xdisp.obj:	xdisp.c config.h lisp.h window.h termchar.h dispextern.h buffer.h indent.h commands.h macros.h
xfns.obj:	xfns.c config.h lisp.h window.h xterm.h dispextern.h termchar.h
xmenu.obj:	xmenu.c config.h x11term.h xterm.h lisp.h window.h dispextern.h ../oldXMenu/XMenu.h termopts.h
