# cause .c files to be compiled with /debug to create .obj files
.c.obj:
	- delete $*.obj;*	# delete old .obj files
	cc/debug $*		# compile the suckers

.mar.obj:
	- delete $*.obj;*	# delete old .obj files
	macro/debug $*		# compile the suckers

# these are the modules that make up status program
STATUS_MODS =  status build_lists build_select build_sort cli compare\
               format init lookup_terminal readport search_keywords\
               epid_to_ipid devices terminal\
               decnet

# here's the first rule.. Causes everything to get checked..
status.exe : $(STATUS_MODS).obj
	- delete $@;*
	link/notrace $(STATUS_MODS), c/option,sys\$system:sys.stb/select

# This forces a relink, with /debug
debug : $(STATUS_MODS).obj
	link/debug $(STATUS_MODS), c/option, sys\$system:sys.stb/select

cleanup:	# cleanup for DECUS submission
	-delete epid_to_ipid.obj;*
	-delete devices.obj;*
	-delete terminal.obj;*
	-delete keywords.h;*
	-delete status.h;*
	-purge
	-rename *.* ;1

# okay, here come the object files..

status.obj : $*.c keywords.h status.h

cli.obj : $*.c

readport.obj : $*.c

epid_to_ipid.obj : $*.mar

devices.obj : $*.mar

terminal.obj : $*.mar

decnet.obj : $*.for

# all modules (except the ones above) include status.h only
(STATUS_MODS).obj : $*.c status.h

order.exe : $*.c
	cc/debug $*		# compile order.c
	- delete $@;*		# delete order.exe
	link $*,c/option	# link the sucker
	- delete $*.obj;*	# delete the .obj file

keywords.h status.h : keywords.dat order.exe
	- delete keywords.h;*, status.h;*	# delete the old ones
	run order				# recreate them
