Made easier to use other compiler

This commit is contained in:
ceriel
1989-02-16 16:33:29 +00:00
parent f7790b0e8e
commit 9751e398e3
14 changed files with 279 additions and 204 deletions

View File

@@ -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