Sfoglia il codice sorgente

added rcsid
Tried to make machine independent,
machine independent sources now taken from ../../proto/cg
Changed according to suggestion from ceriel to prevent running cgg twice

sater 40 anni fa
parent
commit
c4826294dc
6 ha cambiato i file con 708 aggiunte e 678 eliminazioni
  1. 118 113
      mach/6500/cg/Makefile
  2. 118 113
      mach/pdp/cg/Makefile
  3. 118 113
      mach/proto/cg/Makefile
  4. 118 113
      mach/vax4/cg/Makefile
  5. 118 113
      mach/z80/cg/Makefile
  6. 118 113
      mach/z8000/cg/Makefile

+ 118 - 113
mach/6500/cg/Makefile

@@ -1,31 +1,39 @@
+# $Header$
+
 PREFLAGS=-I../../../h -DNDEBUG
 PFLAGS=
 CFLAGS=$(PREFLAGS) $(PFLAGS) -O
 LDFLAGS=-i $(PFLAGS)
 LINTOPTS=-hbxac
 LIBS=../../../lib/em_data.a
-CFILES=codegen.c compute.c equiv.c fillem.c gencode.c glosym.c main.c\
-       move.c nextem.c reg.c regvar.c salloc.c state.c subr.c var.c
+CDIR=../../proto/cg
+CFILES=$(CDIR)/codegen.c $(CDIR)/compute.c $(CDIR)/equiv.c $(CDIR)/fillem.c \
+       $(CDIR)/gencode.c $(CDIR)/glosym.c $(CDIR)/main.c $(CDIR)/move.c \
+       $(CDIR)/nextem.c $(CDIR)/reg.c $(CDIR)/regvar.c $(CDIR)/salloc.c \
+       $(CDIR)/state.c $(CDIR)/subr.c $(CDIR)/var.c
 OFILES=codegen.o compute.o equiv.o fillem.o gencode.o glosym.o main.o\
        move.o nextem.o reg.o regvar.o salloc.o state.o subr.o var.o
 
+all:
+	make tables.c
+	make cg
+
 cg: tables.o $(OFILES)
 	cc $(LDFLAGS) $(OFILES) tables.o $(LIBS) -o cg
-	touch tables.h tables.c tables.o $(OFILES) cg
 
 tables.o: tables.c
 	cc -c $(PREFLAGS) tables.c
 
-install: cg
-	cp cg ../../../lib/pdp_cg
+install: all
+	../install cg
 
-cmp:	 cg
+cmp:	 all
 	-../compare cg
 
 
-tables.h tables.c: pdptable
+tables.c: table
 	-mv tables.h tables.h.save
-	../../../lib/cpp -P pdptable | ../../../lib/cgg > debug.out
+	../../../lib/cpp -P table | ../../../lib/cgg > debug.out
 	-if cmp -s tables.h.save tables.h; then mv tables.h.save tables.h; else exit 0; fi
 	-if cmp -s /dev/null tables.h; then mv tables.h.save tables.h; else exit 0; fi
 
@@ -33,110 +41,107 @@ lint: $(CFILES)
 	lint $(LINTOPTS) $(PREFLAGS) $(CFILES)
 clean:
 	rm -f *.o tables.c
-depend:
-	makedepend `grep -v '\.h' sources`
-# the next lines are generated automatically
-# AUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTO
-codegen.o:	assert.h
-codegen.o:	data.h
-codegen.o:	equiv.h
-codegen.o:	extern.h
-codegen.o:	param.h
-codegen.o:	result.h
-codegen.o:	state.h
-codegen.o:	tables.h
-codegen.o:	types.h
-compute.o:	assert.h
-compute.o:	data.h
-compute.o:	extern.h
-compute.o:	glosym.h
-compute.o:	param.h
-compute.o:	result.h
-compute.o:	tables.h
-compute.o:	types.h
-equiv.o:	assert.h
-equiv.o:	data.h
-equiv.o:	equiv.h
-equiv.o:	extern.h
-equiv.o:	param.h
-equiv.o:	result.h
-equiv.o:	tables.h
-equiv.o:	types.h
-fillem.o:	assert.h
-fillem.o:	data.h
-fillem.o:	extern.h
+
+codegen.o:	$(CDIR)assert.h
+codegen.o:	$(CDIR)data.h
+codegen.o:	$(CDIR)equiv.h
+codegen.o:	$(CDIR)extern.h
+codegen.o:	$(CDIR)param.h
+codegen.o:	$(CDIR)result.h
+codegen.o:	$(CDIR)state.h
+codegen.o:	$(CDIR)tables.h
+codegen.o:	$(CDIR)types.h
+compute.o:	$(CDIR)assert.h
+compute.o:	$(CDIR)data.h
+compute.o:	$(CDIR)extern.h
+compute.o:	$(CDIR)glosym.h
+compute.o:	$(CDIR)param.h
+compute.o:	$(CDIR)result.h
+compute.o:	$(CDIR)tables.h
+compute.o:	$(CDIR)types.h
+equiv.o:	$(CDIR)assert.h
+equiv.o:	$(CDIR)data.h
+equiv.o:	$(CDIR)equiv.h
+equiv.o:	$(CDIR)extern.h
+equiv.o:	$(CDIR)param.h
+equiv.o:	$(CDIR)result.h
+equiv.o:	$(CDIR)tables.h
+equiv.o:	$(CDIR)types.h
+fillem.o:	$(CDIR)assert.h
+fillem.o:	$(CDIR)data.h
+fillem.o:	$(CDIR)extern.h
 fillem.o:	mach.c
 fillem.o:	mach.h
