cleaner versions of Makefiles

This commit is contained in:
ceriel 1989-03-10 09:47:41 +00:00
parent 24f3f2f10e
commit f740dcf176
10 changed files with 190 additions and 86 deletions

View file

@ -1,7 +1,9 @@
create_ofiles Makefile
install_ceg install_ceg
make_as make_asobj
make_obj make_back
make_ce
make_ceg_as
make_ceg_obj
make_own make_own
update_ceg update_ceg
Makefile

View file

@ -1,7 +1,7 @@
EM = ../../.. EM = ../../..
CEGLIB = $(EM)/lib/ceg CEGLIB = $(EM)/lib/ceg
UTIL = $(CEGLIB)/util UTIL = $(CEGLIB)/util
UtilList = make_as make_obj make_own UtilList = make_asobj make_own make_back make_ce make_ceg_as make_ceg_obj
all: all:

View file

@ -1,16 +1,18 @@
EMHOME=../../..
CEG=../../../lib/ceg/util CEG=../../../lib/ceg/util
case $# in case $# in
1) case $1 in 1) case $1 in
-as) cp $CEG/make_as ce_makefile;; -as) MAKE=$CEG/make_asobj;OBJ=as;;
-obj) cp $CEG/make_obj ce_makefile;; -obj) MAKE=$CEG/make_asobj;OBJ=obj;;
*) echo wrong option $1, use -as or -obj; *) echo wrong option $1, use -as or -obj;
exit 1;; exit 1;;
esac;; esac;;
0) cp $CEG/make_own ce_makefile;; 0) MAKE=$CEG/make_own;OBJ=obj ;;
*) echo wrong number of arguments; *) echo wrong number of arguments;
exit 1;; exit 1;;
esac esac
make -f ce_makefile install make -f $MAKE OBJ=$OBJ install

31
util/ceg/util/make_asobj Normal file
View file

@ -0,0 +1,31 @@
EM = ../../..
CEG = $(EM)/lib/ceg
CE_MAKE = $(CEG)/util/make_ce
BACK_MAKE = $(CEG)/util/make_back
CEG_MAKE = $(CEG)/util/make_ceg_$(OBJ)
all: back.a ceg/ceg ce.a
install: all
../../install ce.a
../../install back.a
cmp: all
-../../compare ce.a
-../../compare back.a
clean:
rm -rf ce back ceg ce.a back.a Out
dclean:
rm -rf ce back ceg Out
ce.a:
make -f $(CE_MAKE)
back.a:
make -f $(BACK_MAKE) "OBJ="$(OBJ)
ceg/ceg:
make -f $(CEG_MAKE)

13
util/ceg/util/make_back Normal file
View file

@ -0,0 +1,13 @@
EM = ../../../..
CEG = $(EM)/lib/ceg
BACK = $(CEG)/ce_back/$(OBJ)_back
AR = ar
all: back.a
back.a: mach.h
-mkdir back
cd back;cp $(BACK)/*h . ; cp $(BACK)/Makefile . ; make ; cd ..
$(AR) r back.a back/*o
-sh -c 'ranlib back.a'

30
util/ceg/util/make_ce Normal file
View file

@ -0,0 +1,30 @@
EM = ../../../..
CEG = $(EM)/lib/ceg
AS = $(CEG)/as_parser
DEF = $(CEG)/defaults
AR = ar
CC = cc
IFILES = -I. -I.. -I$(AS) -I$(EM)/h -I$(EM)/modules/h -I../back
CFLAGS = -O $(IFILES)
.c.o: mach.h back.a
cd ce ; $(CC) -c $(CFLAGS) ../$*.c ; cd ..
all: ce.a
ce.a: ce/dummy
$(AR) r ce.a ce/*.o
-sh -c 'ranlib ce.a'
ce/dummy: ce/dummy1 mach.h back.a
cd ce ; $(CC) -c $(CFLAGS) *.c ; touch dummy ; cd ..
ce/dummy1: ceg/ceg EM_table
-mkdir ce
-ln mach.c ce/mach.c
cd ce ; ../ceg/ceg -l < $(DEF)/not_impl/not_impl_table ; cp $(DEF)/*.c . ; cp $(DEF)/*/*.c . ; cd ..
cd ce ; $(EM)/lib/cpp -P ../EM_table | ../ceg/ceg -l ; touch dummy1 ; cd ..

