#
# Make all files necessary for an IBM 370 VM/CMS kit.  The
# resulting kit is under ./tmp.  No dependencies are kept -- only files
# missing from ./tmp are remade.
#

SOURCE=tmp/compiler.pascal
SUPPORT=tmp/textmacr.data tmp/property.data tmp/cmperror.mem tmp/compiler.cmd
KIT= \
	tmp/cmpcmds.data \
	tmp/cmpexpln.test \
	tmp/cmpkit.exec \
	tmp/cmpmkfil.exec \
	tmp/cmpsrc.exec \
	tmp/cmptest.exec \
	tmp/cmptkit.exec \
	tmp/cmptmade.exec
SCRIPTS= \
	tmp/cmpassgn.exec \
	tmp/compile.exec

IBM=-S32 -SVS -VAX -BSD42 -UNIX +370 -ELXSI -c -: "-^" -t

SRC_ROOT=/u2/bh

all: ${SOURCE} ${KIT} ${SUPPORT} ${SCRIPTS}

clean:
	rm -f tmp/* *.out *junk junk* *.tmp

tmp/compiler.pascal: ../shared/bigfile ../shared/lcshorten
	make ../scald/source/vopen.types ../scald/source/cms.version
	( cd ../scald/source ;\
	  make structures ;\
	  ../../shared/bigfile ${IBM} <compiler.pas >../../ibm/comp.tmp )
	../shared/lcshorten comp.tmp tmp/compiler.pascal ibm.crf comp.crf.tmp
	rm ../scald/source/vopen.types ../scald/source/cms.version

../scald/source/vopen.types: ALWAYS
	(cd ${SRC_ROOT}/shared ; make cms)
	cp ${SRC_ROOT}/shared/cms/vopen.types ../scald/source
../scald/source/cms.version: ALWAYS
	(cd ../pcomp ; make version)
	../pcomp/version scald | sed -f version.sed > ../scald/source/cms.version
tmp/textmacr.data:
	ln ../misc/textmacro.dat tmp/textmacr.data
tmp/property.data:
	ln ../misc/property.dat tmp/property.data
tmp/cmperror.mem:
	ln ../misc/cmperrors.mem tmp/cmperror.mem
tmp/compiler.cmd:
	ln ../misc/compiler.user.cmd tmp/compiler.cmd

tmp/cmpassgn.exec:
	ln save/cmpassgn.exec tmp
tmp/compile.exec:
	ln save/compile.exec tmp

tmp/cmpcmds.data:
	ln save/cmpcmds.data tmp
tmp/cmpexpln.test:
	ln save/cmpexpln.test tmp
tmp/cmpkit.exec:
	ln save/cmpkit.exec tmp
tmp/cmpmkfil.exec:
	ln save/cmpmkfil.exec tmp
tmp/cmpsrc.exec:
	ln save/cmpsrc.exec tmp
tmp/cmptest.exec:
	ln save/cmptest.exec tmp
tmp/cmptkit.exec:
	ln save/cmptkit.exec tmp
tmp/cmptmade.exec:
	ln save/cmptmade.exec tmp

../shared/bigfile:
	(cd ../shared ; make bigfile)
../shared/lcshorten:
	(cd ../shared ; make lcshorten)