-fillem.o:	param.h
-fillem.o:	regvar.h
-fillem.o:	result.h
-fillem.o:	tables.h
-fillem.o:	types.h
-gencode.o:	assert.h
-gencode.o:	data.h
-gencode.o:	extern.h
-gencode.o:	param.h
-gencode.o:	result.h
-gencode.o:	tables.h
-gencode.o:	types.h
-glosym.o:	glosym.h
-glosym.o:	param.h
-glosym.o:	tables.h
-glosym.o:	types.h
-main.o:	param.h
-move.o:	assert.h
-move.o:	data.h
-move.o:	extern.h
-move.o:	param.h
-move.o:	result.h
-move.o:	tables.h
-move.o:	types.h
-nextem.o:	assert.h
-nextem.o:	data.h
-nextem.o:	extern.h
-nextem.o:	param.h
-nextem.o:	result.h
-nextem.o:	tables.h
-nextem.o:	types.h
-reg.o:	assert.h
-reg.o:	data.h
-reg.o:	extern.h
-reg.o:	param.h
-reg.o:	result.h
-reg.o:	tables.h
-reg.o:	types.h
-regvar.o:	assert.h
-regvar.o:	data.h
-regvar.o:	extern.h
-regvar.o:	param.h
-regvar.o:	regvar.h
-regvar.o:	result.h
-regvar.o:	tables.h
-regvar.o:	types.h
-salloc.o:	assert.h
-salloc.o:	data.h
-salloc.o:	extern.h
-salloc.o:	param.h
-salloc.o:	result.h
-salloc.o:	tables.h
-salloc.o:	types.h
-state.o:	assert.h
-state.o:	data.h
-state.o:	extern.h
-state.o:	param.h
-state.o:	result.h
-state.o:	state.h
-state.o:	tables.h
-state.o:	types.h
-subr.o:	assert.h
-subr.o:	data.h
-subr.o:	extern.h
-subr.o:	param.h
-subr.o:	result.h
-subr.o:	tables.h
-subr.o:	types.h
-var.o:	data.h
-var.o:	param.h
-var.o:	result.h
-var.o:	tables.h
-var.o:	types.h
+fillem.o:	$(CDIR)param.h
+fillem.o:	$(CDIR)regvar.h
+fillem.o:	$(CDIR)result.h
+fillem.o:	$(CDIR)tables.h
+fillem.o:	$(CDIR)types.h
+gencode.o:	$(CDIR)assert.h
+gencode.o:	$(CDIR)data.h
+gencode.o:	$(CDIR)extern.h
+gencode.o:	$(CDIR)param.h
+gencode.o:	$(CDIR)result.h
+gencode.o:	$(CDIR)tables.h
+gencode.o:	$(CDIR)types.h
+glosym.o:	$(CDIR)glosym.h
+glosym.o:	$(CDIR)param.h
+glosym.o:	$(CDIR)tables.h
+glosym.o:	$(CDIR)types.h
+main.o:	$(CDIR)param.h
+move.o:	$(CDIR)assert.h
+move.o:	$(CDIR)data.h
+move.o:	$(CDIR)extern.h
+move.o:	$(CDIR)param.h
+move.o:	$(CDIR)result.h
+move.o:	$(CDIR)tables.h
+move.o:	$(CDIR)types.h
+nextem.o:	$(CDIR)assert.h
+nextem.o:	$(CDIR)data.h
+nextem.o:	$(CDIR)extern.h
+nextem.o:	$(CDIR)param.h
+nextem.o:	$(CDIR)result.h
+nextem.o:	$(CDIR)tables.h
+nextem.o:	$(CDIR)types.h
+reg.o:	$(CDIR)assert.h
+reg.o:	$(CDIR)data.h
+reg.o:	$(CDIR)extern.h
+reg.o:	$(CDIR)param.h
+reg.o:	$(CDIR)result.h
+reg.o:	$(CDIR)tables.h
+reg.o:	$(CDIR)types.h
+regvar.o:	$(CDIR)assert.h
+regvar.o:	$(CDIR)data.h
+regvar.o:	$(CDIR)extern.h
+regvar.o:	$(CDIR)param.h
+regvar.o:	$(CDIR)regvar.h
+regvar.o:	$(CDIR)result.h
+regvar.o:	$(CDIR)tables.h
+regvar.o:	$(CDIR)types.h
+salloc.o:	$(CDIR)assert.h
+salloc.o:	$(CDIR)data.h
+salloc.o:	$(CDIR)extern.h
+salloc.o:	$(CDIR)param.h
+salloc.o:	$(CDIR)result.h
+salloc.o:	$(CDIR)tables.h
+salloc.o:	$(CDIR)types.h
+state.o:	$(CDIR)assert.h
+state.o:	$(CDIR)data.h
+state.o:	$(CDIR)extern.h
+state.o:	$(CDIR)param.h
+state.o:	$(CDIR)result.h
+state.o:	$(CDIR)state.h
+state.o:	$(CDIR)tables.h
+state.o:	$(CDIR)types.h
+subr.o:	$(CDIR)assert.h
+subr.o:	$(CDIR)data.h
+subr.o:	$(CDIR)extern.h
+subr.o:	$(CDIR)param.h
+subr.o:	$(CDIR)result.h
+subr.o:	$(CDIR)tables.h
+subr.o:	$(CDIR)types.h
+var.o:	$(CDIR)data.h
+var.o:	$(CDIR)param.h
+var.o:	$(CDIR)result.h
+var.o:	$(CDIR)tables.h
+var.o:	$(CDIR)types.h

+ 118 - 113
mach/pdp/cg/Makefile

@@ -1,31 +1,39 @@
+# $Header$
+
 PREFLAGS=-I../../../h -DNDEBUG
 PFLAGS=
 CFLAGS=$(PREFLAGS) $(PFLAGS) -O
 LDFLAGS=-i $(PFLAGS)
 LINTOPTS=-hbxac
 LIBS=../../../lib/em_data.a
-CFILES=codegen.c compute.c equiv.c fillem.c gencode.c glosym.c main.c\
-       move.c nextem.c reg.c regvar.c salloc.c state.c subr.c var.c
+CDIR=../../proto/cg
+CFILES=$(CDIR)/codegen.c $(CDIR)/compute.c $(CDIR)/equiv.c $(CDIR)/fillem.c \
+       $(CDIR)/gencode.c $(CDIR)/glosym.c $(CDIR)/main.c $(CDIR)/move.c \
+       $(CDIR)/nextem.c $(CDIR)/reg.c $(CDIR)/regvar.c $(CDIR)/salloc.c \
+       $(CDIR)/state.c $(CDIR)/subr.c $(CDIR)/var.c
 OFILES=codegen.o compute.o equiv.o fillem.o gencode.o glosym.o main.o\
        move.o nextem.o reg.o regvar.o salloc.o state.o subr.o var.o
 
+all:
+	make tables.c
+	make cg
+
 cg: tables.o $(OFILES)
 	cc $(LDFLAGS) $(OFILES) tables.o $(LIBS) -o cg
-	touch tables.h tables.c tables.o $(OFILES) cg
 
 tables.o: tables.c
 	cc -c $(PREFLAGS) tables.c
 
-install: cg
-	cp cg ../../../lib/pdp_cg
+install: all
+	../install cg
 
-cmp:	 cg
+cmp:	 all
 	-../compare cg
 
 
-tables.h tables.c: pdptable
+tables.c: table
 	-mv tables.h tables.h.save
-	../../../lib/cpp -P pdptable | ../../../lib/cgg > debug.out
+	../../../lib/cpp -P table | ../../../lib/cgg > debug.out
 	-if cmp -s tables.h.save tables.h; then mv tables.h.save tables.h; else exit 0; fi
 	-if cmp -s /dev/null tables.h; then mv tables.h.save tables.h; else exit 0; fi
 
@@ -33,110 +41,107 @@ lint: $(CFILES)
 	lint $(LINTOPTS) $(PREFLAGS) $(CFILES)
 clean:
 	rm -f *.o tables.c
-depend:
-	makedepend `grep -v '\.h' sources`
-# the next lines are generated automatically
-# AUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTO
-codegen.o:	assert.h
-codegen.o:	data.h
-codegen.o:	equiv.h
-codegen.o:	extern.h
-codegen.o:	param.h
-codegen.o:	result.h
-codegen.o:	state.h
-codegen.o:	tables.h
-codegen.o:	types.h
-compute.o:	assert.h
-compute.o:	data.h
-compute.o:	extern.h
-compute.o:	glosym.h
-compute.o:	param.h
-compute.o:	result.h
-compute.o:	tables.h
-compute.o:	types.h
-equiv.o:	assert.h
-equiv.o:	data.h
-equiv.o:	equiv.h
-equiv.o:	extern.h
-equiv.o:	param.h
-equiv.o:	result.h
-equiv.o:	tables.h
-equiv.o:	types.h
-fillem.o:	assert.h
-fillem.o:	data.h
-fillem.o:	extern.h
+
+codegen.o:	$(CDIR)assert.h
+codegen.o:	$(CDIR)data.h
+codegen.o:	$(CDIR)equiv.h
+codegen.o:	$(CDIR)extern.h
+codegen.o:	$(CDIR)param.h
+codegen.o:	$(CDIR)result.h
+codegen.o:	$(CDIR)state.h
+codegen.o:	$(CDIR)tables.h
+codegen.o:	$(CDIR)types.h
+compute.o:	$(CDIR)assert.h
+compute.o:	$(CDIR)data.h
+compute.o:	$(CDIR)extern.h
+compute.o:	$(CDIR)glosym.h
+compute.o:	$(CDIR)param.h
+compute.o:	$(CDIR)result.h
+compute.o:	$(CDIR)tables.h
+compute.o:	$(CDIR)types.h
+equiv.o:	$(CDIR)assert.h
+equiv.o:	$(CDIR)data.h
+equiv.o:	$(CDIR)equiv.h
+equiv.o:	$(CDIR)extern.h
+equiv.o:	$(CDIR)param.h
+equiv.o:	$(CDIR)result.h
+equiv.o:	$(CDIR)tables.h
+equiv.o:	$(CDIR)types.h
+fillem.o:	$(CDIR)assert.h
+fillem.o:	$(CDIR)data.h
+fillem.o:	$(CDIR)extern.h
 fillem.o:	mach.c
 fillem.o:	mach.h