31
util/ceg/util/make_ceg_as Normal file
View file

@ -0,0 +1,31 @@
EM = ../../../..
CEG = $(EM)/lib/ceg
Em = $(CEG)/EM_parser/as_EM_pars
ASMAIN = $(CEG)/assemble/as_assemble
AS = $(CEG)/as_parser
DEF = $(CEG)/defaults
AR = ar
CC = cc
LEXLIB = -ll
IFILES = -I. -I.. -I$(AS) -I$(Em) -I$(EM)/h -I$(EM)/modules/h -I../back
CFLAGS = -O $(IFILES)
CEG_LIBS = $(EM)/modules/lib/liballoc.a\
$(EM)/modules/lib/libprint.a\
$(EM)/modules/lib/libstring.a\
$(EM)/modules/lib/libsystem.a
all: ceg/ceg
ceg/ceg: ceg/as_lib.a
cd ceg ; $(CC) -o ceg $(Em)/*.o as_lib.a $(CEG_LIBS) $(LEXLIB) ; cd ..
ceg/as_lib.a:
-mkdir ceg
ce ceg ; cp $(CEG)/util/make_ceg_as Makefile ; cd ..
cd ceg ; cp $(ASMAIN)/* . ; $(CC) -c $(CFLAGS) *.c; $(AR) r as_lib.a *.o ; cd ..
-sh -c 'ranlib ceg/as_lib.a'

View file

@ -0,0 +1,44 @@
EM = ../../../..
CEG = $(EM)/lib/ceg
Em = $(CEG)/EM_parser/obj_EM_pars
ASMAIN = $(CEG)/assemble/obj_assemble
AS = $(CEG)/as_parser
EVAL = $(CEG)/as_parser/eval
DEF = $(CEG)/defaults
AR = ar
CC = cc
LEXLIB = -ll
IFILES = -I. -I.. -I$(AS) -I$(Em) -I$(EM)/h -I$(EM)/modules/h -I../back
CFLAGS = -O $(IFILES)
CEG_LIBS = $(EM)/modules/lib/liballoc.a\
$(EM)/modules/lib/libprint.a\
$(EM)/modules/lib/libstring.a\
$(EM)/modules/lib/libsystem.a
all: ceg/ceg
ceg/ceg : ceg/as_lib.a ceg/as_instr.o ceg/eval_as.o
cd ceg ; $(CC) -o ceg $(Em)/*.o as_instr.o eval_as.o as_lib.a $(CEG_LIBS) $(LEXLIB) ; cd ..
ceg/as_lib.a:
-mkdir ceg
cd ceg ; cp $(CEG)/util/make_ceg_obj Makefile ; cd ..
cd ceg ; cp $(ASMAIN)/* . ; $(CC) -c $(CFLAGS) *.c; $(AR) r as_lib.a *.o ; cd ..
-sh -c 'ranlib ceg/as_lib.a'
ceg/eval_as.o : ceg/eval_as.c as.h # $(AS)/as_parser.h $(Em)/arg_type.h
cd ceg ; $(CC) -c $(CFLAGS) eval_as.c ; cd ..
ceg/eval_as.c : as.c # $(EVAL)/eval
cd ceg ; $(EVAL)/eval < ../as.c > eval_as.c ; cd ..
ceg/as_instr.o : as.h ceg/as_lib.a ceg/as_instr.c
cd ceg ; $(CC) -c $(CFLAGS) as_instr.c ; cd ..
ceg/as_instr.c : as_table # $(AS)/as_parser
cd ceg ; $(EM)/lib/cpp -P ../as_table | $(AS)/as_parser > as_instr.c ; cd ..

View file

@ -1,29 +1,11 @@
EM = ../../../.. EM = ../../..
CEG = $(EM)/lib/ceg CEG = $(EM)/lib/ceg
CE_MAKE = $(CEG)/util/make_ce
BACK_MAKE = $(CEG)/util/make_back
CEG_MAKE = $(CEG)/util/make_ceg_obj
Em = $(CEG)/EM_parser/obj_EM_pars
ASMAIN = $(CEG)/assemble/obj_assemble
AS = $(CEG)/as_parser
EVAL = $(CEG)/as_parser/eval
DEF = $(CEG)/defaults
CC = cc all: ceg/ceg ce.a
AR = ar
LEXLIB = -ll
IFILES = -I. -I.. -I$(AS) -I$(Em) -I$(EM)/h -I$(EM)/modules/h -I../back
CFLAGS = -O $(IFILES)
CEG_LIBS = $(EM)/modules/lib/liballoc.a\
$(EM)/modules/lib/libprint.a\
$(EM)/modules/lib/libstring.a\
$(EM)/modules/lib/libsystem.a
.c.o: mach.h back.a
ce ce ; $(CC) -c $(CFLAGS) ../$*.c ; cd ..
all: back.a ce.a
install: all install: all
../../install ce.a ../../install ce.a
@ -34,44 +16,13 @@ cmp: all
-../../compare back.a -../../compare back.a
clean: clean:
rm -rf ce ceg ce.a back.a Out rm -rf ce ceg ce.a Out
dclean: dclean:
rm -rf ce ceg Out rm -rf ce ceg Out
ce.a : ce/dummy ce.a:
$(AR) r ce.a ce/*.o make -f $(CE_MAKE)
-sh -c 'ranlib ce.a'
ce/dummy : ce/dummy1 mach.h back.a ceg/ceg:
cd ce;$(CC) -c $(CFLAGS) *.c; touch dummy ; cd .. make -f $(CEG_MAKE)
ce/dummy1: ceg/ceg EM_table mach.h back.a
-mkdir ce
-ln mach.c ce/mach.c
cd ce; ../ceg/ceg -l < $(DEF)/not_impl/not_impl_table ; cp $(DEF)/*.c . ; cp $(DEF)/*/*.c . ; cd ..
cd ce; $(EM)/lib/cpp -P ../EM_table | ../ceg/ceg -l ; cd ..
touch ce/dummy1
ceg/as_lib.a:
-mkdir ceg
cd ceg; cp $(ASMAIN)/* . ; touch dummy ; $(CC) -c $(IFILES) *.c; $(AR) r as_lib.a *.o ; cd ..
-sh -c 'ranlib ceg/as_lib.a'
ceg/ceg : ceg/as_lib.a ceg/assemble.o ceg/as_instr.o ceg/eval_as.o
cd ceg ; $(CC) -o ceg $(Em)/*.o assemble.o as_instr.o eval_as.o as_lib.a $(CEG_LIBS) $(LEXLIB) ; cd ..
ceg/assemble.o : as.h ceg/assemble.c ceg/dummy
cd ceg;$(CC) -c $(IFILES) assemble.c ; cd ..
ceg/as_instr.o : as.h ceg/*h ceg/as_instr.c
cd ceg;$(CC) -c $(IFILES) as_instr.c ; cd ..
ceg/as_instr.c : as_table # $(AS)/as_parser
cd ceg ; $(EM)/lib/cpp -P ../as_table| $(AS)/as_parser > as_instr.c ; cd ..
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 ; cd ..
ceg/eval_as.c : as.c # $(EVAL)/eval
cd ceg ; $(EVAL)/eval < ../as.c > eval_as.c ; cd ..

View file

@ -1,28 +1,28 @@
make -f ce_makefile ceg/ceg MAKE=../../../lib/ceg/util/make_ce
make -f ceg/Makefile
for i for i
do do
case $i in case $i in
ALL) make -f ce_makefile EM_instr ce.a; ALL) make -f $MAKE ce.a
exit 0;; exit 0
;;
*.o) make -f ce_makefile ce/$i; *.o) make -f $MAKE ce/$i
ar r ce.a $i;; ;;
*..) ( cd ce; ../../../../lib/cpp ../EM_table| sed "/^#/d"| ../ceg/ceg -c $i); *..) ( cd ce; ../../../../lib/cpp -P ../EM_table | ../ceg/ceg -c $i)
F=`basename $i ..`; F=`basename $i ..`
U="_dnam" U="_dnam"
V="_dlb" V="_dlb"
make -f ce_makefile ce/$F.o ce/$F$U.o ce/"$F$V.o"; make -f $MAKE ce/$F.o ce/$F$U.o ce/"$F$V.o"
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 -P ../EM_table | ../ceg/ceg -c $i)
make -f ce_makefile ce/$i.o; make -f $MAKE ce/$i.o
echo ar r ce.a ce/$i.o; ;;
ar r ce.a ce/$i.o;;
esac esac
done done
touch ce/dummy
echo ranlib ce.a make -f $MAKE ce.a
ranlib ce.a