From 7e6fe164486b389bbd34b63c5f9294dea5317a1a Mon Sep 17 00:00:00 2001 From: ceriel Date: Thu, 18 Aug 1988 11:00:02 +0000 Subject: [PATCH] Somewhat adapted for ACK --- util/ceg/util/.distr | 2 +- util/ceg/util/Makefile | 23 ++++++++++++ util/ceg/util/install_ceg | 2 +- util/ceg/util/make_as | 59 +++++++++++++++++-------------- util/ceg/util/make_obj | 73 ++++++++++++++++++++++----------------- util/ceg/util/make_own | 53 ++++++++++++++++------------ util/ceg/util/preproc | 2 +- util/ceg/util/update | 4 +-- 8 files changed, 134 insertions(+), 84 deletions(-) create mode 100644 util/ceg/util/Makefile diff --git a/util/ceg/util/.distr b/util/ceg/util/.distr index b1beb60e6..ce5c0a001 100644 --- a/util/ceg/util/.distr +++ b/util/ceg/util/.distr @@ -3,5 +3,5 @@ install_ceg make_as make_obj make_own -preproc update +Makefile diff --git a/util/ceg/util/Makefile b/util/ceg/util/Makefile new file mode 100644 index 000000000..a89a07619 --- /dev/null +++ b/util/ceg/util/Makefile @@ -0,0 +1,23 @@ +EM = ../../.. +CEGLIB = $(EM)/lib/ceg +UTIL = $(CEGLIB)/util +UtilList = create_ofiles make_as make_obj make_own update + +all: + +install: + -mkdir $(CEGLIB) + -mkdir $(UTIL) + cp $(UtilList) $(UTIL) + cp install_ceg $(EM)/bin + +cmp: + for i in $(UtilList) ; do cmp $$i $(UTIL)/$$i ; done + +clean: + +pr: + @pr $(UtilList) + +opr: + make pr | opr diff --git a/util/ceg/util/install_ceg b/util/ceg/util/install_ceg index cdb49aa43..ae255bd72 100644 --- a/util/ceg/util/install_ceg +++ b/util/ceg/util/install_ceg @@ -1,4 +1,4 @@ -CEG=/usr/star/kaashoek/em/ceg/util +CEG=../../../lib/ceg/util case $# in 1) case $1 in diff --git a/util/ceg/util/make_as b/util/ceg/util/make_as index 3871699eb..2f590d565 100644 --- a/util/ceg/util/make_as +++ b/util/ceg/util/make_as @@ -1,5 +1,5 @@ -EM = /proj/em/Work -CEG = /usr/star/kaashoek/em/ceg +EM = ../../../.. +CEG = $(EM)/lib/ceg Em = $(CEG)/EM_parser/as_EM_pars ASMAIN = $(CEG)/assemble/as_assemble @@ -9,6 +9,9 @@ EVAL = $(CEG)/as_parser/eval DEF = $(CEG)/defaults CC = cc +CFLAGS = -O +AR = ar +LEXLIB = -ll IFILES = -I. -I.. -I$(AS) -I$(Em) -I$(EM)/h -I$(EM)/modules/h -I../back @@ -17,55 +20,61 @@ CEG_LIBS = $(EM)/modules/lib/liballoc.a\ $(EM)/modules/lib/libstring.a\ $(EM)/modules/lib/libsystem.a -.c.o : mach.h back/*h ; ( cd ce; $(CC) -c -O $(IFILES) ../$*.c) +.c.o : mach.h back/*h + ( cd ce; $(CC) -c $(CFLAGS) $(IFILES) ../$*.c) +all: back ceg ce + make -f ce_makefile ce.a -install : back ceg ce - make ce.a +clean: + rm -rf ce back ceg *.a Out + +dclean: + rm -rf ce back ceg Out ce : ceg/ceg mkdir ce ( cd ce; ../ceg/ceg -l < $(DEF)/not_impl/not_impl_table) - (cd ce; co $(DEF)/RCS/*.c,v) - (cd ce; co $(DEF)/*/RCS/*.c,v) - (cd ce; chmod +w *.c) + (cd ce; cp $(DEF)/*.c .) + (cd ce; cp $(DEF)/*/*.c .) ln mach.c ce/mach.c - @make EM_instr + @make -f ce_makefile EM_instr ceg : mkdir ceg - (cd ceg; co $(ASMAIN)/RCS/*,v) - (cd ceg;$(CC) -c $(IFILES) *.c; ar r as_lib.a *.o; ranlib as_lib.a) + (cd ceg; cp $(ASMAIN)/* .) + (cd ceg;$(CC) -c $(IFILES) *.c; $(AR) r as_lib.a *.o ) + -(cd ceg; ranlib as_lib.a) back : mkdir back - (cd back;co $(BACK)/as_back/RCS/*h,v ) - (cd back;co $(BACK)/as_back/RCS/Makefile,v ) + (cd back;cp $(BACK)/as_back/*h . ) + (cd back;cp $(BACK)/as_back/Makefile .) ( cd back; make) - ar r back.a back/*o; - ranlib back.a + $(AR) r back.a back/*o + -ranlib back.a ce.a : ce/*.o - ar r ce.a ce/*.o - ranlib ce.a + $(AR) r ce.a ce/*.o + -ranlib ce.a ce/*.o : mach.h back/*.h - (cd ce;$(CC) -c -O $(IFILES) *.c) + (cd ce;$(CC) -c $(CFLAGS) $(IFILES) *.c) EM_instr : ceg/ceg mach.h back/*.h EM_table - ( cd ce; $(CEG)/util/preproc ../EM_table | ../ceg/ceg -l) + ( cd ce; $(EM)/lib/cpp -P ../EM_table | ../ceg/ceg -l) ( cd ce; $(CEG)/util/create_ofiles) - @make ce.a + @make -f ce_makefile ce.a -ceg/ceg : $(Em)/em_parser ceg/as_lib.a ceg/eval_as.o - $(CC) -o ceg/ceg $(Em)/*.o ceg/eval_as.o ceg/as_lib.a $(CEG_LIBS) -ll +ceg/ceg : ceg/as_lib.a ceg/eval_as.o # $(Em)/em_parser + (cd ceg; $(CC) -o ceg $(Em)/*.o eval_as.o as_lib.a $(CEG_LIBS) $(LEXLIB) ) -ceg/eval_as.o : ceg/eval_as.c as.h $(AS)/as_parser.h $(Em)/arg_type.h +ceg/eval_as.o : ceg/eval_as.c as.h # $(AS)/as_parser.h $(Em)/arg_type.h (cd ceg;$(CC) -c $(IFILES) eval_as.c) -ceg/eval_as.c : as.c $(EVAL)/eval - $(EVAL)/eval < as.c > ceg/eval_as.c +ceg/eval_as.c : as.c # $(EVAL)/eval + (cd ceg ; $(EVAL)/eval < ../as.c > eval_as.c ) diff --git a/util/ceg/util/make_obj b/util/ceg/util/make_obj index 1128fc046..53c5e36a5 100644 --- a/util/ceg/util/make_obj +++ b/util/ceg/util/make_obj @@ -1,14 +1,17 @@ -EM = /proj/em/Work -CEG = /usr/star/kaashoek/em/ceg +EM = ../../../.. +CEG = $(EM)/lib/ceg Em = $(CEG)/EM_parser/obj_EM_pars -AS = $(CEG)/as_parser ASMAIN = $(CEG)/assemble/obj_assemble -EVAL = $(CEG)/as_parser/eval BACK = $(CEG)/ce_back +AS = $(CEG)/as_parser +EVAL = $(CEG)/as_parser/eval DEF = $(CEG)/defaults +AR = ar CC = cc +CFLAGS = -O +LEXLIB = -ll IFILES = -I. -I.. -I$(AS) -I$(Em) -I$(EM)/h -I$(EM)/modules/h -I../back @@ -17,61 +20,69 @@ CEG_LIBS = $(EM)/modules/lib/liballoc.a\ $(EM)/modules/lib/libstring.a\ $(EM)/modules/lib/libsystem.a -.c.o : mach.h back/*h ; ( cd ce; $(CC) -c -O $(IFILES) ../$*.c) +.c.o : mach.h back/*h + ( cd ce; $(CC) -c $(CFLAGS) $(IFILES) ../$*.c) - -install : back ceg ce +all: back ceg ce + make -f ce_makefile ce.a + +clean: + rm -rf ce back ceg *.a Out + +dclean: + rm -rf ce back ceg Out ce : ceg/ceg mkdir ce ( cd ce; ../ceg/ceg -l < $(DEF)/not_impl/not_impl_table) - (cd ce;co $(DEF)/RCS/*.c,v ) - (cd ce;co $(DEF)/*/RCS/*.c,v) - (cd ce; chmod +w *.c) + (cd ce; cp $(DEF)/*.c .) + (cd ce; cp $(DEF)/*/*.c .) ln mach.c ce/mach.c - @make EM_instr + @make -f ce_makefile EM_instr ceg : mkdir ceg - (cd ceg;co $(ASMAIN)/RCS/*,v) - (cd ceg;$(CC) -c $(IFILES) *.c; ar r as_lib.a *.o; ranlib as_lib.a) + (cd ceg; cp $(ASMAIN)/* .) + (cd ceg;$(CC) -c $(IFILES) *.c; $(AR) r as_lib.a *.o ) + -(cd ceg; ranlib as_lib.a) back : mkdir back - (cd back; co $(BACK)/obj_back/RCS/*h,v $(BACK)/obj_back/RCS/Makefile,v) + (cd back;cp $(BACK)/obj_back/*h . ) + (cd back;cp $(BACK)/obj_back/Makefile .) ( cd back; make) - ar r back.a back/*o; - ranlib back.a + $(AR) r back.a back/*o; + -ranlib back.a ce.a : ce/*.o - ar r ce.a ce/*.o - ranlib ce.a + $(AR) r ce.a ce/*.o + -ranlib ce.a ce/*.o : mach.h back/*.h - (cd ce;$(CC) -c -O $(IFILES) *.c) + (cd ce;$(CC) -c $(CFLAGS) $(IFILES) *.c) EM_instr : ceg/ceg mach.h back/*.h EM_table - ( cd ce; $(CEG)/util/preproc ../EM_table| ../ceg/ceg -l) + ( cd ce; $(EM)/lib/cpp -P ../EM_table | ../ceg/ceg -l) ( cd ce; $(CEG)/util/create_ofiles) - @make ce.a + @make -f ce_makefile ce.a +ceg/ceg : ceg/as_lib.a ceg/as_instr.o ceg/eval_as.o # $(Em)/em_parser + (cd ceg; $(CC) -o ceg $(Em)/*.o as_instr.o eval_as.o as_lib.a $(CEG_LIBS) $(LEXLIB) ) + +ceg/eval_as.o : ceg/eval_as.c as.h # $(AS)/as_parser.h $(Em)/arg_type.h + (cd ceg;$(CC) -c $(IFILES) eval_as.c) + +ceg/eval_as.c : as.c # $(EVAL)/eval + (cd ceg; $(EVAL)/eval < ../as.c > eval_as.c ) -ceg/ceg : $(Em)/em_parser ceg/as_lib.a ceg/as_instr.o ceg/eval_as.o - $(CC) -o ceg/ceg $(Em)/*.o ceg/as_instr.o ceg/eval_as.o ceg/as_lib.a\ - $(CEG_LIBS) -ll ceg/as_instr.o : as.h ceg/*h ceg/as_instr.c (cd ceg;$(CC) -c $(IFILES) as_instr.c) -ceg/as_instr.c : as_table $(AS)/as_parser - $(CEG)/util/preproc as_table| $(AS)/as_parser > ceg/as_instr.c +ceg/as_instr.c : as_table # $(AS)/as_parser + (cd ceg; $(EM)/lib/cpp -P ../as_table| $(AS)/as_parser > as_instr.c) -ceg/eval_as.o : ceg/eval_as.c as.h $(AS)/as_parser.h $(Em)/arg_type.h - (cd ceg;$(CC) -c $(IFILES) eval_as.c) - -ceg/eval_as.c : as.c $(EVAL)/eval - $(EVAL)/eval < as.c > ceg/eval_as.c diff --git a/util/ceg/util/make_own b/util/ceg/util/make_own index 3f04f81b7..1998c47cc 100644 --- a/util/ceg/util/make_own +++ b/util/ceg/util/make_own @@ -1,5 +1,5 @@ -EM = /proj/em/Work -CEG = /usr/star/kaashoek/em/ceg +EM = ../../../.. +CEG = $(EM)/lib/ceg Em = $(CEG)/EM_parser AS = $(CEG)/as_parser @@ -7,6 +7,9 @@ EVAL = $(CEG)/as_parser/eval DEF = $(CEG)/defaults CC = cc +CFLAGS = -O +AR = ar +LEXLIB = -ll IFILES = -I. -I.. -I$(AS) -I$(Em) -I$(EM)/h -I$(EM)/modules/h @@ -15,20 +18,24 @@ CEG_LIBS = $(EM)/modules/lib/liballoc.a\ $(EM)/modules/lib/libstring.a\ $(EM)/modules/lib/libsystem.a -.c.o : mach.h back/*h ; ( cd ce; $(CC) -c -O $(IFILES) ../$*.c) +.c.o : mach.h back/*h ; ( cd ce; $(CC) -c $(CFLAGS) $(IFILES) ../$*.c) - -install : ceg ce - make ce.a +all: back ceg ce + make -f ce_makefile ce.a + +clean: + rm -rf ce back ceg *.a Out + +dclean: + rm -rf ce back ceg Out ce : ceg/ceg mkdir ce ( cd ce; ../ceg/ceg -l < $(DEF)/not_impl/not_impl_table) - (cd ce;co $(DEF)/RCS/*.c,v ) - (cd ce;co $(DEF)/*/RCS/*.c,v) - (cd ce;chmod +w *.c) + (cd ce;cp $(DEF)/*.c .) + (cd ce;cp $(DEF)/*/*.c .) ln mach.c ce/mach.c - @make EM_instr + @make -f ce_makefile EM_instr ceg : mkdir ceg @@ -36,23 +43,23 @@ ceg : ce.a : ce/*.o - ar r ce.a ce/*.o - ranlib ce.a + $(AR) r ce.a ce/*.o + -ranlib ce.a ce/*.o : mach.h - (cd ce;$(CC) -c -O $(IFILES) ../$*.c) + (cd ce;$(CC) -c $(CFLAGS) $(IFILES) ../$*.c) EM_instr : ceg/ceg EM_table mach.h - ( cd ce; $(CEG)/util/preproc ../EM_table| ../ceg/ceg -l) + ( cd ce; $(EM)/lib/cpp/p -P ../EM_table| ../ceg/ceg -l) ( cd ce; $(CEG)/util/create_ofiles) - @make ce.a + @make -f ce_makefile ce.a -ceg/ceg : $(Em)/em_parser ceg/assemble.o ceg/as_instr.o ceg/eval_as.o - $(CC) -o ceg/ceg $(Em)/*.o ceg/assemble.o ceg/as_instr.o ceg/eval_as.o\ - $(CEG_LIBS) -ll +ceg/ceg : ceg/assemble.o ceg/as_instr.o ceg/eval_as.o # $(Em)/em_parser + (cd ceg ; $(CC) -o ceg $(Em)/*.o assemble.o as_instr.o eval_as.o\ + $(CEG_LIBS) $(LEXLIB) ) ceg/assemble.o : as.h ceg/assemble.c ceg/*h (cd ceg;$(CC) -c $(IFILES) assemble.c) @@ -60,11 +67,11 @@ ceg/assemble.o : as.h ceg/assemble.c ceg/*h ceg/as_instr.o : as.h ceg/*h ceg/as_instr.c (cd ceg;$(CC) -c $(IFILES) as_instr.c) -ceg/as_instr.c : as_table $(AS)/as_parser - $(CEG)/util/preproc as_table| $(AS)/as_parser > ceg/as_instr.c +ceg/as_instr.c : as_table # $(AS)/as_parser + (cd ceg ; $(EM)/lib/cpp -P ../as_table| $(AS)/as_parser > as_instr.c ) -ceg/eval_as.o : ceg/eval_as.c as.h $(AS)/as_parser.h $(Em)/arg_type.h +ceg/eval_as.o : ceg/eval_as.c as.h # $(AS)/as_parser.h $(Em)/arg_type.h (cd ceg;$(CC) -c $(IFILES) eval_as.c) -ceg/eval_as.c : as.c $(EVAL)/eval - $(EVAL)/eval < as.c > ceg/eval_as.c +ceg/eval_as.c : as.c # $(EVAL)/eval + ( cd ceg ; $(EVAL)/eval < ../as.c > eval_as.c ) diff --git a/util/ceg/util/preproc b/util/ceg/util/preproc index d00c9055f..28fb419da 100644 --- a/util/ceg/util/preproc +++ b/util/ceg/util/preproc @@ -1 +1 @@ -/lib/cpp $@ | sed "/^#/d" +../../../../lib/cpp $@ | sed "/^#/d" diff --git a/util/ceg/util/update b/util/ceg/util/update index b70a9312e..9cca367ee 100644 --- a/util/ceg/util/update +++ b/util/ceg/util/update @@ -9,7 +9,7 @@ do *.o) make -f ce_makefile ce/$i; ar r ce.a $i;; - *..) ( cd ce; /lib/cpp ../EM_table| sed "/^#/d"| ../ceg/ceg -c $i); + *..) ( cd ce; ../../../../lib/cpp ../EM_table| sed "/^#/d"| ../ceg/ceg -c $i); F=`basename $i ..`; U="_dnam" V="_dlb" @@ -17,7 +17,7 @@ do echo ar r ce.a ce/$F.o ce/"$F$U.o" ce/"$F$V.o"; ar r ce.a ce/$F.o ce/$F$U.o ce/"$F$U.o";; - *) ( cd ce; /lib/cpp ../EM_table| sed "/^#/d"| ../ceg/ceg -c $i); + *) ( cd ce; ../../../../lib/cpp ../EM_table| sed "/^#/d"| ../ceg/ceg -c $i); make -f ce_makefile ce/$i.o; echo ar r ce.a ce/$i.o; ar r ce.a ce/$i.o;;