-fillem.o:	param.h
-fillem.o:	regvar.h
-fillem.o:	result.h
-fillem.o:	tables.h
-fillem.o:	types.h
-gencode.o:	assert.h
-gencode.o:	data.h
-gencode.o:	extern.h
-gencode.o:	param.h
-gencode.o:	result.h
-gencode.o:	tables.h
-gencode.o:	types.h
-glosym.o:	glosym.h
-glosym.o:	param.h
-glosym.o:	tables.h
-glosym.o:	types.h
-main.o:	param.h
-move.o:	assert.h
-move.o:	data.h
-move.o:	extern.h
-move.o:	param.h
-move.o:	result.h
-move.o:	tables.h
-move.o:	types.h
-nextem.o:	assert.h
-nextem.o:	data.h
-nextem.o:	extern.h
-nextem.o:	param.h
-nextem.o:	result.h
-nextem.o:	tables.h
-nextem.o:	types.h
-reg.o:	assert.h
-reg.o:	data.h
-reg.o:	extern.h
-reg.o:	param.h
-reg.o:	result.h
-reg.o:	tables.h
-reg.o:	types.h
-regvar.o:	assert.h
-regvar.o:	data.h
-regvar.o:	extern.h
-regvar.o:	param.h
-regvar.o:	regvar.h
-regvar.o:	result.h
-regvar.o:	tables.h
-regvar.o:	types.h
-salloc.o:	assert.h
-salloc.o:	data.h
-salloc.o:	extern.h
-salloc.o:	param.h
-salloc.o:	result.h
-salloc.o:	tables.h
-salloc.o:	types.h
-state.o:	assert.h
-state.o:	data.h
-state.o:	extern.h
-state.o:	param.h
-state.o:	result.h
-state.o:	state.h
-state.o:	tables.h
-state.o:	types.h
-subr.o:	assert.h
-subr.o:	data.h
-subr.o:	extern.h
-subr.o:	param.h
-subr.o:	result.h
-subr.o:	tables.h
-subr.o:	types.h
-var.o:	data.h
-var.o:	param.h
-var.o:	result.h
-var.o:	tables.h
-var.o:	types.h
+fillem.o:	$(CDIR)param.h
+fillem.o:	$(CDIR)regvar.h
+fillem.o:	$(CDIR)result.h
+fillem.o:	$(CDIR)tables.h
+fillem.o:	$(CDIR)types.h
+gencode.o:	$(CDIR)assert.h
+gencode.o:	$(CDIR)data.h
+gencode.o:	$(CDIR)extern.h
+gencode.o:	$(CDIR)param.h
+gencode.o:	$(CDIR)result.h
+gencode.o:	$(CDIR)tables.h
+gencode.o:	$(CDIR)types.h
+glosym.o:	$(CDIR)glosym.h
+glosym.o:	$(CDIR)param.h
+glosym.o:	$(CDIR)tables.h
+glosym.o:	$(CDIR)types.h
+main.o:	$(CDIR)param.h
+move.o:	$(CDIR)assert.h
+move.o:	$(CDIR)data.h
+move.o:	$(CDIR)extern.h
+move.o:	$(CDIR)param.h
+move.o:	$(CDIR)result.h
+move.o:	$(CDIR)tables.h
+move.o:	$(CDIR)types.h
+nextem.o:	$(CDIR)assert.h
+nextem.o:	$(CDIR)data.h
+nextem.o:	$(CDIR)extern.h
+nextem.o:	$(CDIR)param.h
+nextem.o:	$(CDIR)result.h
+nextem.o:	$(CDIR)tables.h
+nextem.o:	$(CDIR)types.h
+reg.o:	$(CDIR)assert.h
+reg.o:	$(CDIR)data.h
+reg.o:	$(CDIR)extern.h
+reg.o:	$(CDIR)param.h
+reg.o:	$(CDIR)result.h
+reg.o:	$(CDIR)tables.h
+reg.o:	$(CDIR)types.h
+regvar.o:	$(CDIR)assert.h
+regvar.o:	$(CDIR)data.h
+regvar.o:	$(CDIR)extern.h
+regvar.o:	$(CDIR)param.h
+regvar.o:	$(CDIR)regvar.h
+regvar.o:	$(CDIR)result.h
+regvar.o:	$(CDIR)tables.h
+regvar.o:	$(CDIR)types.h
+salloc.o:	$(CDIR)assert.h
+salloc.o:	$(CDIR)data.h
+salloc.o:	$(CDIR)extern.h
+salloc.o:	$(CDIR)param.h
+salloc.o:	$(CDIR)result.h
+salloc.o:	$(CDIR)tables.h
+salloc.o:	$(CDIR)types.h
+state.o:	$(CDIR)assert.h
+state.o:	$(CDIR)data.h
+state.o:	$(CDIR)extern.h
+state.o:	$(CDIR)param.h
+state.o:	$(CDIR)result.h
+state.o:	$(CDIR)state.h
+state.o:	$(CDIR)tables.h
+state.o:	$(CDIR)types.h
+subr.o:	$(CDIR)assert.h
+subr.o:	$(CDIR)data.h
+subr.o:	$(CDIR)extern.h
+subr.o:	$(CDIR)param.h
+subr.o:	$(CDIR)result.h
+subr.o:	$(CDIR)tables.h
+subr.o:	$(CDIR)types.h
+var.o:	$(CDIR)data.h
+var.o:	$(CDIR)param.h
+var.o:	$(CDIR)result.h
+var.o:	$(CDIR)tables.h
+var.o:	$(CDIR)types.h

+ 118 - 113
mach/proto/cg/Makefile

@@ -1,31 +1,39 @@
+# $Header$
+
 PREFLAGS=-I../../../h -DNDEBUG
 PFLAGS=
 CFLAGS=$(PREFLAGS) $(PFLAGS) -O
 LDFLAGS=-i $(PFLAGS)
 LINTOPTS=-hbxac
 LIBS=../../../lib/em_data.a
-CFILES=codegen.c compute.c equiv.c fillem.c gencode.c glosym.c main.c\
-       move.c nextem.c reg.c regvar.c salloc.c state.c subr.c var.c
+CDIR=../../proto/cg
+CFILES=$(CDIR)/codegen.c $(CDIR)/compute.c $(CDIR)/equiv.c $(CDIR)/fillem.c \
+       $(CDIR)/gencode.c $(CDIR)/glosym.c $(CDIR)/main.c $(CDIR)/move.c \
+       $(CDIR)/nextem.c $(CDIR)/reg.c $(CDIR)/regvar.c $(CDIR)/salloc.c \
+       $(CDIR)/state.c $(CDIR)/subr.c $(CDIR)/var.c
 OFILES=codegen.o compute.o equiv.o fillem.o gencode.o glosym.o main.o\
        move.o nextem.o reg.o regvar.o salloc.o state.o subr.o var.o
 
+all:
+	make tables.c
+	make cg
+
 cg: tables.o $(OFILES)
 	cc $(LDFLAGS) $(OFILES) tables.o $(LIBS) -o cg
-	touch tables.h tables.c tables.o $(OFILES) cg
 
 tables.o: tables.c
 	cc -c $(PREFLAGS) tables.c
 
-install: cg
-	cp cg ../../../lib/pdp_cg
+install: all
+	../install cg
 
-cmp:	 cg
+cmp:	 all
 	-../compare cg
 
 
-tables.h tables.c: pdptable
+tables.c: table
 	-mv tables.h tables.h.save
-	../../../lib/cpp -P pdptable | ../../../lib/cgg > debug.out
+	../../../lib/cpp -P table | ../../../lib/cgg > debug.out
 	-if cmp -s tables.h.save tables.h; then mv tables.h.save tables.h; else exit 0; fi
 	-if cmp -s /dev/null tables.h; then mv tables.h.save tables.h; else exit 0; fi
 
