SYSDIR = dss_system:		# make system will put things here.
FACSDIR = facs:[global.util]	# Distribute with FACS too
DISTDIR = [.dist]

LINK = link'lflags'		# if debugging, lflags will be /debug.

OBJS = make.obj,-
	mstring.obj,-
	cmdline.obj,-
	makecmd.obj,-
	dates.obj,-
	make.opt/opt

make: make.exe make.doc make.hlp # This is the executable.

system: ${SYSDIR}make.exe ${SYSDIR}make.ini ${FACSDIR}make.exe

make.doc: make.rno
	runoff /variant=doc /output=make.doc make.rno

make.hlp: make.rno
	runoff /variant=help /output=make.hlp make.rno

# 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.

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

make.obj: make.h functions.h cmdline.h strings.h simple.h
mstring.obj: make.h functions.h simple.h
cmdline.obj: cmdline.h strings.h
dates.obj: simple.h strings.h cmdline.h

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

${DISTDIR}make.exe: make.exe
	copy make.exe ${DISTDIR}/log

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

${FACSDIR}make.exe: make.exe
	copy make.exe ${FACSDIR}/log

clean:
	purge/log
	purge/log ${DISTDIR}

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

lib: make.olb(make)

make.olb(make): make.obj
	lib make make

EXAMPLES = makefile.,make.ini
RELEASE_NOTES = release.v33
SOURCES = make.c,mstring.c,cmdline.c,dates.c,makecmd.cld,-
	make.h,functions.h,cmdline.h,strings.h,simple.h,-
	make.opt
DISTLIST =  ${RELEASE_NOTES},${EXAMPLES},make.exe,${SOURCES}

dist: dist.dir ${DISTDIR}make.mft
	purge/log ${DISTDIR}

${DISTDIR}make.bck: ${DISTLIST}
	purge/log
	backup/list/buffer=5 ${DISTLIST} ${DISTDIR}make.bck/save
