From 9751e398e3a2bceacc0c53edee10fe416fba95eb Mon Sep 17 00:00:00 2001 From: ceriel Date: Thu, 16 Feb 1989 16:33:29 +0000 Subject: [PATCH] Made easier to use other compiler --- modules/src/alloc/Makefile | 38 +++++++++------ modules/src/assert/Makefile | 26 ++++++---- modules/src/em_code/Makefile | 40 +++++++++------- modules/src/em_code/make.sh | 4 +- modules/src/em_mes/Makefile | 59 +++++++++++++---------- modules/src/idf/Makefile | 6 +-- modules/src/input/Makefile | 32 ++++++++----- modules/src/malloc/Makefile | 20 +++++--- modules/src/malloc/getsize.c | 6 +-- modules/src/object/Makefile | 62 +++++++++++++----------- modules/src/print/Makefile | 28 +++++++---- modules/src/read_em/Makefile | 92 +++++++++++++++++++----------------- modules/src/system/Makefile | 48 +++++++++++-------- util/data/Makefile | 22 +++++---- 14 files changed, 279 insertions(+), 204 deletions(-) diff --git a/modules/src/alloc/Makefile b/modules/src/alloc/Makefile index db6925221..5b5f3f98f 100644 --- a/modules/src/alloc/Makefile +++ b/modules/src/alloc/Makefile @@ -4,8 +4,10 @@ INSTALL=$(EMHOME)/modules/install COMPARE=$(EMHOME)/modules/compare INCLUDES = -I. -I$(HDIR) AR = ar +SUF = o +LIBSUF = a -CFLAGS = -O $(INCLUDES) +CFLAGS = -O $(INCLUDES) $(COPT) CSRC = Malloc.c\ Salloc.c\ @@ -19,24 +21,29 @@ CSRC = Malloc.c\ SOURCES = alloc.h\ $(CSRC) -OBJECTS = botch.o clear.o st_alloc.o Malloc.o Salloc.o \ - Srealloc.o Realloc.o std_alloc.o No_Mem.o +OBJECTS = botch.$(SUF) clear.$(SUF) st_alloc.$(SUF) Malloc.$(SUF) \ + Salloc.$(SUF) \ + Srealloc.$(SUF) Realloc.$(SUF) std_alloc.$(SUF) No_Mem.$(SUF) -all: liballoc.a +.SUFFIXES: .$(SUF) +.c.$(SUF): + $(CC) -c $(CFLAGS) $*.c -liballoc.a: $(OBJECTS) - $(AR) cr liballoc.a $(OBJECTS) - -sh -c 'ranlib liballoc.a' +all: liballoc.$(LIBSUF) + +liballoc.$(LIBSUF): $(OBJECTS) + $(AR) cr liballoc.$(LIBSUF) $(OBJECTS) + -sh -c 'ranlib liballoc.$(LIBSUF)' install: all - $(INSTALL) lib/liballoc.a + $(INSTALL) lib/liballoc.$(LIBSUF) $(INSTALL) man/alloc.3 $(INSTALL) h/alloc.h cmp: all - $(COMPARE) lib/liballoc.a - $(COMPARE) man/alloc.3 - $(COMPARE) h/alloc.h + -$(COMPARE) lib/liballoc.$(LIBSUF) + -$(COMPARE) man/alloc.3 + -$(COMPARE) h/alloc.h pr: @pr Makefile $(SOURCES) @@ -45,11 +52,12 @@ opr: make pr | opr clean: - rm -f *.[oa] + rm -f *.$(SUF) *.$(LIBSUF) lintlib: lint $(INCLUDES) -Calloc $(CSRC) mv llib-lalloc.ln $(EMHOME)/modules/lib -st_alloc.o: alloc.h -std_alloc.o: alloc.h -Malloc.o: alloc.h + +st_alloc.$(SUF): alloc.h +std_alloc.$(SUF): alloc.h +Malloc.$(SUF): alloc.h diff --git a/modules/src/assert/Makefile b/modules/src/assert/Makefile index e36ab1cf2..714504a53 100644 --- a/modules/src/assert/Makefile +++ b/modules/src/assert/Makefile @@ -2,26 +2,32 @@ EMHOME=../../.. MODULES=$(EMHOME)/modules HDIR = $(MODULES)/h INCLUDES = -I$(HDIR) -CFLAGS = $(INCLUDES) -O +CFLAGS = $(INCLUDES) -O $(COPT) INSTALL = $(MODULES)/install COMPARE = $(MODULES)/compare AR = ar +SUF = o +LIBSUF = a -all: libassert.a +.SUFFIXES: .$(SUF) +.c.$(SUF): + $(CC) -c $(CFLAGS) $*.c -libassert.a: BadAssert.o - $(AR) r libassert.a BadAssert.o - -sh -c 'ranlib libassert.a' +all: libassert.$(LIBSUF) + +libassert.$(LIBSUF): BadAssert.$(SUF) + $(AR) r libassert.$(LIBSUF) BadAssert.$(SUF) + -sh -c 'ranlib libassert.$(LIBSUF)' install: all - $(INSTALL) lib/libassert.a + $(INSTALL) lib/libassert.$(LIBSUF) $(INSTALL) man/assert.3 $(INSTALL) h/assert.h cmp: all - $(COMPARE) lib/libassert.a - $(COMPARE) man/assert.3 - $(COMPARE) h/assert.h + -$(COMPARE) lib/libassert.$(LIBSUF) + -$(COMPARE) man/assert.3 + -$(COMPARE) h/assert.h pr: @pr Makefile assert.h BadAssert.c @@ -30,7 +36,7 @@ opr: make pr | opr clean: - rm -f *.[oa] + rm -f *.$(LIBSUF) *.$(SUF) lintlib: lint $(INCLUDES) -Cassert BadAssert.c diff --git a/modules/src/em_code/Makefile b/modules/src/em_code/Makefile index 7e25eb3b3..d67225896 100644 --- a/modules/src/em_code/Makefile +++ b/modules/src/em_code/Makefile @@ -2,8 +2,10 @@ EMHOME = ../../.. ETC = $(EMHOME)/etc INSTALL = $(EMHOME)/modules/install COMPARE = $(EMHOME)/modules/compare -CFLAGS = -I$(EMHOME)/h -I$(EMHOME)/modules/h -I. -O +CFLAGS = -I$(EMHOME)/h -I$(EMHOME)/modules/h -I. -O $(COPT) AR = ar +SUF = o +LIBSUF = a SRC = bhcst.c bhdlb.c bhdnam.c bhfcon.c bhicon.c bhilb.c bhpnam.c bhucon.c \ crcst.c crdlb.c crdnam.c crfcon.c cricon.c crilb.c crpnam.c crscon.c \ crucon.c cst.c dfdlb.c dfdnam.c dfilb.c dlb.c dnam.c end.c endarg.c \ @@ -12,33 +14,37 @@ SRC = bhcst.c bhdlb.c bhdnam.c bhfcon.c bhicon.c bhilb.c bhpnam.c bhucon.c \ pro.c pronarg.c msstart.c psdlb.c psdnam.c pspnam.c scon.c ucon.c \ C_out.c failed.c -OBS = failed.o insert.o internerr.o getid.o +OBS = failed.$(SUF) insert.$(SUF) internerr.$(SUF) getid.$(SUF) -all: em_codeEK.h libeme.a libemk.a em_code.3 +.SUFFIXES: .$(SUF) +.c.$(SUF): + $(CC) -c $(CFLAGS) $*.c + +all: em_codeEK.h libeme.$(LIBSUF) libemk.$(LIBSUF) em_code.3 install: all - $(INSTALL) lib/libeme.a - $(INSTALL) lib/libemk.a + $(INSTALL) lib/libeme.$(LIBSUF) + $(INSTALL) lib/libemk.$(LIBSUF) $(INSTALL) man/em_code.3 $(INSTALL) h/em_codeEK.h compare: all - $(COMPARE) lib/libeme.a - $(COMPARE) lib/libemk.a - $(COMPARE) man/em_code.3 - $(COMPARE) h/em_codeEK.h + -$(COMPARE) lib/libeme.$(LIBSUF) + -$(COMPARE) lib/libemk.$(LIBSUF) + -$(COMPARE) man/em_code.3 + -$(COMPARE) h/em_codeEK.h em_code.3: em_code.3X -sh -c 'tbl < em_code.3X > em_code.3' -sh -c 'if test -s em_code.3 ; then : ; else cp em_code.3X em_code.3 ; fi ' -libeme.a: e/em_private.h e/em.c $(OBS) io.c - EMHOME=$(EMHOME); cc="$(CC)"; cflags="-c -Ie $(CFLAGS)" ar="$(AR)"; export EMHOME cc ar cflags; sh -x make.sh e - -sh -c 'ranlib libeme.a' +libeme.$(LIBSUF): e/em_private.h e/em.c $(OBS) io.c + EMHOME=$(EMHOME); cc="$(CC)"; suf="$(SUF)"; libsuf="$(LIBSUF)"; cflags="-c -Ie $(CFLAGS)"; ar="$(AR)"; export EMHOME cc ar suf libsuf cflags; sh -x make.sh e + -sh -c 'ranlib libeme.$(LIBSUF)' -libemk.a: k/em_private.h k/em.c $(OBS) io.c - EMHOME=$(EMHOME); cc="$(CC)"; cflags="-c -Ik $(CFLAGS)" ar="$(AR)"; export EMHOME cc ar cflags; sh -x make.sh k - -sh -c 'ranlib libemk.a' +libemk.$(LIBSUF): k/em_private.h k/em.c $(OBS) io.c + EMHOME=$(EMHOME); cc="$(CC)"; suf="$(SUF)"; libsuf="$(LIBSUF)"; cflags="-c -Ik $(CFLAGS)"; ar="$(AR)"; export EMHOME cc ar suf libsuf cflags; sh -x make.sh k + -sh -c 'ranlib libemk.$(LIBSUF)' em_codeEK.h: make.em.gen $(ETC)/em_table em.nogen make.em.gen $(ETC)/em_table > em_codeEK.h @@ -51,12 +57,12 @@ opr: make pr | opr clean: - rm -f *.o *.a em_code.3 + rm -f *.$(SUF) *.$(LIBSUF) em_code.3 lintlib: make.sh lint -I. -I../../h -I../../../h -Ie -Ceme $(SRC) e/*.c lint -I. -I../../h -I../../../h -Ik -Cemk $(SRC) k/*.c mv llib-leme.ln llib-lemk.ln $(EMHOME)/modules/lib -insert.o: insert.c insert.h +insert.$(SUF): insert.c insert.h $(CC) $(CFLAGS) -c insert.c diff --git a/modules/src/em_code/make.sh b/modules/src/em_code/make.sh index 0c4dee2cb..923e16888 100755 --- a/modules/src/em_code/make.sh +++ b/modules/src/em_code/make.sh @@ -46,5 +46,5 @@ if $cc $cflags scon.c ; then : ; else exit 1 ; fi if $cc $cflags ucon.c ; then : ; else exit 1 ; fi if $cc $cflags -I../read_em C_out.c ; then : ; else exit 1 ; fi if $cc $cflags $1/em.c ; then : ; else exit 1 ; fi -if mv em.o em$1.o ; then : ; else exit 1 ; fi -if $ar rc libem$1.a bhcst.o bhdlb.o bhdnam.o bhfcon.o bhicon.o bhilb.o bhpnam.o bhucon.o crcst.o crdlb.o crdnam.o crfcon.o cricon.o crilb.o crpnam.o crscon.o crucon.o cst.o dfdlb.o dfdnam.o dfilb.o dlb.o dnam.o end.o endarg.o exc.o fcon.o getid.o icon.o ilb.o insert.o internerr.o msend.o op.o opcst.o opdlb.o opdnam.o opilb.o opnarg.o oppnam.o pnam.o pro.o pronarg.o msstart.o psdlb.o psdnam.o pspnam.o scon.o ucon.o C_out.o em$1.o failed.o ; then : ; else exit 1 ; fi +if mv em.$suf em$1.$suf ; then : ; else exit 1 ; fi +if $ar rc libem$1.$libsuf bhcst.$suf bhdlb.$suf bhdnam.$suf bhfcon.$suf bhicon.$suf bhilb.$suf bhpnam.$suf bhucon.$suf crcst.$suf crdlb.$suf crdnam.$suf crfcon.$suf cricon.$suf crilb.$suf crpnam.$suf crscon.$suf crucon.$suf cst.$suf dfdlb.$suf dfdnam.$suf dfilb.$suf dlb.$suf dnam.$suf end.$suf endarg.$suf exc.$suf fcon.$suf getid.$suf icon.$suf ilb.$suf insert.$suf internerr.$suf msend.$suf op.$suf opcst.$suf opdlb.$suf opdnam.$suf opilb.$suf opnarg.$suf oppnam.$suf pnam.$suf pro.$suf pronarg.$suf msstart.$suf psdlb.$suf psdnam.$suf pspnam.$suf scon.$suf ucon.$suf C_out.$suf em$1.$suf failed.$suf ; then : ; else exit 1 ; fi diff --git a/modules/src/em_mes/Makefile b/modules/src/em_mes/Makefile index 0ac308367..ba65c4e4f 100644 --- a/modules/src/em_mes/Makefile +++ b/modules/src/em_mes/Makefile @@ -2,44 +2,51 @@ EMHOME = ../../.. HDIR = $(EMHOME)/modules/h INSTALL = $(EMHOME)/modules/install COMPARE = $(EMHOME)/modules/compare +INCLUDES=-I$(EMHOME)/h -I$(HDIR) +CFLAGS = $(INCLUDES) -O $(COPT) +AR = ar +SUF = o +LIBSUF = a + SRC = C_ms_err.c C_ms_opt.c C_ms_emx.c C_ms_reg.c C_ms_src.c\ C_ms_flt.c C_ms_com.c C_ms_par.c C_ms_ego.c C_ms_gto.c -OBJ = C_ms_err.o C_ms_opt.o C_ms_emx.o C_ms_reg.o C_ms_src.o\ - C_ms_flt.o C_ms_com.o C_ms_par.o C_ms_ego.o C_ms_gto.o -INCLUDES=-I$(EMHOME)/h -I$(HDIR) -CFLAGS = $(INCLUDES) -O -AR = ar +OBJ = C_ms_err.$(SUF) C_ms_opt.$(SUF) C_ms_emx.$(SUF) C_ms_reg.$(SUF) C_ms_src.$(SUF)\ + C_ms_flt.$(SUF) C_ms_com.$(SUF) C_ms_par.$(SUF) C_ms_ego.$(SUF) C_ms_gto.$(SUF) -all: libem_mes.a # libem_mesCE.a libem_mesO.a +.SUFFIXES: .$(SUF) +.c.$(SUF): + $(CC) -c $(CFLAGS) $*.c -libem_mes.a: $(OBJ) - rm -f libem_mes.a - $(AR) cr libem_mes.a $(OBJ) - -sh -c 'ranlib libem_mes.a' +all: libem_mes.$(LIBSUF) # libem_mesCE.$(LIBSUF) libem_mesO.$(LIBSUF) -libem_mesO.a: - rm -f *.o libem_mesO.a +libem_mes.$(LIBSUF): $(OBJ) + rm -f libem_mes.$(LIBSUF) + $(AR) cr libem_mes.$(LIBSUF) $(OBJ) + -sh -c 'ranlib libem_mes.$(LIBSUF)' + +libem_mesO.$(LIBSUF): + rm -f *.$(SUF) libem_mesO.$(LIBSUF) $(CC) -c $(CFLAGS) -DPEEPHOLE $(SRC) - $(AR) cr libem_mesO.a $(OBJ) - -sh -c 'ranlib libem_mesO.a' - rm -f *.o + $(AR) cr libem_mesO.$(LIBSUF) $(OBJ) + -sh -c 'ranlib libem_mesO.$(LIBSUF)' + rm -f *.$(SUF) -libem_mesCE.a: - rm -f *.o libem_mesCE.a +libem_mesCE.$(LIBSUF): + rm -f *.$(SUF) libem_mesCE.$(LIBSUF) $(CC) -c $(CFLAGS) -DCODE_EXPANDER $(SRC) - $(AR) cr libem_mesCE.a $(OBJ) - -sh -c 'ranlib libem_mesCE.a' - rm -f *.o + $(AR) cr libem_mesCE.$(LIBSUF) $(OBJ) + -sh -c 'ranlib libem_mesCE.$(LIBSUF)' + rm -f *.$(SUF) install: all - $(INSTALL) lib/libem_mes.a -# $(INSTALL) lib/libem_mesO.a + $(INSTALL) lib/libem_mes.$(LIBSUF) +# $(INSTALL) lib/libem_mesO.$(LIBSUF) $(INSTALL) man/em_mes.3 cmp: all - $(COMPARE) lib/libem_mes.a -# $(COMPARE) lib/libem_mesO.a - $(COMPARE) man/em_mes.3 + -$(COMPARE) lib/libem_mes.$(LIBSUF) +# -$(COMPARE) lib/libem_mesO.$(LIBSUF) + -$(COMPARE) man/em_mes.3 pr: @pr Makefile $(SRC) @@ -48,7 +55,7 @@ opr: make pr | opr clean: - rm -f *.[oa] + rm -f *.$(SUF) *.$(LIBSUF) lintlib: lint $(INCLUDES) -Cem_mes $(SRC) diff --git a/modules/src/idf/Makefile b/modules/src/idf/Makefile index 717d14839..d170b5b94 100644 --- a/modules/src/idf/Makefile +++ b/modules/src/idf/Makefile @@ -10,9 +10,9 @@ install: all $(INSTALL) man/idf.3 cmp: all - $(COMPARE) pkg/idf_pkg.body - $(COMPARE) pkg/idf_pkg.spec - $(COMPARE) man/idf.3 + -$(COMPARE) pkg/idf_pkg.body + -$(COMPARE) pkg/idf_pkg.spec + -$(COMPARE) man/idf.3 pr: @pr Makefile idf_pkg.spec idf_pkg.body diff --git a/modules/src/input/Makefile b/modules/src/input/Makefile index db8a22717..ab4da17a0 100644 --- a/modules/src/input/Makefile +++ b/modules/src/input/Makefile @@ -2,29 +2,35 @@ EMHOME = ../../.. MODULES = $(EMHOME)/modules INSTALL = $(MODULES)/install COMPARE = $(MODULES)/compare -CFLAGS = -O +CFLAGS = -O $(COPT) AR = ar +SUF = o +LIBSUF = a -OBJECTS = AtEoIF.o\ - AtEoIT.o +OBJECTS = AtEoIF.$(SUF)\ + AtEoIT.$(SUF) -all: libinput.a +.SUFFIXES: .$(SUF) +.c.$(SUF): + $(CC) -c $(CFLAGS) $*.c -libinput.a: $(OBJECTS) - $(AR) cr libinput.a $(OBJECTS) - -sh -c 'ranlib libinput.a' +all: libinput.$(LIBSUF) + +libinput.$(LIBSUF): $(OBJECTS) + $(AR) cr libinput.$(LIBSUF) $(OBJECTS) + -sh -c 'ranlib libinput.$(LIBSUF)' install: all - $(INSTALL) lib/libinput.a + $(INSTALL) lib/libinput.$(LIBSUF) $(INSTALL) man/input.3 $(INSTALL) pkg/inp_pkg.body $(INSTALL) pkg/inp_pkg.spec cmp: all - $(COMPARE) lib/libinput.a - $(COMPARE) man/input.3 - $(COMPARE) pkg/inp_pkg.body - $(COMPARE) pkg/inp_pkg.spec + -$(COMPARE) lib/libinput.$(LIBSUF) + -$(COMPARE) man/input.3 + -$(COMPARE) pkg/inp_pkg.body + -$(COMPARE) pkg/inp_pkg.spec pr: @pr Makefile inp_pkg.spec inp_pkg.body AtEoIF.c AtEoIT.c @@ -33,7 +39,7 @@ opr: make pr | opr clean: - rm -f *.[oa] + rm -f *.$(SUF) *.$(LIBSUF) lintlib: lint -Cinput AtEoIF.c AtEoIT.c diff --git a/modules/src/malloc/Makefile b/modules/src/malloc/Makefile index 994d09967..5884e37ae 100644 --- a/modules/src/malloc/Makefile +++ b/modules/src/malloc/Makefile @@ -1,18 +1,24 @@ EMHOME = ../../.. INSTALL = $(EMHOME)/modules/install COMPARE = $(EMHOME)/modules/compare -CFLAGS = -O -I$(EMHOME)/modules/h +CFLAGS = -O -I$(EMHOME)/modules/h $(COPT) +SUF = o +RCC = cc #$ must produce a runnable object MALLOCSRC = READ_ME size_type.h param.h impl.h check.h log.h phys.h \ mal.c log.c phys.c check.c -all: malloc.o +.SUFFIXES: .$(SUF) +.c.$(SUF): + $(CC) -c $(CFLAGS) $*.c + +all: malloc.$(SUF) install: all - $(INSTALL) lib/malloc.o + $(INSTALL) lib/malloc.$(SUF) cmp: all - $(COMPARE) lib/malloc.o + -$(COMPARE) lib/malloc.$(SUF) malloc1.c: $(MALLOCSRC) Makefile add_file rm -f malloc1.c @@ -29,10 +35,10 @@ opr: make pr | opr clean: - rm -f *.o clashes malloc1.c size_type.h getsize malloc.c + rm -f *.$(SUF) clashes malloc1.c size_type.h getsize malloc.c size_type.h: getsize getsize > size_type.h -getsize: getsize.o - $(CC) -o getsize getsize.o +getsize: getsize.c + $(RCC) -o getsize getsize.c diff --git a/modules/src/malloc/getsize.c b/modules/src/malloc/getsize.c index 2568d60ef..2b4ba9d6a 100644 --- a/modules/src/malloc/getsize.c +++ b/modules/src/malloc/getsize.c @@ -13,12 +13,12 @@ main() { if (sizeof(unsigned int) == sizeof(char *)) { puts("typedef unsigned int size_type;"); - return 0; + exit(0); } if (sizeof(long) == sizeof(char *)) { puts("typedef long size_type;"); - return 0; + exit(0); } fputs(stderr, "funny pointer size\n"); - return 1; + exit(1); } diff --git a/modules/src/object/Makefile b/modules/src/object/Makefile index 2ab9ab3cb..6c253adbf 100644 --- a/modules/src/object/Makefile +++ b/modules/src/object/Makefile @@ -3,8 +3,12 @@ MODULES = $(EMHOME)/modules INSTALL = $(MODULES)/install COMPARE = $(MODULES)/compare INCLUDES = -I$(EMHOME)/h -CFLAGS = -O $(INCLUDES) +CFLAGS = -O $(INCLUDES) $(COPT) AR = ar +SUF = o +LIBSUF = a +RCC = cc # must produce a runnable object + CFILES = rd_arhdr.c wr_arhdr.c \ rd_ranlib.c wr_ranlib.c \ rd_bytes.c wr_bytes.c \ @@ -14,19 +18,23 @@ CFILES = rd_arhdr.c wr_arhdr.c \ rd_unsig2.c \ rd_long.c wr_long.c # do not change the order in OFILES -OFILES = rd.o rd_arhdr.o rd_int2.o rd_long.o rd_ranlib.o rd_unsig2.o \ - rd_bytes.o wr_arhdr.o wr_int2.o wr_long.o wr_putc.o wr.o \ - wr_ranlib.o wr_bytes.o +OFILES = rd.$(SUF) rd_arhdr.$(SUF) rd_int2.$(SUF) rd_long.$(SUF) rd_ranlib.$(SUF) rd_unsig2.$(SUF) \ + rd_bytes.$(SUF) wr_arhdr.$(SUF) wr_int2.$(SUF) wr_long.$(SUF) wr_putc.$(SUF) wr.$(SUF) \ + wr_ranlib.$(SUF) wr_bytes.$(SUF) -all: libobject.a +.SUFFIXES: .$(SUF) +.c.$(SUF): + $(CC) -c $(CFLAGS) $*.c + +all: libobject.$(LIBSUF) install: all - $(INSTALL) lib/libobject.a + $(INSTALL) lib/libobject.$(LIBSUF) $(INSTALL) man/object.3 compare: all - $(COMPARE) lib/libobject.a - $(COMPARE) man/object.3 + -$(COMPARE) lib/libobject.$(LIBSUF) + -$(COMPARE) man/object.3 pr: @pr Makefile byte_order.c object.h $(CFILES) @@ -35,21 +43,21 @@ opr: make pr | opr clean: - rm -f *.[oa] nohup.out Out byte_order byte_order.h + rm -f *.$(SUF) *.$(LIBSUF) nohup.out Out byte_order byte_order.h -libobject.a: $(OFILES) - $(AR) r libobject.a $(OFILES) - -sh -c 'ranlib libobject.a' +libobject.$(LIBSUF): $(OFILES) + $(AR) r libobject.$(LIBSUF) $(OFILES) + -sh -c 'ranlib libobject.$(LIBSUF)' depend: byte_order.h sed '/^#AUTOAUTO/,$$d' Makefile > Makefile.new echo '#AUTOAUTOAUTOAUTOAUTOAUTOAUTO' >> Makefile.new - mkdep $(CFILES) | sed 's/\.c:/\.o:/' >> Makefile.new - mv Makefile Makefile.old + mkdep $(CFILES) | sed 's/\.c:/\.$(SUF):/' >> Makefile.new + mv Makefile Makefile.$(SUF)ld mv Makefile.new Makefile -byte_order: byte_order.o - $(CC) $(LDFLAGS) -o byte_order byte_order.o +byte_order: byte_order.c + $(RCC) -o byte_order byte_order.c byte_order.h: byte_order byte_order > byte_order.h @@ -59,14 +67,14 @@ lintlib: byte_order.h mv llib-lobject.ln $(MODULES)/lib #AUTOAUTOAUTOAUTOAUTOAUTOAUTO -rd_arhdr.o: byte_order.h object.h -wr_arhdr.o: byte_order.h object.h -rd_ranlib.o: byte_order.h object.h -wr_ranlib.o: byte_order.h object.h -rd.o: byte_order.h object.h -wr.o: byte_order.h object.h -rd_int2.o: byte_order.h object.h -wr_int2.o: byte_order.h object.h -rd_unsig2.o: byte_order.h object.h -rd_long.o: byte_order.h object.h -wr_long.o: byte_order.h object.h +rd_arhdr.$(SUF): byte_order.h object.h +wr_arhdr.$(SUF): byte_order.h object.h +rd_ranlib.$(SUF): byte_order.h object.h +wr_ranlib.$(SUF): byte_order.h object.h +rd.$(SUF): byte_order.h object.h +wr.$(SUF): byte_order.h object.h +rd_int2.$(SUF): byte_order.h object.h +wr_int2.$(SUF): byte_order.h object.h +rd_unsig2.$(SUF): byte_order.h object.h +rd_long.$(SUF): byte_order.h object.h +wr_long.$(SUF): byte_order.h object.h diff --git a/modules/src/print/Makefile b/modules/src/print/Makefile index d629bce17..3831b133a 100644 --- a/modules/src/print/Makefile +++ b/modules/src/print/Makefile @@ -1,13 +1,21 @@ EMHOME = ../../.. -LIBPRINT = libprint.a MODDIR=$(EMHOME)/modules INSTALL = $(MODDIR)/install COMPARE = $(MODDIR)/compare INCLUDES = -I$(MODDIR)/h -CFLAGS = -O $(INCLUDES) +CFLAGS = -O $(INCLUDES) $(COPT) AR = ar +SUF = o +LIBSUF = a + +LIBPRINT = libprint.$(LIBSUF) + SRC = doprnt.c fprint.c print.c sprint.c format.c -OBJ = doprnt.o fprint.o print.o sprint.o format.o +OBJ = doprnt.$(SUF) fprint.$(SUF) print.$(SUF) sprint.$(SUF) format.$(SUF) + +.SUFFIXES: .$(SUF) +.c.$(SUF): + $(CC) -c $(CFLAGS) $*.c all: $(LIBPRINT) @@ -21,8 +29,8 @@ install: all $(INSTALL) man/print.3 cmp: all - $(COMPARE) lib/$(LIBPRINT) - $(COMPARE) man/print.3 + -$(COMPARE) lib/$(LIBPRINT) + -$(COMPARE) man/print.3 pr: @pr Makefile $(SRC) @@ -31,13 +39,13 @@ opr: make pr | opr clean: - rm -f *.o $(LIBPRINT) + rm -f *.$(SUF) $(LIBPRINT) lintlib: lint $(INCLUDES) -Cprint $(SRC) mv llib-lprint.ln $(MODDIR)/lib -doprnt.o: param.h -fprint.o: param.h -print.o: param.h -sprint.o: param.h +doprnt.$(SUF): param.h +fprint.$(SUF): param.h +print.$(SUF): param.h +sprint.$(SUF): param.h diff --git a/modules/src/read_em/Makefile b/modules/src/read_em/Makefile index a975e38f0..34a2fb865 100644 --- a/modules/src/read_em/Makefile +++ b/modules/src/read_em/Makefile @@ -4,14 +4,16 @@ HDIR = $(MODULES)/h EMHDIR = $(EMHOME)/h INCLUDES = -I$(HDIR) -I$(EMHDIR) DEFINES = -DPRIVATE=static -DEXPORT= -CFLAGS = -O $(INCLUDES) $(DEFINES) +CFLAGS = -O $(INCLUDES) $(DEFINES) $(COPT) INSTALL = $(MODULES)/install COMPARE = $(MODULES)/compare AR = ar +SUF = o +LIBSUF = a -TARGETS = libread_emk.a\ - libread_emkV.a\ - libread_emeV.a # makecallsO.o makecallsCE.o +TARGETS = libread_emk.$(LIBSUF)\ + libread_emkV.$(LIBSUF)\ + libread_emeV.$(LIBSUF) # makecallsO.$(SUF) makecallsCE.$(SUF) ESRCFILES = read_em.c\ mkcalls.c\ @@ -28,29 +30,33 @@ SRCFILES = em_comp.h\ mkcalls.c\ EM_vars.c -EV_OFILES = read_emeV.o makecallsV.o EM_vars.o -KV_OFILES = read_emkV.o makecallsV.o EM_vars.o -K_OFILES = read_emk.o makecalls.o EM_vars.o +EV_OFILES = read_emeV.$(SUF) makecallsV.$(SUF) EM_vars.$(SUF) +KV_OFILES = read_emkV.$(SUF) makecallsV.$(SUF) EM_vars.$(SUF) +K_OFILES = read_emk.$(SUF) makecalls.$(SUF) EM_vars.$(SUF) + +.SUFFIXES: .$(SUF) +.c.$(SUF): + $(CC) -c $(CFLAGS) $*.c all: $(TARGETS) install: all $(INSTALL) h/em_comp.h - $(INSTALL) lib/libread_emk.a - $(INSTALL) lib/libread_emkV.a - $(INSTALL) lib/libread_emeV.a + $(INSTALL) lib/libread_emk.$(LIBSUF) + $(INSTALL) lib/libread_emkV.$(LIBSUF) + $(INSTALL) lib/libread_emeV.$(LIBSUF) $(INSTALL) man/read_em.3 -# $(INSTALL) lib/makecallsO.o -# $(INSTALL) lib/makecallsCE.o +# $(INSTALL) lib/makecallsO.$(SUF) +# $(INSTALL) lib/makecallsCE.$(SUF) cmp: all - $(COMPARE) h/em_comp.h - $(COMPARE) lib/libread_emk.a - $(COMPARE) lib/libread_emkV.a - $(COMPARE) lib/libread_emeV.a - $(COMPARE) man/read_em.3 -# $(COMPARE) lib/makecallsO.o -# $(COMPARE) lib/makecallsCE.o + -$(COMPARE) h/em_comp.h + -$(COMPARE) lib/libread_emk.$(LIBSUF) + -$(COMPARE) lib/libread_emkV.$(LIBSUF) + -$(COMPARE) lib/libread_emeV.$(LIBSUF) + -$(COMPARE) man/read_em.3 +# -$(COMPARE) lib/makecallsO.$(SUF) +# -$(COMPARE) lib/makecallsCE.$(SUF) pr: @pr Makefile m_C_mnem m_C_mnem_na argtype $(SRCFILES) @@ -59,47 +65,47 @@ opr: make pr | opr clean: - rm -f *.o *.a C_mnem C_mnem_narg + rm -f *.$(SUF) *.$(LIBSUF) C_mnem C_mnem_narg -libread_emk.a: $(K_OFILES) - $(AR) r libread_emk.a $(K_OFILES) - -sh -c 'ranlib libread_emk.a' +libread_emk.$(LIBSUF): $(K_OFILES) + $(AR) r libread_emk.$(LIBSUF) $(K_OFILES) + -sh -c 'ranlib libread_emk.$(LIBSUF)' -libread_emkV.a: $(KV_OFILES) - $(AR) r libread_emkV.a $(KV_OFILES) - -sh -c 'ranlib libread_emkV.a' +libread_emkV.$(LIBSUF): $(KV_OFILES) + $(AR) r libread_emkV.$(LIBSUF) $(KV_OFILES) + -sh -c 'ranlib libread_emkV.$(LIBSUF)' -libread_emeV.a: $(EV_OFILES) - $(AR) r libread_emeV.a $(EV_OFILES) - -sh -c 'ranlib libread_emeV.a' +libread_emeV.$(LIBSUF): $(EV_OFILES) + $(AR) r libread_emeV.$(LIBSUF) $(EV_OFILES) + -sh -c 'ranlib libread_emeV.$(LIBSUF)' -read_emk.o: read_em.c em_comp.h readk.c +read_emk.$(SUF): read_em.c em_comp.h readk.c $(CC) -c $(CFLAGS) -DCOMPACT read_em.c - mv read_em.o read_emk.o + mv read_em.$(SUF) read_emk.$(SUF) -read_emkV.o: read_em.c em_comp.h readk.c +read_emkV.$(SUF): read_em.c em_comp.h readk.c $(CC) -c $(CFLAGS) -DCOMPACT -DCHECKING read_em.c - mv read_em.o read_emkV.o + mv read_em.$(SUF) read_emkV.$(SUF) -read_emeV.o: read_em.c em_comp.h reade.c +read_emeV.$(SUF): read_em.c em_comp.h reade.c $(CC) -c $(CFLAGS) -DCHECKING read_em.c - mv read_em.o read_emeV.o + mv read_em.$(SUF) read_emeV.$(SUF) -makecalls.o: C_mnem C_mnem_narg em_comp.h mkcalls.c +makecalls.$(SUF): C_mnem C_mnem_narg em_comp.h mkcalls.c $(CC) -c $(CFLAGS) mkcalls.c - mv mkcalls.o makecalls.o + mv mkcalls.$(SUF) makecalls.$(SUF) -makecallsV.o: C_mnem C_mnem_narg em_comp.h mkcalls.c +makecallsV.$(SUF): C_mnem C_mnem_narg em_comp.h mkcalls.c $(CC) -c $(CFLAGS) -DCHECKING mkcalls.c - mv mkcalls.o makecallsV.o + mv mkcalls.$(SUF) makecallsV.$(SUF) -makecallsO.o: C_mnem C_mnem_narg em_comp.h mkcalls.c +makecallsO.$(SUF): C_mnem C_mnem_narg em_comp.h mkcalls.c $(CC) -c -DPEEPHOLE $(CFLAGS) mkcalls.c - mv mkcalls.o makecallsO.o + mv mkcalls.$(SUF) makecallsO.$(SUF) -makecallsCE.o: C_mnem C_mnem_narg em_comp.h mkcalls.c +makecallsCE.$(SUF): C_mnem C_mnem_narg em_comp.h mkcalls.c $(CC) -c -DCODE_EXPANDER $(CFLAGS) mkcalls.c - mv mkcalls.o makecallsCE.o + mv mkcalls.$(SUF) makecallsCE.$(SUF) C_mnem: m_C_mnem argtype sh m_C_mnem > C_mnem diff --git a/modules/src/system/Makefile b/modules/src/system/Makefile index 1e068e9f2..f4d4b5a9f 100644 --- a/modules/src/system/Makefile +++ b/modules/src/system/Makefile @@ -2,18 +2,26 @@ EMHOME = ../../.. MODULES = $(EMHOME)/modules INSTALL = $(MODULES)/install COMPARE = $(MODULES)/compare -LIBSYS = libsystem.a INCLUDES = -I. -CFLAGS = $(INCLUDES) -O +CFLAGS = $(INCLUDES) -O $(COPT) AR = ar -OBJ = access.o break.o chmode.o close.o create.o filesize.o \ - modtime.o lock.o open.o read.o remove.o stop.o \ - system.o time.o unlock.o write.o seek.o rename.o +SUF = o +LIBSUF = a + +LIBSYS = libsystem.$(LIBSUF) +OBJ = access.$(SUF) break.$(SUF) chmode.$(SUF) close.$(SUF) create.$(SUF) \ + filesize.$(SUF) modtime.$(SUF) lock.$(SUF) open.$(SUF) read.$(SUF) \ + remove.$(SUF) stop.$(SUF) system.$(SUF) time.$(SUF) unlock.$(SUF) \ + write.$(SUF) seek.$(SUF) rename.$(SUF) CSRC = access.c break.c chmode.c close.c create.c filesize.c \ - modtime.c lock.c open.c read.c remove.c stop.c \ - system.c time.c unlock.c write.c seek.c rename.c + modtime.c lock.c open.c read.c remove.c stop.c \ + system.c time.c unlock.c write.c seek.c rename.c SRC = Makefile system.h $(CSRC) +.SUFFIXES: .$(SUF) +.c.$(SUF): + $(CC) -c $(CFLAGS) $*.c + all: $(LIBSYS) $(LIBSYS): $(OBJ) @@ -27,12 +35,12 @@ install: all $(INSTALL) h/system.h cmp: all - $(COMPARE) lib/$(LIBSYS) - $(COMPARE) man/system.3 - $(COMPARE) h/system.h + -$(COMPARE) lib/$(LIBSYS) + -$(COMPARE) man/system.3 + -$(COMPARE) h/system.h clean: - rm -f *.[oa] + rm -f *.$(SUF) *.$(LIBSUF) pr: @pr $(SRC) @@ -44,12 +52,12 @@ lintlib: lint $(INCLUDES) -Csystem $(CSRC) mv llib-lsystem.ln $(MODULES)/lib -access.o: system.h -break.o: system.h -close.o: system.h -create.o: system.h -open.o: system.h -read.o: system.h -stop.o: system.h -system.o: system.h -write.o: system.h +access.$(SUF): system.h +break.$(SUF): system.h +close.$(SUF): system.h +create.$(SUF): system.h +open.$(SUF): system.h +read.$(SUF): system.h +stop.$(SUF): system.h +system.$(SUF): system.h +write.$(SUF): system.h diff --git a/util/data/Makefile b/util/data/Makefile index 3b67c4199..48a198bb8 100644 --- a/util/data/Makefile +++ b/util/data/Makefile @@ -2,27 +2,33 @@ d=../.. h=$d/h l=$d/lib -ar=ar +AR=ar +SUF=o +LIBSUF=ma -OBJ=em_mnem.o em_pseu.o em_flag.o em_ptyp.o +OBJ=em_mnem.$(SUF) em_pseu.$(SUF) em_flag.$(SUF) em_ptyp.$(SUF) -DATA_PATH=em_data.a +DATA_PATH=em_data.$(LIBSUF) -CFLAGS=-O -I$h +CFLAGS=-O -I$h $(COPT) + +.SUFFIXES: .$(SUF) +.c.$(SUF): + $(CC) -c $(CFLAGS) $*.c $(DATA_PATH): $(OBJ) - $(ar) rv $(DATA_PATH) $(OBJ) + $(AR) rv $(DATA_PATH) $(OBJ) -sh -c 'ranlib $(DATA_PATH)' -em_flag.o: $h/em_flag.h +em_flag.$(SUF): $h/em_flag.h -em_ptyp.o: $h/em_flag.h $h/em_ptyp.h +em_ptyp.$(SUF): $h/em_flag.h $h/em_ptyp.h install : $(DATA_PATH) -cmp -s $(DATA_PATH) $l/$(DATA_PATH) || { cp $(DATA_PATH) $l/$(DATA_PATH) ; sh -c 'ranlib $l/$(DATA_PATH)' ; } cmp : $(DATA_PATH) - cmp $(DATA_PATH) $l/$(DATA_PATH) + -cmp $(DATA_PATH) $l/$(DATA_PATH) clean: rm -f $(OBJ) $(DATA_PATH) *.old