@@ -33,110 +41,107 @@ lint: $(CFILES)
 	lint $(LINTOPTS) $(PREFLAGS) $(CFILES)
 clean:
 	rm -f *.o tables.c
-depend:
-	makedepend `grep -v '\.h' sources`
-# the next lines are generated automatically
-# AUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTO
-codegen.o:	assert.h
-codegen.o:	data.h
-codegen.o:	equiv.h
-codegen.o:	extern.h
-codegen.o:	param.h
-codegen.o:	result.h
-codegen.o:	state.h
-codegen.o:	tables.h
-codegen.o:	types.h
-compute.o:	assert.h
-compute.o:	data.h
-compute.o:	extern.h
-compute.o:	glosym.h
-compute.o:	param.h
-compute.o:	result.h
-compute.o:	tables.h
-compute.o:	types.h
-equiv.o:	assert.h
-equiv.o:	data.h
-equiv.o:	equiv.h
-equiv.o:	extern.h
-equiv.o:	param.h
-equiv.o:	result.h
-equiv.o:	tables.h
-equiv.o:	types.h
-fillem.o:	assert.h
-fillem.o:	data.h
-fillem.o:	extern.h
+
+codegen.o:	$(CDIR)assert.h
+codegen.o:	$(CDIR)data.h
+codegen.o:	$(CDIR)equiv.h
+codegen.o:	$(CDIR)extern.h
+codegen.o:	$(CDIR)param.h
+codegen.o:	$(CDIR)result.h
+codegen.o:	$(CDIR)state.h
+codegen.o:	$(CDIR)tables.h
+codegen.o:	$(CDIR)types.h
+compute.o:	$(CDIR)assert.h
+compute.o:	$(CDIR)data.h
+compute.o:	$(CDIR)extern.h
+compute.o:	$(CDIR)glosym.h
+compute.o:	$(CDIR)param.h
+compute.o:	$(CDIR)result.h
+compute.o:	$(CDIR)tables.h
+compute.o:	$(CDIR)types.h
+equiv.o:	$(CDIR)assert.h
+equiv.o:	$(CDIR)data.h
+equiv.o:	$(CDIR)equiv.h
+equiv.o:	$(CDIR)extern.h
+equiv.o:	$(CDIR)param.h
+equiv.o:	$(CDIR)result.h
+equiv.o:	$(CDIR)tables.h
+equiv.o:	$(CDIR)types.h
+fillem.o:	$(CDIR)assert.h
+fillem.o:	$(CDIR)data.h
+fillem.o:	$(CDIR)extern.h
 fillem.o:	mach.c
 fillem.o:	mach.h
-fillem.o:	param.h
-fillem.o:	regvar.h
-fillem.o:	result.h
-fillem.o:	tables.h
-fillem.o:	types.h
-gencode.o:	assert.h
-gencode.o:	data.h
-gencode.o:	extern.h
-gencode.o:	param.h
-gencode.o:	result.h
-gencode.o:	tables.h
-gencode.o:	types.h
-glosym.o:	glosym.h
-glosym.o:	param.h
-glosym.o:	tables.h
-glosym.o:	types.h
-main.o:	param.h
-move.o:	assert.h
-move.o:	data.h
-move.o:	extern.h
-move.o:	param.h
-move.o:	result.h
-move.o:	tables.h
-move.o:	types.h
-nextem.o:	assert.h
-nextem.o:	data.h
-nextem.o:	extern.h
-nextem.o:	param.h
-nextem.o:	result.h
-nextem.o:	tables.h
-nextem.o:	types.h
-reg.o:	assert.h
-reg.o:	data.h
-reg.o:	extern.h
-reg.o:	param.h
-reg.o:	result.h
-reg.o:	tables.h
-reg.o:	types.h
-regvar.o:	assert.h
-regvar.o:	data.h
-regvar.o:	extern.h
-regvar.o:	param.h
-regvar.o:	regvar.h
-regvar.o:	result.h
-regvar.o:	tables.h
-regvar.o:	types.h
-salloc.o:	assert.h
-salloc.o:	data.h
-salloc.o:	extern.h
-salloc.o:	param.h
-salloc.o:	result.h
-salloc.o:	tables.h
-salloc.o:	types.h
-state.o:	assert.h
-state.o:	data.h
-state.o:	extern.h
-state.o:	param.h
-state.o:	result.h
-state.o:	state.h
-state.o:	tables.h
-state.o:	types.h
-subr.o:	assert.h
-subr.o:	data.h
-subr.o:	extern.h
-subr.o:	param.h
-subr.o:	result.h
-subr.o:	tables.h
-subr.o:	types.h
-var.o:	data.h
-var.o:	param.h
-var.o:	result.h
-var.o:	tables.h
-var.o:	types.h
+fillem.o:	$(CDIR)param.h
+fillem.o:	$(CDIR)regvar.h
+fillem.o:	$(CDIR)result.h
+fillem.o:	$(CDIR)tables.h
+fillem.o:	$(CDIR)types.h
+gencode.o:	$(CDIR)assert.h
+gencode.o:	$(CDIR)data.h
+gencode.o:	$(CDIR)extern.h
+gencode.o:	$(CDIR)param.h
+gencode.o:	$(CDIR)result.h
+gencode.o:	$(CDIR)tables.h
+gencode.o:	$(CDIR)types.h
+glosym.o:	$(CDIR)glosym.h
+glosym.o:	$(CDIR)param.h
+glosym.o:	$(CDIR)tables.h
+glosym.o:	$(CDIR)types.h
+main.o:	$(CDIR)param.h
+move.o:	$(CDIR)assert.h
+move.o:	$(CDIR)data.h
+move.o:	$(CDIR)extern.h
+move.o:	$(CDIR)param.h
+move.o:	$(CDIR)result.h
+move.o:	$(CDIR)tables.h
+move.o:	$(CDIR)types.h
+nextem.o:	$(CDIR)assert.h
+nextem.o:	$(CDIR)data.h
+nextem.o:	$(CDIR)extern.h
+nextem.o:	$(CDIR)param.h
+nextem.o:	$(CDIR)result.h
+nextem.o:	$(CDIR)tables.h
+nextem.o:	$(CDIR)types.h
+reg.o:	$(CDIR)assert.h
+reg.o:	$(CDIR)data.h
+reg.o:	$(CDIR)extern.h
+reg.o:	$(CDIR)param.h
+reg.o:	$(CDIR)result.h
+reg.o:	$(CDIR)tables.h
+reg.o:	$(CDIR)types.h
+regvar.o:	$(CDIR)assert.h
+regvar.o:	$(CDIR)data.h
+regvar.o:	$(CDIR)extern.h
+regvar.o:	$(CDIR)param.h
+regvar.o:	$(CDIR)regvar.h
+regvar.o:	$(CDIR)result.h
+regvar.o:	$(CDIR)tables.h
+regvar.o:	$(CDIR)types.h
+salloc.o:	$(CDIR)assert.h
+salloc.o:	$(CDIR)data.h
+salloc.o:	$(CDIR)extern.h
+salloc.o:	$(CDIR)param.h
+salloc.o:	$(CDIR)result.h
+salloc.o:	$(CDIR)tables.h
+salloc.o:	$(CDIR)types.h
+state.o:	$(CDIR)assert.h
+state.o:	$(CDIR)data.h
+state.o:	$(CDIR)extern.h
+state.o:	$(CDIR)param.h
+state.o:	$(CDIR)result.h
+state.o:	$(CDIR)state.h
+state.o:	$(CDIR)tables.h
+state.o:	$(CDIR)types.h
+subr.o:	$(CDIR)assert.h
+subr.o:	$(CDIR)data.h
+subr.o:	$(CDIR)extern.h
+subr.o:	$(CDIR)param.h
+subr.o:	$(CDIR)result.h
+subr.o:	$(CDIR)tables.h
+subr.o:	$(CDIR)types.h
+var.o:	$(CDIR)data.h
+var.o:	$(CDIR)param.h
+var.o:	$(CDIR)result.h
+var.o:	$(CDIR)tables.h
+var.o:	$(CDIR)types.h

