浏览代码

Reworked to work, I think

sater 40 年之前
父节点
当前提交
7d75cf2799
共有 6 个文件被更改,包括 810 次插入624 次删除
  1. 135 104
      mach/6500/cg/Makefile
  2. 135 104
      mach/pdp/cg/Makefile
  3. 135 104
      mach/proto/cg/Makefile
  4. 135 104
      mach/vax4/cg/Makefile
  5. 135 104
      mach/z80/cg/Makefile
  6. 135 104
      mach/z8000/cg/Makefile

+ 135 - 104
mach/6500/cg/Makefile

@@ -1,6 +1,6 @@
 # $Header$
 
-PREFLAGS=-I../../../h -DNDEBUG
+PREFLAGS=-I../../../h -I. -DNDEBUG
 PFLAGS=
 CFLAGS=$(PREFLAGS) $(PFLAGS) -O
 LDFLAGS=-i $(PFLAGS)
@@ -22,7 +22,38 @@ cg: tables.o $(OFILES)
 	cc $(LDFLAGS) $(OFILES) tables.o $(LIBS) -o cg
 
 tables.o: tables.c
-	cc -c $(PREFLAGS) tables.c
+	cc -c $(PREFLAGS) -I$(CDIR) tables.c
+
+codegen.o: $(CDIR)/codegen.c
+	cc -c $(CFLAGS) $(CDIR)/codegen.c
+compute.o: $(CDIR)/compute.c
+	cc -c $(CFLAGS) $(CDIR)/compute.c
+equiv.o: $(CDIR)/equiv.c
+	cc -c $(CFLAGS) $(CDIR)/equiv.c
+fillem.o: $(CDIR)/fillem.c
+	cc -c $(CFLAGS) $(CDIR)/fillem.c
+gencode.o: $(CDIR)/gencode.c
+	cc -c $(CFLAGS) $(CDIR)/gencode.c
+glosym.o: $(CDIR)/glosym.c
+	cc -c $(CFLAGS) $(CDIR)/glosym.c
+main.o: $(CDIR)/main.c
+	cc -c $(CFLAGS) $(CDIR)/main.c
+move.o: $(CDIR)/move.c
+	cc -c $(CFLAGS) $(CDIR)/move.c
+nextem.o: $(CDIR)/nextem.c
+	cc -c $(CFLAGS) $(CDIR)/nextem.c
+reg.o: $(CDIR)/reg.c
+	cc -c $(CFLAGS) $(CDIR)/reg.c
+regvar.o: $(CDIR)/regvar.c
+	cc -c $(CFLAGS) $(CDIR)/regvar.c
+salloc.o: $(CDIR)/salloc.c
+	cc -c $(CFLAGS) $(CDIR)/salloc.c
+state.o: $(CDIR)/state.c
+	cc -c $(CFLAGS) $(CDIR)/state.c
+subr.o: $(CDIR)/subr.c
+	cc -c $(CFLAGS) $(CDIR)/subr.c
+var.o: $(CDIR)/var.c
+	cc -c $(CFLAGS) $(CDIR)/var.c
 
 install: all
 	../install cg
@@ -40,108 +71,108 @@ tables.c: table
 lint: $(CFILES)
 	lint $(LINTOPTS) $(PREFLAGS) $(CFILES)
 clean:
-	rm -f *.o tables.c
+	rm -f *.o tables.c tables.h debug.out cg tables.h.save
 
