ack/util/ceg/util/make_as

69 lines
1.5 KiB
Plaintext

EM = ../../../..
CEG = $(EM)/lib/ceg
Em = $(CEG)/EM_parser/as_EM_pars
ASMAIN = $(CEG)/assemble/as_assemble
BACK = $(CEG)/ce_back
AS = $(CEG)/as_parser
DEF = $(CEG)/defaults
CC = cc
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
cd ce ; $(CC) -c $(CFLAGS) ../$*.c ; cd ..
all: back.a 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 : 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 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)/* . ; $(CC) -c $(IFILES) *.c; $(AR) r as_lib.a *.o ; cd ..
-sh -c 'ranlib ceg/as_lib.a'
back.a: mach.h
-mkdir back
cd back;cp $(BACK)/as_back/*h . ; cp $(BACK)/as_back/Makefile . ; make ; cd ..
$(AR) r back.a back/*o
-sh -c 'ranlib back.a'
ceg/ceg : ceg/as_lib.a # $(Em)/em_parser
cd ceg; $(CC) -o ceg $(Em)/*.o as_lib.a $(CEG_LIBS) $(LEXLIB) ; cd ..