+ 118 - 113
mach/vax4/cg/Makefile

@@ -1,31 +1,39 @@
+# $Header$
+
 PREFLAGS=-I../../../h -DNDEBUG
 PFLAGS=
 CFLAGS=$(PREFLAGS) $(PFLAGS) -O
 LDFLAGS=-i $(PFLAGS)
 LINTOPTS=-hbxac
 LIBS=../../../lib/em_data.a
-CFILES=codegen.c compute.c equiv.c fillem.c gencode.c glosym.c main.c\
-       move.c nextem.c reg.c regvar.c salloc.c state.c subr.c var.c
+CDIR=../../proto/cg
+CFILES=$(CDIR)/codegen.c $(CDIR)/compute.c $(CDIR)/equiv.c $(CDIR)/fillem.c \
+       $(CDIR)/gencode.c $(CDIR)/glosym.c $(CDIR)/main.c $(CDIR)/move.c \
+       $(CDIR)/nextem.c $(CDIR)/reg.c $(CDIR)/regvar.c $(CDIR)/salloc.c \
+       $(CDIR)/state.c $(CDIR)/subr.c $(CDIR)/var.c
 OFILES=codegen.o compute.o equiv.o fillem.o gencode.o glosym.o main.o\
        move.o nextem.o reg.o regvar.o salloc.o state.o subr.o var.o
 
+all:
+	make tables.c
+	make cg
+
 cg: tables.o $(OFILES)
 	cc $(LDFLAGS) $(OFILES) tables.o $(LIBS) -o cg
-	touch tables.h tables.c tables.o $(OFILES) cg
 
 tables.o: tables.c
 	cc -c $(PREFLAGS) tables.c
 
-install: cg
-	cp cg ../../../lib/pdp_cg
+install: all
+	../install cg
 
-cmp:	 cg
+cmp:	 all
 	-../compare cg
 
 
-tables.h tables.c: pdptable
+tables.c: table
 	-mv tables.h tables.h.save
-	../../../lib/cpp -P pdptable | ../../../lib/cgg > debug.out
+	../../../lib/cpp -P table | ../../../lib/cgg > debug.out
 	-if cmp -s tables.h.save tables.h; then mv tables.h.save tables.h; else exit 0; fi
 	-if cmp -s /dev/null tables.h; then mv tables.h.save tables.h; else exit 0; fi
 
@@ -33,110 +41,107 @@ lint: $(CFILES)
 	lint $(LINTOPTS) $(PREFLAGS) $(CFILES)
 clean:
 	rm -f *.o tables.c
-depend:
-	makedepend `grep -v '\.h' sources`
-# the next lines are generated automatically
-# AUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTO
-codegen.o:	assert.h
-codegen.o:	data.h
-codegen.o:	equiv.h
-codegen.o:	extern.h
-codegen.o:	param.h
-codegen.o:	result.h
-codegen.o:	state.h
-codegen.o:	tables.h
-codegen.o:	types.h
-compute.o:	assert.h
-compute.o:	data.h
-compute.o:	extern.h
-compute.o:	glosym.h
-compute.o:	param.h
-compute.o:	result.h
-compute.o:	tables.h
-compute.o:	types.h
-equiv.o:	assert.h
-equiv.o:	data.h
-equiv.o:	equiv.h
-equiv.o:	extern.h
-equiv.o:	param.h
-equiv.o:	result.h
-equiv.o:	tables.h
-equiv.o:	types.h
-fillem.o:	assert.h
-fillem.o:	data.h
-fillem.o:	extern.h
+
+codegen.o:	$(CDIR)assert.h
+codegen.o:	$(CDIR)data.h
+codegen.o:	$(CDIR)equiv.h
+codegen.o:	$(CDIR)extern.h
+codegen.o:	$(CDIR)param.h
+codegen.o:	$(CDIR)result.h
+codegen.o:	$(CDIR)state.h
+codegen.o:	$(CDIR)tables.h
+codegen.o:	$(CDIR)types.h
+compute.o:	$(CDIR)assert.h
+compute.o:	$(CDIR)data.h
+compute.o:	$(CDIR)extern.h
+compute.o:	$(CDIR)glosym.h
+compute.o:	$(CDIR)param.h
+compute.o:	$(CDIR)result.h
+compute.o:	$(CDIR)tables.h
+compute.o:	$(CDIR)types.h
+equiv.o:	$(CDIR)assert.h
+equiv.o:	$(CDIR)data.h
+equiv.o:	$(CDIR)equiv.h
+equiv.o:	$(CDIR)extern.h
+equiv.o:	$(CDIR)param.h
+equiv.o:	$(CDIR)result.h
+equiv.o:	$(CDIR)tables.h
+equiv.o:	$(CDIR)types.h
+fillem.o:	$(CDIR)assert.h
+fillem.o:	$(CDIR)data.h
+fillem.o:	$(CDIR)extern.h
 fillem.o:	mach.c
 fillem.o:	mach.h
