made easier to compile with different compiler

This commit is contained in:
ceriel 1989-02-20 15:29:10 +00:00
parent c096cc6522
commit 8aee01de95

View file

@ -4,8 +4,6 @@ INSTALL = $(EMHOME)/modules/install
COMPARE = $(EMHOME)/modules/compare COMPARE = $(EMHOME)/modules/compare
LINT = lint LINT = lint
BINDIR = $(EMHOME)/lib BINDIR = $(EMHOME)/lib
LIBOPT = libemopt.a
LIBCEOPT = libCEopt.a
# set HOWMUCH to head -20 to limit number of patterns used # set HOWMUCH to head -20 to limit number of patterns used
#HOWMUCH = head -20 #HOWMUCH = head -20
@ -20,26 +18,36 @@ PREFLAGS = $(INCLDIR) -DPRIVATE=static# -DDEBUG
#PREFLAGS = $(PREFLAGS) -DSTATS #PREFLAGS = $(PREFLAGS) -DSTATS
PROFFLAG = -O PROFFLAG = -O
CFLAGS = $(PREFLAGS) $(PROFFLAG) CFLAGS = $(PREFLAGS) $(PROFFLAG) $(COPT)
LINTFLAGS = $(PREFLAGS) -DNORCSID LINTFLAGS = $(PREFLAGS) -DNORCSID
LLOPT = LLOPT =
CMD = '$(CC) -c $(CFLAGS)' CMD = '$(CC) -c $(CFLAGS)'
AR = ar
SUF = o
LIBSUF = a
LIBOPT = libemopt.$(LIBSUF)
LIBCEOPT = libCEopt.$(LIBSUF)
.SUFFIXES: .d .r .SUFFIXES: .d .r
.r.d: ; CMD=$(CMD); export CMD; awk -f makefuns.awk $*.r | sh -x .r.d: ; CMD=$(CMD); export CMD; awk -f makefuns.awk $*.r | sh -x
touch $@ touch $@
.SUFFIXES: .$(SUF)
.c.$(SUF):
$(CC) -c $(CFLAGS) $*.c
CSRC = main.c nopt.c mkstrct.c aux.c outputdfa.c outcalls.c\ CSRC = main.c nopt.c mkstrct.c aux.c outputdfa.c outcalls.c\
findworst.c initlex.c findworst.c initlex.c
SRCS = Makefile nopt.h parser.h parser.g syntax.l pseudo.r\ SRCS = Makefile nopt.h parser.h parser.g syntax.l pseudo.r\
patterns $(CSRC) patterns $(CSRC)
NOFILES = nopt.o mkstrct.o dfa.o trans.o aux.o NOFILES = nopt.$(SUF) mkstrct.$(SUF) dfa.$(SUF) trans.$(SUF) aux.$(SUF)
POFILES = parser.o syntax.o outputdfa.o outcalls.o findworst.o\ POFILES = parser.$(SUF) syntax.$(SUF) outputdfa.$(SUF) outcalls.$(SUF) findworst.$(SUF)\
initlex.o Lpars.o initlex.$(SUF) Lpars.$(SUF)
GENFILES = Lpars.h Lpars.c parserdummy parser.c syntax.c dfadummy\ GENFILES = Lpars.h Lpars.c parserdummy parser.c syntax.c dfadummy\
dfa.c dfa.c.new trans.c trans.c.new\ dfa.c dfa.c.new trans.c trans.c.new\
@ -54,8 +62,8 @@ install: all
cp em_nopt $(BINDIR)/em_nopt cp em_nopt $(BINDIR)/em_nopt
cmp: all cmp: all
$(COMPARE) lib/$(LIBOPT) -$(COMPARE) lib/$(LIBOPT)
$(COMPARE) man/em_opt.3 -$(COMPARE) man/em_opt.3
-cmp em_nopt $(BINDIR)/em_nopt -cmp em_nopt $(BINDIR)/em_nopt
pr: pr:
@ -67,24 +75,24 @@ opr:
lint: lintparser lintnopt lint: lintparser lintnopt
clean: clean:
rm -f O_*.o rm -f O_*.$(SUF)
rm -f O_*.c rm -f O_*.c
rm -f $(NOFILES) main.o mkstrct.o $(POFILES) rm -f $(NOFILES) main.$(SUF) mkstrct.$(SUF) $(POFILES)
rm -f $(GENFILES) parser em_nopt $(LIBOPT) rm -f $(GENFILES) parser em_nopt $(LIBOPT)
# How to build stand alone version of the optimizer # How to build stand alone version of the optimizer
NOPTLIB = $(EMHOME)/modules/lib/libread_emk.a\ NOPTLIB = $(EMHOME)/modules/lib/libread_emk.$(LIBSUF)\
$(EMHOME)/modules/lib/libemk.a\ $(EMHOME)/modules/lib/libemk.$(LIBSUF)\
$(EMHOME)/modules/lib/liballoc.a\ $(EMHOME)/modules/lib/liballoc.$(LIBSUF)\
$(EMHOME)/modules/lib/malloc.o\ $(EMHOME)/modules/lib/malloc.$(SUF)\
$(EMHOME)/modules/lib/libprint.a\ $(EMHOME)/modules/lib/libprint.$(LIBSUF)\
$(EMHOME)/modules/lib/libstring.a\ $(EMHOME)/modules/lib/libstring.$(LIBSUF)\
$(EMHOME)/modules/lib/libsystem.a\ $(EMHOME)/modules/lib/libsystem.$(LIBSUF)\
$(EMHOME)/lib/em_data.a $(EMHOME)/lib/em_data.$(LIBSUF)
em_nopt: dfadummy main.o $(NOFILES) em_nopt: dfadummy main.$(SUF) $(NOFILES)
$(CC) -o em_nopt main.o $(NOFILES) $(NOPTLIB) $(CC) -o em_nopt main.$(SUF) $(NOFILES) $(NOPTLIB)
OLINT = main.c mkstrct.c nopt.c aux.c dfa.c trans.c OLINT = main.c mkstrct.c nopt.c aux.c dfa.c trans.c
@ -100,9 +108,9 @@ lintnopt: dfadummy $(OLINT)
# How to build the library version of the optimizer # How to build the library version of the optimizer
$(LIBOPT): dfadummy $(NOFILES) mkstrct.o pseudo.d incalls.d $(LIBOPT): dfadummy $(NOFILES) mkstrct.$(SUF) pseudo.d incalls.d
rm -f $(LIBOPT) rm -f $(LIBOPT)
ar rc $(LIBOPT) O_*.o $(NOFILES) mkstrct.o ar rc $(LIBOPT) O_*.$(SUF) $(NOFILES) mkstrct.$(SUF)
-sh -c 'ranlib $(LIBOPT)' -sh -c 'ranlib $(LIBOPT)'
$(LIBCEOPT): $(LIBCEOPT):
@ -127,10 +135,10 @@ lintlib: dfadummy $(LLINT)
# How to build program to parse patterns table and build c files. # How to build program to parse patterns table and build c files.
PARSERLIB = $(EMHOME)/lib/em_data.a\ PARSERLIB = $(EMHOME)/lib/em_data.$(LIBSUF)\
$(EMHOME)/modules/lib/liballoc.a\ $(EMHOME)/modules/lib/liballoc.$(LIBSUF)\
$(EMHOME)/modules/lib/libstring.a\ $(EMHOME)/modules/lib/libstring.$(LIBSUF)\
$(EMHOME)/modules/lib/libsystem.a $(EMHOME)/modules/lib/libsystem.$(LIBSUF)
parser: parserdummy $(POFILES) $(PARSERLIB) parser: parserdummy $(POFILES) $(PARSERLIB)
$(CC) -o parser $(LDFLAGS) $(POFILES) $(PARSERLIB) $(LEXLIB) $(CC) -o parser $(LDFLAGS) $(POFILES) $(PARSERLIB) $(LEXLIB)
@ -151,19 +159,19 @@ lintparser: parserdummy $(PLINT)
# Dependancies # Dependancies
main.o: nopt.h main.$(SUF): nopt.h
nopt.o: nopt.h nopt.$(SUF): nopt.h
mkstrct.o: nopt.h mkstrct.$(SUF): nopt.h
aux.o: nopt.h aux.$(SUF): nopt.h
pseudo.d: nopt.h makefuns.awk pseudo.d: nopt.h makefuns.awk
dfa.o: nopt.h dfa.$(SUF): nopt.h
trans.o: nopt.h trans.$(SUF): nopt.h
incalls.d: nopt.h makefuns.awk incalls.d: nopt.h makefuns.awk
parser.o: Lpars.h parser.h parser.$(SUF): Lpars.h parser.h
Lpars.o: Lpars.h Lpars.$(SUF): Lpars.h
syntax.o: syntax.l parser.h Lpars.h syntax.$(SUF): syntax.l parser.h Lpars.h
outputdfa.o: parser.h Lpars.h outputdfa.$(SUF): parser.h Lpars.h
outcalls.o: parser.h outcalls.$(SUF): parser.h
findworst.o: parser.h findworst.$(SUF): parser.h
initlex.o: parser.h initlex.$(SUF): parser.h