# If no target is specified, then the first non-default target will be made.

make: make.exe	# This is the executable.

dmake: debug dmake.exe

SYSDIR = sei$lib:[make]		# make system will put things here.
LINK = link'lflags'		# if debugging, lflags will be /debug.
OBJS = make.obj mstring.obj readlib.obj	# prerequisites list of objects.
OBJLIST = make.obj,mstring.obj,readlib.obj # link command list of objects.


# the following rules could just as easily go in MAKE.INI

*.obj : *.c
	cc/list'cflags' $*


# the backslash '\' is the continuation character if it occurs as
# the last non-white character on the line.
# the hyphen '-' is the DCL continuation character, so if it occurs
# as the last non-white character on the line, the next line will
# not have the dollar sign '$' prepended.

dmake.exe: ${OBJS}
	${LINK}/exe=dmake ${OBJLIST}

make.exe: ${OBJS}
	${LINK} ${OBJLIST}

debug:
	cflags := /debug/noopt
	lflags := /debug

dist: make.exe dist.dir;1 dist_move dist_clean

dist.dir;1:
	cre/dir/log [.dist]

dist_move:
	copy make.exe [.dist]/log
	copy make.1 [.dist]/log
	copy makefile. [.dist]/log
	copy aaareadme.txt [.dist]/log

dist_clean:
	pur/log [.dist]

system: make.exe move clean

help:
	make ?

move:
	copy make.exe ${SYSDIR}/log

clean:
	delete *.obj;*
	delete *.lis;*
	purge/log
	purge/log [-]

make.obj: make.h mstring.h

mstring.obj: mstring.h

test_$:		# the dollar sign at the end of the line
# means don't put a dollar sign at the beginning of the line in the
# command file.
 type sys$input:
	Now is the time for all good men to come to the aid of their $ #test
	countrymen. $ !test

test: make.olb(make)

make.olb(make): make.c
	cc make
	lib make make

*.olb:
	lib/cre $*