-fillem.o:	param.h
-fillem.o:	regvar.h
-fillem.o:	result.h
-fillem.o:	tables.h
-fillem.o:	types.h
-gencode.o:	assert.h
-gencode.o:	data.h
-gencode.o:	extern.h
-gencode.o:	param.h
-gencode.o:	result.h
-gencode.o:	tables.h
-gencode.o:	types.h
-glosym.o:	glosym.h
-glosym.o:	param.h
-glosym.o:	tables.h
-glosym.o:	types.h
-main.o:	param.h
-move.o:	assert.h
-move.o:	data.h
-move.o:	extern.h
-move.o:	param.h
-move.o:	result.h
-move.o:	tables.h
-move.o:	types.h
-nextem.o:	assert.h
-nextem.o:	data.h
-nextem.o:	extern.h
-nextem.o:	param.h
-nextem.o:	result.h
-nextem.o:	tables.h
-nextem.o:	types.h
-reg.o:	assert.h
-reg.o:	data.h
-reg.o:	extern.h
-reg.o:	param.h
-reg.o:	result.h
-reg.o:	tables.h
-reg.o:	types.h
-regvar.o:	assert.h
-regvar.o:	data.h
-regvar.o:	extern.h
-regvar.o:	param.h
-regvar.o:	regvar.h
-regvar.o:	result.h
-regvar.o:	tables.h
-regvar.o:	types.h
-salloc.o:	assert.h
-salloc.o:	data.h
-salloc.o:	extern.h
-salloc.o:	param.h
-salloc.o:	result.h
-salloc.o:	tables.h
-salloc.o:	types.h
-state.o:	assert.h
-state.o:	data.h
-state.o:	extern.h
-state.o:	param.h
-state.o:	result.h
-state.o:	state.h
-state.o:	tables.h
-state.o:	types.h
-subr.o:	assert.h
-subr.o:	data.h
-subr.o:	extern.h
-subr.o:	param.h
-subr.o:	result.h
-subr.o:	tables.h
-subr.o:	types.h
-var.o:	data.h
-var.o:	param.h
-var.o:	result.h
-var.o:	tables.h
-var.o:	types.h
+fillem.o:	$(CDIR)param.h
+fillem.o:	$(CDIR)regvar.h
+fillem.o:	$(CDIR)result.h
+fillem.o:	$(CDIR)tables.h
+fillem.o:	$(CDIR)types.h
+gencode.o:	$(CDIR)assert.h
+gencode.o:	$(CDIR)data.h
+gencode.o:	$(CDIR)extern.h
+gencode.o:	$(CDIR)param.h
+gencode.o:	$(CDIR)result.h
+gencode.o:	$(CDIR)tables.h
+gencode.o:	$(CDIR)types.h
+glosym.o:	$(CDIR)glosym.h
+glosym.o:	$(CDIR)param.h
+glosym.o:	$(CDIR)tables.h
+glosym.o:	$(CDIR)types.h
+main.o:	$(CDIR)param.h
+move.o:	$(CDIR)assert.h
+move.o:	$(CDIR)data.h
+move.o:	$(CDIR)extern.h
+move.o:	$(CDIR)param.h
+move.o:	$(CDIR)result.h
+move.o:	$(CDIR)tables.h
+move.o:	$(CDIR)types.h
+nextem.o:	$(CDIR)assert.h
+nextem.o:	$(CDIR)data.h
+nextem.o:	$(CDIR)extern.h
+nextem.o:	$(CDIR)param.h
+nextem.o:	$(CDIR)result.h
+nextem.o:	$(CDIR)tables.h
+nextem.o:	$(CDIR)types.h
+reg.o:	$(CDIR)assert.h
+reg.o:	$(CDIR)data.h
+reg.o:	$(CDIR)extern.h
+reg.o:	$(CDIR)param.h
+reg.o:	$(CDIR)result.h
+reg.o:	$(CDIR)tables.h
+reg.o:	$(CDIR)types.h
+regvar.o:	$(CDIR)assert.h
+regvar.o:	$(CDIR)data.h
+regvar.o:	$(CDIR)extern.h
+regvar.o:	$(CDIR)param.h
+regvar.o:	$(CDIR)regvar.h
+regvar.o:	$(CDIR)result.h
+regvar.o:	$(CDIR)tables.h
+regvar.o:	$(CDIR)types.h
+salloc.o:	$(CDIR)assert.h
+salloc.o:	$(CDIR)data.h
+salloc.o:	$(CDIR)extern.h
+salloc.o:	$(CDIR)param.h
+salloc.o:	$(CDIR)result.h
+salloc.o:	$(CDIR)tables.h
+salloc.o:	$(CDIR)types.h
+state.o:	$(CDIR)assert.h
+state.o:	$(CDIR)data.h
+state.o:	$(CDIR)extern.h
+state.o:	$(CDIR)param.h
+state.o:	$(CDIR)result.h
+state.o:	$(CDIR)state.h
+state.o:	$(CDIR)tables.h
+state.o:	$(CDIR)types.h
+subr.o:	$(CDIR)assert.h
+subr.o:	$(CDIR)data.h
+subr.o:	$(CDIR)extern.h
+subr.o:	$(CDIR)param.h
+subr.o:	$(CDIR)result.h
+subr.o:	$(CDIR)tables.h
+subr.o:	$(CDIR)types.h
+var.o:	$(CDIR)data.h
+var.o:	$(CDIR)param.h
+var.o:	$(CDIR)result.h
+var.o:	$(CDIR)tables.h
+var.o:	$(CDIR)types.h

+ 118 - 113
mach/z80/cg/Makefile

@@ -1,31 +1,39 @@
+# $Header$
+
 PREFLAGS=-I../../../h -DNDEBUG
 PFLAGS=
 CFLAGS=$(PREFLAGS) $(PFLAGS) -O
 LDFLAGS=-i $(PFLAGS)
 LINTOPTS=-hbxac
 LIBS=../../../lib/em_data.a
-CFILES=codegen.c compute.c equiv.c fillem.c gencode.c glosym.c main.c\
-       move.c nextem.c reg.c regvar.c salloc.c state.c subr.c var.c
+CDIR=../../proto/cg
+CFILES=$(CDIR)/codegen.c $(CDIR)/compute.c $(CDIR)/equiv.c $(CDIR)/fillem.c \
+       $(CDIR)/gencode.c $(CDIR)/glosym.c $(CDIR)/main.c $(CDIR)/move.c \
+       $(CDIR)/nextem.c $(CDIR)/reg.c $(CDIR)/regvar.c $(CDIR)/salloc.c \
+       $(CDIR)/state.c $(CDIR)/subr.c $(CDIR)/var.c
 OFILES=codegen.o compute.o equiv.o fillem.o gencode.o glosym.o main.o\
        move.o nextem.o reg.o regvar.o salloc.o state.o subr.o var.o
 
+all:
+	make tables.c
+	make cg
+
 cg: tables.o $(OFILES)
 	cc $(LDFLAGS) $(OFILES) tables.o $(LIBS) -o cg
-	touch tables.h tables.c tables.o $(OFILES) cg
 
 tables.o: tables.c
 	cc -c $(PREFLAGS) tables.c
 
-install: cg
-	cp cg ../../../lib/pdp_cg
+install: all
+	../install cg
 
-cmp:	 cg
+cmp:	 all
 	-../compare cg
 
 
-tables.h tables.c: pdptable
+tables.c: table
 	-mv tables.h tables.h.save
-	../../../lib/cpp -P pdptable | ../../../lib/cgg > debug.out
+	../../../lib/cpp -P table | ../../../lib/cgg > debug.out
 	-if cmp -s tables.h.save tables.h; then mv tables.h.save tables.h; else exit 0; fi
 	-if cmp -s /dev/null tables.h; then mv tables.h.save tables.h; else exit 0; fi
 
@@ -33,110 +41,107 @@ lint: $(CFILES)
 	lint $(LINTOPTS) $(PREFLAGS) $(CFILES)
 clean:
 	rm -f *.o tables.c
-depend:
-	makedepend `grep -v '\.h' sources`
-# the next lines are generated automatically
-# AUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTO
-codegen.o:	assert.h
-codegen.o:	data.h
-codegen.o:	equiv.h
-codegen.o:	extern.h
-codegen.o:	param.h
-codegen.o:	result.h
-codegen.o:	state.h
-codegen.o:	tables.h
-codegen.o:	types.h
-compute.o:	assert.h
-compute.o:	data.h
-compute.o:	extern.h
-compute.o:	glosym.h
-compute.o:	param.h
-compute.o:	result.h
-compute.o:	tables.h
-compute.o:	types.h
-equiv.o:	assert.h
-equiv.o:	data.h
-equiv.o:	equiv.h
-equiv.o:	extern.h
-equiv.o:	param.h
-equiv.o:	result.h
-equiv.o:	tables.h
-equiv.o:	types.h
-fillem.o:	assert.h
-fillem.o:	data.h
-fillem.o:	extern.h
+
+codegen.o:	$(CDIR)assert.h
+codegen.o:	$(CDIR)data.h
+codegen.o:	$(CDIR)equiv.h
+codegen.o:	$(CDIR)extern.h
+codegen.o:	$(CDIR)param.h
+codegen.o:	$(CDIR)result.h
+codegen.o:	$(CDIR)state.h
+codegen.o:	$(CDIR)tables.h
+codegen.o:	$(CDIR)types.h
+compute.o:	$(CDIR)assert.h
+compute.o:	$(CDIR)data.h
+compute.o:	$(CDIR)extern.h
+compute.o:	$(CDIR)glosym.h
+compute.o:	$(CDIR)param.h
+compute.o:	$(CDIR)result.h
+compute.o:	$(CDIR)tables.h
+compute.o:	$(CDIR)types.h
+equiv.o:	$(CDIR)assert.h
+equiv.o:	$(CDIR)data.h
+equiv.o:	$(CDIR)equiv.h
+equiv.o:	$(CDIR)extern.h
+equiv.o:	$(CDIR)param.h
+equiv.o:	$(CDIR)result.h
+equiv.o:	$(CDIR)tables.h
+equiv.o:	$(CDIR)types.h
+fillem.o:	$(CDIR)assert.h
+fillem.o:	$(CDIR)data.h
+fillem.o:	$(CDIR)extern.h
 fillem.o:	mach.c
 fillem.o:	mach.h
