# Makefile to build the RPC Compiler from sources shipped from VMS
#
#	There are two routes - the Pacsal one is preferred.
# pascal/mips:
#	Just pc the code -- but remove occuences
# Pascal/vax:
#	The original source is massaged to make it all lowercase and to
#	remove udnerscores, then compiled using pc.
#
# C:
#	The original source is massaged with sed, translated into C
#	and then compiled with cc.
#
SRC =	main.pas decglob.pas error.pas debug.pas init.pas options.pas \
	getoken.pas parser.pas codegen.pas

#SRC2 =  main.p decglob.p error.p debug.p init.p options.p \
#        getoken.p parser.p uti_gen.p cli_gen.p ser_gen.p

#rpcc.p : $(SRC)
#        include UNIXBSD < main.pas > rpcc.p

default : rpcc.c rpcc
	touch default

#       pre_ptc.sed strips form feed characters.
rpcc.c : rpcc.p
	sed <rpcc.p -f pre_ptc.sed | ptc >rpcc.c

rpcc_c : rpcc.c
	cc -o rpcc_c rpcc.c
	chmod +x rpcc_c

rpcc : rpcc.p
	pc -o rpcc rpcc.p

#rpcc : rpcc1.p
#	pc -o rpcc rpcc1.p
#	chmod +x rpcc

rpcc1.p : rpcc.p
	pastolow <rpcc.p > rpcc1.p

#.p.pas:
#        skipctlz < $*.pas > $*.p
#
#print:
#        printc -c $(SRC)