-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
+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:	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:	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:	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:	$(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
+fillem.o:	$(CDIR)/param.h
+fillem.o:	$(CDIR)/regvar.h
+fillem.o:	$(CDIR)/result.h
+fillem.o:	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:	tables.h
+gencode.o:	$(CDIR)/types.h
+glosym.o:	$(CDIR)/glosym.h
+glosym.o:	$(CDIR)/param.h
+glosym.o:	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:		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:	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:		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:	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:	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:	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:		tables.h
+subr.o:		$(CDIR)/types.h
+var.o:		$(CDIR)/data.h
+var.o:		$(CDIR)/param.h
+var.o:		$(CDIR)/result.h
+var.o:		tables.h
+var.o:		$(CDIR)/types.h

+ 135 - 104
mach/pdp/cg/Makefile

@@ -1,6 +1,6 @@
 # $Header$
 
-PREFLAGS=-I../../../h -DNDEBUG
+PREFLAGS=-I../../../h -I. -DNDEBUG
 PFLAGS=
 CFLAGS=$(PREFLAGS) $(PFLAGS) -O
 LDFLAGS=-i $(PFLAGS)
@@ -22,7 +22,38 @@ cg: tables.o $(OFILES)
 	cc $(LDFLAGS) $(OFILES) tables.o $(LIBS) -o cg
 
 tables.o: tables.c
-	cc -c $(PREFLAGS) tables.c
+	cc -c $(PREFLAGS) -I$(CDIR) tables.c
+
+codegen.o: $(CDIR)/codegen.c
+	cc -c $(CFLAGS) $(CDIR)/codegen.c
+compute.o: $(CDIR)/compute.c
+	cc -c $(CFLAGS) $(CDIR)/compute.c
+equiv.o: $(CDIR)/equiv.c
+	cc -c $(CFLAGS) $(CDIR)/equiv.c
+fillem.o: $(CDIR)/fillem.c
+	cc -c $(CFLAGS) $(CDIR)/fillem.c
+gencode.o: $(CDIR)/gencode.c
+	cc -c $(CFLAGS) $(CDIR)/gencode.c
+glosym.o: $(CDIR)/glosym.c
+	cc -c $(CFLAGS) $(CDIR)/glosym.c
+main.o: $(CDIR)/main.c
+	cc -c $(CFLAGS) $(CDIR)/main.c
+move.o: $(CDIR)/move.c
+	cc -c $(CFLAGS) $(CDIR)/move.c
+nextem.o: $(CDIR)/nextem.c
+	cc -c $(CFLAGS) $(CDIR)/nextem.c
+reg.o: $(CDIR)/reg.c
+	cc -c $(CFLAGS) $(CDIR)/reg.c
+regvar.o: $(CDIR)/regvar.c
+	cc -c $(CFLAGS) $(CDIR)/regvar.c
+salloc.o: $(CDIR)/salloc.c
+	cc -c $(CFLAGS) $(CDIR)/salloc.c
+state.o: $(CDIR)/state.c
+	cc -c $(CFLAGS) $(CDIR)/state.c
+subr.o: $(CDIR)/subr.c
+	cc -c $(CFLAGS) $(CDIR)/subr.c
+var.o: $(CDIR)/var.c
+	cc -c $(CFLAGS) $(CDIR)/var.c
 
 install: all
 	../install cg
@@ -40,108 +71,108 @@ tables.c: table
 lint: $(CFILES)
 	lint $(LINTOPTS) $(PREFLAGS) $(CFILES)
 clean:
-	rm -f *.o tables.c
+	rm -f *.o tables.c tables.h debug.out cg tables.h.save
 
-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
+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:	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:	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:	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:	$(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
+fillem.o:	$(CDIR)/param.h
+fillem.o:	$(CDIR)/regvar.h
+fillem.o:	$(CDIR)/result.h
+fillem.o:	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:	tables.h
+gencode.o:	$(CDIR)/types.h
+glosym.o:	$(CDIR)/glosym.h
+glosym.o:	$(CDIR)/param.h
+glosym.o:	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:		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:	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:		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:	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:	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:	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:		tables.h
+subr.o:		$(CDIR)/types.h
+var.o:		$(CDIR)/data.h
+var.o:		$(CDIR)/param.h
+var.o:		$(CDIR)/result.h
+var.o:		tables.h
+var.o:		$(CDIR)/types.h

+ 135 - 104
mach/proto/cg/Makefile

@@ -1,6 +1,6 @@
 # $Header$
 
-PREFLAGS=-I../../../h -DNDEBUG
+PREFLAGS=-I../../../h -I. -DNDEBUG
 PFLAGS=
 CFLAGS=$(PREFLAGS) $(PFLAGS) -O
 LDFLAGS=-i $(PFLAGS)
@@ -22,7 +22,38 @@ cg: tables.o $(OFILES)
 	cc $(LDFLAGS) $(OFILES) tables.o $(LIBS) -o cg
 
 tables.o: tables.c
-	cc -c $(PREFLAGS) tables.c
+	cc -c $(PREFLAGS) -I$(CDIR) tables.c
+
+codegen.o: $(CDIR)/codegen.c
+	cc -c $(CFLAGS) $(CDIR)/codegen.c
+compute.o: $(CDIR)/compute.c
+	cc -c $(CFLAGS) $(CDIR)/compute.c
+equiv.o: $(CDIR)/equiv.c
+	cc -c $(CFLAGS) $(CDIR)/equiv.c
+fillem.o: $(CDIR)/fillem.c
+	cc -c $(CFLAGS) $(CDIR)/fillem.c
+gencode.o: $(CDIR)/gencode.c
+	cc -c $(CFLAGS) $(CDIR)/gencode.c
+glosym.o: $(CDIR)/glosym.c
+	cc -c $(CFLAGS) $(CDIR)/glosym.c
+main.o: $(CDIR)/main.c
+	cc -c $(CFLAGS) $(CDIR)/main.c
+move.o: $(CDIR)/move.c
+	cc -c $(CFLAGS) $(CDIR)/move.c
+nextem.o: $(CDIR)/nextem.c
+	cc -c $(CFLAGS) $(CDIR)/nextem.c
+reg.o: $(CDIR)/reg.c
+	cc -c $(CFLAGS) $(CDIR)/reg.c
+regvar.o: $(CDIR)/regvar.c
+	cc -c $(CFLAGS) $(CDIR)/regvar.c
+salloc.o: $(CDIR)/salloc.c
+	cc -c $(CFLAGS) $(CDIR)/salloc.c
+state.o: $(CDIR)/state.c
+	cc -c $(CFLAGS) $(CDIR)/state.c
+subr.o: $(CDIR)/subr.c
+	cc -c $(CFLAGS) $(CDIR)/subr.c
+var.o: $(CDIR)/var.c
+	cc -c $(CFLAGS) $(CDIR)/var.c
 
 install: all
 	../install cg
@@ -40,108 +71,108 @@ tables.c: table
 lint: $(CFILES)
 	lint $(LINTOPTS) $(PREFLAGS) $(CFILES)
 clean:
-	rm -f *.o tables.c
+	rm -f *.o tables.c tables.h debug.out cg tables.h.save
 
-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
+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:	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:	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:	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:	$(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
+fillem.o:	$(CDIR)/param.h
+fillem.o:	$(CDIR)/regvar.h
+fillem.o:	$(CDIR)/result.h
+fillem.o:	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:	tables.h
+gencode.o:	$(CDIR)/types.h
+glosym.o:	$(CDIR)/glosym.h
+glosym.o:	$(CDIR)/param.h
+glosym.o:	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:		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:	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:		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:	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:	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:	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:		tables.h
+subr.o:		$(CDIR)/types.h
+var.o:		$(CDIR)/data.h
+var.o:		$(CDIR)/param.h
+var.o:		$(CDIR)/result.h
+var.o:		tables.h
+var.o:		$(CDIR)/types.h

+ 135 - 104
mach/vax4/cg/Makefile

@@ -1,6 +1,6 @@
 # $Header$
 
-PREFLAGS=-I../../../h -DNDEBUG
+PREFLAGS=-I../../../h -I. -DNDEBUG
 PFLAGS=
 CFLAGS=$(PREFLAGS) $(PFLAGS) -O
 LDFLAGS=-i $(PFLAGS)
@@ -22,7 +22,38 @@ cg: tables.o $(OFILES)
 	cc $(LDFLAGS) $(OFILES) tables.o $(LIBS) -o cg
 
 tables.o: tables.c
-	cc -c $(PREFLAGS) tables.c
+	cc -c $(PREFLAGS) -I$(CDIR) tables.c
+
+codegen.o: $(CDIR)/codegen.c
+	cc -c $(CFLAGS) $(CDIR)/codegen.c
+compute.o: $(CDIR)/compute.c
+	cc -c $(CFLAGS) $(CDIR)/compute.c
+equiv.o: $(CDIR)/equiv.c
+	cc -c $(CFLAGS) $(CDIR)/equiv.c
+fillem.o: $(CDIR)/fillem.c
+	cc -c $(CFLAGS) $(CDIR)/fillem.c
+gencode.o: $(CDIR)/gencode.c
+	cc -c $(CFLAGS) $(CDIR)/gencode.c
+glosym.o: $(CDIR)/glosym.c
+	cc -c $(CFLAGS) $(CDIR)/glosym.c
+main.o: $(CDIR)/main.c
+	cc -c $(CFLAGS) $(CDIR)/main.c
+move.o: $(CDIR)/move.c
+	cc -c $(CFLAGS) $(CDIR)/move.c
+nextem.o: $(CDIR)/nextem.c
+	cc -c $(CFLAGS) $(CDIR)/nextem.c
+reg.o: $(CDIR)/reg.c
+	cc -c $(CFLAGS) $(CDIR)/reg.c
+regvar.o: $(CDIR)/regvar.c
+	cc -c $(CFLAGS) $(CDIR)/regvar.c
+salloc.o: $(CDIR)/salloc.c
+	cc -c $(CFLAGS) $(CDIR)/salloc.c
+state.o: $(CDIR)/state.c
+	cc -c $(CFLAGS) $(CDIR)/state.c
+subr.o: $(CDIR)/subr.c
+	cc -c $(CFLAGS) $(CDIR)/subr.c
+var.o: $(CDIR)/var.c
+	cc -c $(CFLAGS) $(CDIR)/var.c
 
 install: all
 	../install cg
@@ -40,108 +71,108 @@ tables.c: table
 lint: $(CFILES)
 	lint $(LINTOPTS) $(PREFLAGS) $(CFILES)
 clean:
-	rm -f *.o tables.c
+	rm -f *.o tables.c tables.h debug.out cg tables.h.save
 
-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
+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:	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:	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:	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:	$(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
+fillem.o:	$(CDIR)/param.h
+fillem.o:	$(CDIR)/regvar.h
+fillem.o:	$(CDIR)/result.h
+fillem.o:	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:	tables.h
+gencode.o:	$(CDIR)/types.h
+glosym.o:	$(CDIR)/glosym.h
+glosym.o:	$(CDIR)/param.h
+glosym.o:	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:		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:	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:		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:	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:	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:	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:		tables.h
+subr.o:		$(CDIR)/types.h
+var.o:		$(CDIR)/data.h
+var.o:		$(CDIR)/param.h
+var.o:		$(CDIR)/result.h
+var.o:		tables.h
+var.o:		$(CDIR)/types.h

+ 135 - 104
mach/z80/cg/Makefile

@@ -1,6 +1,6 @@
 # $Header$
 
-PREFLAGS=-I../../../h -DNDEBUG
+PREFLAGS=-I../../../h -I. -DNDEBUG
 PFLAGS=
 CFLAGS=$(PREFLAGS) $(PFLAGS) -O
 LDFLAGS=-i $(PFLAGS)
@@ -22,7 +22,38 @@ cg: tables.o $(OFILES)
 	cc $(LDFLAGS) $(OFILES) tables.o $(LIBS) -o cg
 
 tables.o: tables.c
-	cc -c $(PREFLAGS) tables.c
+	cc -c $(PREFLAGS) -I$(CDIR) tables.c
+
+codegen.o: $(CDIR)/codegen.c
+	cc -c $(CFLAGS) $(CDIR)/codegen.c
+compute.o: $(CDIR)/compute.c
+	cc -c $(CFLAGS) $(CDIR)/compute.c
+equiv.o: $(CDIR)/equiv.c
+	cc -c $(CFLAGS) $(CDIR)/equiv.c
+fillem.o: $(CDIR)/fillem.c
+	cc -c $(CFLAGS) $(CDIR)/fillem.c
+gencode.o: $(CDIR)/gencode.c
+	cc -c $(CFLAGS) $(CDIR)/gencode.c
+glosym.o: $(CDIR)/glosym.c
+	cc -c $(CFLAGS) $(CDIR)/glosym.c
+main.o: $(CDIR)/main.c
+	cc -c $(CFLAGS) $(CDIR)/main.c
+move.o: $(CDIR)/move.c
+	cc -c $(CFLAGS) $(CDIR)/move.c
+nextem.o: $(CDIR)/nextem.c
+	cc -c $(CFLAGS) $(CDIR)/nextem.c
+reg.o: $(CDIR)/reg.c
+	cc -c $(CFLAGS) $(CDIR)/reg.c
+regvar.o: $(CDIR)/regvar.c
+	cc -c $(CFLAGS) $(CDIR)/regvar.c
+salloc.o: $(CDIR)/salloc.c
+	cc -c $(CFLAGS) $(CDIR)/salloc.c
+state.o: $(CDIR)/state.c
+	cc -c $(CFLAGS) $(CDIR)/state.c
+subr.o: $(CDIR)/subr.c
+	cc -c $(CFLAGS) $(CDIR)/subr.c
+var.o: $(CDIR)/var.c
+	cc -c $(CFLAGS) $(CDIR)/var.c
 
 install: all
 	../install cg
@@ -40,108 +71,108 @@ tables.c: table
 lint: $(CFILES)
 	lint $(LINTOPTS) $(PREFLAGS) $(CFILES)
 clean:
-	rm -f *.o tables.c
+	rm -f *.o tables.c tables.h debug.out cg tables.h.save
 
-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
+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:	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:	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:	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:	$(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
+fillem.o:	$(CDIR)/param.h
+fillem.o:	$(CDIR)/regvar.h
+fillem.o:	$(CDIR)/result.h
+fillem.o:	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:	tables.h
+gencode.o:	$(CDIR)/types.h
+glosym.o:	$(CDIR)/glosym.h
+glosym.o:	$(CDIR)/param.h
+glosym.o:	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:		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:	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:		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:	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:	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:	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:		tables.h
+subr.o:		$(CDIR)/types.h
+var.o:		$(CDIR)/data.h
+var.o:		$(CDIR)/param.h
+var.o:		$(CDIR)/result.h
+var.o:		tables.h
+var.o:		$(CDIR)/types.h

+ 135 - 104
mach/z8000/cg/Makefile

@@ -1,6 +1,6 @@
 # $Header$
 
-PREFLAGS=-I../../../h -DNDEBUG
+PREFLAGS=-I../../../h -I. -DNDEBUG
 PFLAGS=
 CFLAGS=$(PREFLAGS) $(PFLAGS) -O
 LDFLAGS=-i $(PFLAGS)
@@ -22,7 +22,38 @@ cg: tables.o $(OFILES)
 	cc $(LDFLAGS) $(OFILES) tables.o $(LIBS) -o cg
 
 tables.o: tables.c
-	cc -c $(PREFLAGS) tables.c
+	cc -c $(PREFLAGS) -I$(CDIR) tables.c
+
+codegen.o: $(CDIR)/codegen.c
+	cc -c $(CFLAGS) $(CDIR)/codegen.c
+compute.o: $(CDIR)/compute.c
+	cc -c $(CFLAGS) $(CDIR)/compute.c
+equiv.o: $(CDIR)/equiv.c
+	cc -c $(CFLAGS) $(CDIR)/equiv.c
+fillem.o: $(CDIR)/fillem.c
+	cc -c $(CFLAGS) $(CDIR)/fillem.c
+gencode.o: $(CDIR)/gencode.c
+	cc -c $(CFLAGS) $(CDIR)/gencode.c
+glosym.o: $(CDIR)/glosym.c
+	cc -c $(CFLAGS) $(CDIR)/glosym.c
+main.o: $(CDIR)/main.c
+	cc -c $(CFLAGS) $(CDIR)/main.c
+move.o: $(CDIR)/move.c
+	cc -c $(CFLAGS) $(CDIR)/move.c
+nextem.o: $(CDIR)/nextem.c
+	cc -c $(CFLAGS) $(CDIR)/nextem.c
+reg.o: $(CDIR)/reg.c
+	cc -c $(CFLAGS) $(CDIR)/reg.c
+regvar.o: $(CDIR)/regvar.c
+	cc -c $(CFLAGS) $(CDIR)/regvar.c
+salloc.o: $(CDIR)/salloc.c
+	cc -c $(CFLAGS) $(CDIR)/salloc.c
+state.o: $(CDIR)/state.c
+	cc -c $(CFLAGS) $(CDIR)/state.c
+subr.o: $(CDIR)/subr.c
+	cc -c $(CFLAGS) $(CDIR)/subr.c
+var.o: $(CDIR)/var.c
+	cc -c $(CFLAGS) $(CDIR)/var.c
 
 install: all
 	../install cg
@@ -40,108 +71,108 @@ tables.c: table
 lint: $(CFILES)
 	lint $(LINTOPTS) $(PREFLAGS) $(CFILES)
 clean:
-	rm -f *.o tables.c
+	rm -f *.o tables.c tables.h debug.out cg tables.h.save
 
-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
+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:	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:	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:	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:	$(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
+fillem.o:	$(CDIR)/param.h
+fillem.o:	$(CDIR)/regvar.h
+fillem.o:	$(CDIR)/result.h
+fillem.o:	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:	tables.h
+gencode.o:	$(CDIR)/types.h
+glosym.o:	$(CDIR)/glosym.h
+glosym.o:	$(CDIR)/param.h
+glosym.o:	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:		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:	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:		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:	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:	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:	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:		tables.h
+subr.o:		$(CDIR)/types.h
+var.o:		$(CDIR)/data.h
+var.o:		$(CDIR)/param.h
+var.o:		$(CDIR)/result.h
+var.o:		tables.h
+var.o:		$(CDIR)/types.h