-fillem.o:	param.h
-fillem.o:	regvar.h
-fillem.o:	result.h
-fillem.o:	tables.h
-fillem.o:	types.h
-gencode.o:	assert.h
-gencode.o:	data.h
-gencode.o:	extern.h
-gencode.o:	param.h
-gencode.o:	result.h
-gencode.o:	tables.h
-gencode.o:	types.h
-glosym.o:	glosym.h
-glosym.o:	param.h
-glosym.o:	tables.h
-glosym.o:	types.h
-main.o:	param.h
-move.o:	assert.h
-move.o:	data.h
-move.o:	extern.h
-move.o:	param.h
-move.o:	result.h
-move.o:	tables.h
-move.o:	types.h
-nextem.o:	assert.h
-nextem.o:	data.h
-nextem.o:	extern.h
-nextem.o:	param.h
-nextem.o:	result.h
-nextem.o:	tables.h
-nextem.o:	types.h
-reg.o:	assert.h
-reg.o:	data.h
-reg.o:	extern.h
-reg.o:	param.h
-reg.o:	result.h
-reg.o:	tables.h
-reg.o:	types.h
-regvar.o:	assert.h
-regvar.o:	data.h
-regvar.o:	extern.h
-regvar.o:	param.h
-regvar.o:	regvar.h
-regvar.o:	result.h
-regvar.o:	tables.h
-regvar.o:	types.h
-salloc.o:	assert.h
-salloc.o:	data.h
-salloc.o:	extern.h
-salloc.o:	param.h
-salloc.o:	result.h
-salloc.o:	tables.h
-salloc.o:	types.h
-state.o:	assert.h
-state.o:	data.h
-state.o:	extern.h
-state.o:	param.h
-state.o:	result.h
-state.o:	state.h
-state.o:	tables.h
-state.o:	types.h
-subr.o:	assert.h
-subr.o:	data.h
-subr.o:	extern.h
-subr.o:	param.h
-subr.o:	result.h
-subr.o:	tables.h
-subr.o:	types.h
-var.o:	data.h
-var.o:	param.h
-var.o:	result.h
-var.o:	tables.h
-var.o:	types.h
+fillem.o:	$(CDIR)param.h
+fillem.o:	$(CDIR)regvar.h
+fillem.o:	$(CDIR)result.h
+fillem.o:	$(CDIR)tables.h
+fillem.o:	$(CDIR)types.h
+gencode.o:	$(CDIR)assert.h
+gencode.o:	$(CDIR)data.h
+gencode.o:	$(CDIR)extern.h
+gencode.o:	$(CDIR)param.h
+gencode.o:	$(CDIR)result.h
+gencode.o:	$(CDIR)tables.h
+gencode.o:	$(CDIR)types.h
+glosym.o:	$(CDIR)glosym.h
+glosym.o:	$(CDIR)param.h
+glosym.o:	$(CDIR)tables.h
+glosym.o:	$(CDIR)types.h
+main.o:	$(CDIR)param.h
+move.o:	$(CDIR)assert.h
+move.o:	$(CDIR)data.h
+move.o:	$(CDIR)extern.h
+move.o:	$(CDIR)param.h
+move.o:	$(CDIR)result.h
+move.o:	$(CDIR)tables.h
+move.o:	$(CDIR)types.h
+nextem.o:	$(CDIR)assert.h
+nextem.o:	$(CDIR)data.h
+nextem.o:	$(CDIR)extern.h
+nextem.o:	$(CDIR)param.h
+nextem.o:	$(CDIR)result.h
+nextem.o:	$(CDIR)tables.h
+nextem.o:	$(CDIR)types.h
+reg.o:	$(CDIR)assert.h
+reg.o:	$(CDIR)data.h
+reg.o:	$(CDIR)extern.h
+reg.o:	$(CDIR)param.h
+reg.o:	$(CDIR)result.h
+reg.o:	$(CDIR)tables.h
+reg.o:	$(CDIR)types.h
+regvar.o:	$(CDIR)assert.h
+regvar.o:	$(CDIR)data.h
+regvar.o:	$(CDIR)extern.h
+regvar.o:	$(CDIR)param.h
+regvar.o:	$(CDIR)regvar.h
+regvar.o:	$(CDIR)result.h
+regvar.o:	$(CDIR)tables.h
+regvar.o:	$(CDIR)types.h
+salloc.o:	$(CDIR)assert.h
+salloc.o:	$(CDIR)data.h
+salloc.o:	$(CDIR)extern.h
+salloc.o:	$(CDIR)param.h
+salloc.o:	$(CDIR)result.h
+salloc.o:	$(CDIR)tables.h
+salloc.o:	$(CDIR)types.h
+state.o:	$(CDIR)assert.h
+state.o:	$(CDIR)data.h
+state.o:	$(CDIR)extern.h
+state.o:	$(CDIR)param.h
+state.o:	$(CDIR)result.h
+state.o:	$(CDIR)state.h
+state.o:	$(CDIR)tables.h
+state.o:	$(CDIR)types.h
+subr.o:	$(CDIR)assert.h
+subr.o:	$(CDIR)data.h
+subr.o:	$(CDIR)extern.h
+subr.o:	$(CDIR)param.h
+subr.o:	$(CDIR)result.h
+subr.o:	$(CDIR)tables.h
+subr.o:	$(CDIR)types.h
+var.o:	$(CDIR)data.h
+var.o:	$(CDIR)param.h
+var.o:	$(CDIR)result.h
+var.o:	$(CDIR)tables.h
+var.o:	$(CDIR)types.h

+ 118 - 113
mach/z8000/cg/Makefile

@@ -1,31 +1,39 @@
+# $Header$
+
 PREFLAGS=-I../../../h -DNDEBUG
 PFLAGS=
 CFLAGS=$(PREFLAGS) $(PFLAGS) -O
 LDFLAGS=-i $(PFLAGS)
 LINTOPTS=-hbxac
 LIBS=../../../lib/em_data.a
-CFILES=codegen.c compute.c equiv.c fillem.c gencode.c glosym.c main.c\
-       move.c nextem.c reg.c regvar.c salloc.c state.c subr.c var.c
+CDIR=../../proto/cg
+CFILES=$(CDIR)/codegen.c $(CDIR)/compute.c $(CDIR)/equiv.c $(CDIR)/fillem.c \
+       $(CDIR)/gencode.c $(CDIR)/glosym.c $(CDIR)/main.c $(CDIR)/move.c \
+       $(CDIR)/nextem.c $(CDIR)/reg.c $(CDIR)/regvar.c $(CDIR)/salloc.c \
+       $(CDIR)/state.c $(CDIR)/subr.c $(CDIR)/var.c
 OFILES=codegen.o compute.o equiv.o fillem.o gencode.o glosym.o main.o\
        move.o nextem.o reg.o regvar.o salloc.o state.o subr.o var.o
 
+all:
+	make tables.c
+	make cg
+
 cg: tables.o $(OFILES)
 	cc $(LDFLAGS) $(OFILES) tables.o $(LIBS) -o cg
-	touch tables.h tables.c tables.o $(OFILES) cg
 
 tables.o: tables.c
 	cc -c $(PREFLAGS) tables.c
 
-install: cg
-	cp cg ../../../lib/pdp_cg
+install: all
+	../install cg
 
-cmp:	 cg
+cmp:	 all
 	-../compare cg
 
 
-tables.h tables.c: pdptable
+tables.c: table
 	-mv tables.h tables.h.save
-	../../../lib/cpp -P pdptable | ../../../lib/cgg > debug.out
+	../../../lib/cpp -P table | ../../../lib/cgg > debug.out
 	-if cmp -s tables.h.save tables.h; then mv tables.h.save tables.h; else exit 0; fi
 	-if cmp -s /dev/null tables.h; then mv tables.h.save tables.h; else exit 0; fi
 
@@ -33,110 +41,107 @@ lint: $(CFILES)
 	lint $(LINTOPTS) $(PREFLAGS) $(CFILES)
 clean:
 	rm -f *.o tables.c
-depend:
-	makedepend `grep -v '\.h' sources`
-# the next lines are generated automatically
-# AUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTO
-codegen.o:	assert.h
-codegen.o:	data.h
-codegen.o:	equiv.h
-codegen.o:	extern.h
-codegen.o:	param.h
-codegen.o:	result.h
-codegen.o:	state.h
-codegen.o:	tables.h
-codegen.o:	types.h
-compute.o:	assert.h
-compute.o:	data.h
-compute.o:	extern.h
-compute.o:	glosym.h
-compute.o:	param.h
-compute.o:	result.h
-compute.o:	tables.h
-compute.o:	types.h
-equiv.o:	assert.h
-equiv.o:	data.h
-equiv.o:	equiv.h
-equiv.o:	extern.h
-equiv.o:	param.h
-equiv.o:	result.h
-equiv.o:	tables.h
-equiv.o:	types.h
-fillem.o:	assert.h
-fillem.o:	data.h
-fillem.o:	extern.h
+
+codegen.o:	$(CDIR)assert.h
+codegen.o:	$(CDIR)data.h
+codegen.o:	$(CDIR)equiv.h
+codegen.o:	$(CDIR)extern.h
+codegen.o:	$(CDIR)param.h
+codegen.o:	$(CDIR)result.h
+codegen.o:	$(CDIR)state.h
+codegen.o:	$(CDIR)tables.h
+codegen.o:	$(CDIR)types.h
+compute.o:	$(CDIR)assert.h
+compute.o:	$(CDIR)data.h
+compute.o:	$(CDIR)extern.h
+compute.o:	$(CDIR)glosym.h
+compute.o:	$(CDIR)param.h
+compute.o:	$(CDIR)result.h
+compute.o:	$(CDIR)tables.h
+compute.o:	$(CDIR)types.h
+equiv.o:	$(CDIR)assert.h
+equiv.o:	$(CDIR)data.h
+equiv.o:	$(CDIR)equiv.h
+equiv.o:	$(CDIR)extern.h
+equiv.o:	$(CDIR)param.h
+equiv.o:	$(CDIR)result.h
+equiv.o:	$(CDIR)tables.h
+equiv.o:	$(CDIR)types.h
+fillem.o:	$(CDIR)assert.h
+fillem.o:	$(CDIR)data.h
+fillem.o:	$(CDIR)extern.h
 fillem.o:	mach.c
 fillem.o:	mach.h
-fillem.o:	param.h
-fillem.o:	regvar.h
-fillem.o:	result.h
-fillem.o:	tables.h
-fillem.o:	types.h
-gencode.o:	assert.h
-gencode.o:	data.h
-gencode.o:	extern.h
-gencode.o:	param.h
-gencode.o:	result.h
-gencode.o:	tables.h
-gencode.o:	types.h
-glosym.o:	glosym.h
-glosym.o:	param.h
-glosym.o:	tables.h
-glosym.o:	types.h
-main.o:	param.h
-move.o:	assert.h
-move.o:	data.h
-move.o:	extern.h
-move.o:	param.h
-move.o:	result.h
-move.o:	tables.h
-move.o:	types.h
-nextem.o:	assert.h
-nextem.o:	data.h
-nextem.o:	extern.h
-nextem.o:	param.h
-nextem.o:	result.h
-nextem.o:	tables.h
-nextem.o:	types.h
-reg.o:	assert.h
-reg.o:	data.h
-reg.o:	extern.h
-reg.o:	param.h
-reg.o:	result.h
-reg.o:	tables.h
-reg.o:	types.h
-regvar.o:	assert.h
-regvar.o:	data.h
-regvar.o:	extern.h
-regvar.o:	param.h
-regvar.o:	regvar.h
-regvar.o:	result.h
-regvar.o:	tables.h
-regvar.o:	types.h
-salloc.o:	assert.h
-salloc.o:	data.h
-salloc.o:	extern.h
-salloc.o:	param.h
-salloc.o:	result.h
-salloc.o:	tables.h
-salloc.o:	types.h
-state.o:	assert.h
-state.o:	data.h
-state.o:	extern.h
-state.o:	param.h
-state.o:	result.h
-state.o:	state.h
-state.o:	tables.h
-state.o:	types.h
-subr.o:	assert.h
-subr.o:	data.h
-subr.o:	extern.h
-subr.o:	param.h
-subr.o:	result.h
-subr.o:	tables.h
-subr.o:	types.h
-var.o:	data.h
-var.o:	param.h
-var.o:	result.h
-var.o:	tables.h
-var.o:	types.h
+fillem.o:	$(CDIR)param.h
+fillem.o:	$(CDIR)regvar.h
+fillem.o:	$(CDIR)result.h
+fillem.o:	$(CDIR)tables.h
+fillem.o:	$(CDIR)types.h
+gencode.o:	$(CDIR)assert.h
+gencode.o:	$(CDIR)data.h
+gencode.o:	$(CDIR)extern.h
+gencode.o:	$(CDIR)param.h
+gencode.o:	$(CDIR)result.h
+gencode.o:	$(CDIR)tables.h
+gencode.o:	$(CDIR)types.h
+glosym.o:	$(CDIR)glosym.h
+glosym.o:	$(CDIR)param.h
+glosym.o:	$(CDIR)tables.h
+glosym.o:	$(CDIR)types.h
+main.o:	$(CDIR)param.h
+move.o:	$(CDIR)assert.h
+move.o:	$(CDIR)data.h
+move.o:	$(CDIR)extern.h
+move.o:	$(CDIR)param.h
+move.o:	$(CDIR)result.h
+move.o:	$(CDIR)tables.h
+move.o:	$(CDIR)types.h
+nextem.o:	$(CDIR)assert.h
+nextem.o:	$(CDIR)data.h
+nextem.o:	$(CDIR)extern.h
+nextem.o:	$(CDIR)param.h
+nextem.o:	$(CDIR)result.h
+nextem.o:	$(CDIR)tables.h
+nextem.o:	$(CDIR)types.h
+reg.o:	$(CDIR)assert.h
+reg.o:	$(CDIR)data.h
+reg.o:	$(CDIR)extern.h
+reg.o:	$(CDIR)param.h
+reg.o:	$(CDIR)result.h
+reg.o:	$(CDIR)tables.h
+reg.o:	$(CDIR)types.h
+regvar.o:	$(CDIR)assert.h
+regvar.o:	$(CDIR)data.h
+regvar.o:	$(CDIR)extern.h
+regvar.o:	$(CDIR)param.h
+regvar.o:	$(CDIR)regvar.h
+regvar.o:	$(CDIR)result.h
+regvar.o:	$(CDIR)tables.h
+regvar.o:	$(CDIR)types.h
+salloc.o:	$(CDIR)assert.h
+salloc.o:	$(CDIR)data.h
+salloc.o:	$(CDIR)extern.h
+salloc.o:	$(CDIR)param.h
+salloc.o:	$(CDIR)result.h
+salloc.o:	$(CDIR)tables.h
+salloc.o:	$(CDIR)types.h
+state.o:	$(CDIR)assert.h
+state.o:	$(CDIR)data.h
+state.o:	$(CDIR)extern.h
+state.o:	$(CDIR)param.h
+state.o:	$(CDIR)result.h
+state.o:	$(CDIR)state.h
+state.o:	$(CDIR)tables.h
+state.o:	$(CDIR)types.h
+subr.o:	$(CDIR)assert.h
+subr.o:	$(CDIR)data.h
+subr.o:	$(CDIR)extern.h
+subr.o:	$(CDIR)param.h
+subr.o:	$(CDIR)result.h
+subr.o:	$(CDIR)tables.h
+subr.o:	$(CDIR)types.h
+var.o:	$(CDIR)data.h
+var.o:	$(CDIR)param.h
+var.o:	$(CDIR)result.h
+var.o:	$(CDIR)tables.h
+var.o:	$(CDIR)types.h