Changed to reflect location of EMHOME and conform to standard syntax.
This commit is contained in:
parent
884a281dd4
commit
bbd5b115dd
|
@ -1,64 +1,84 @@
|
|||
# $Header$
|
||||
EMHOME = ../../..
|
||||
INSTALL = $(EMHOME)/modules/install
|
||||
COMPARE = $(EMHOME)/modules/compare
|
||||
LIBOPT = libopt.a
|
||||
|
||||
# Where to find em home directory
|
||||
CSRC = nopt.c aux.c mkcalls.c pseudo.c outputdfa.c outcalls.c\
|
||||
findworst.c initlex.c
|
||||
|
||||
EMHOME=/usr/em
|
||||
MODLIB=$(EMHOME)/modules/lib
|
||||
SRCS = Makefile nopt.h parser.h parser.g syntax.l patterns $(CSRC)
|
||||
|
||||
NOFILES=nopt.o dfa.o trans.o incalls.o pseudo.o aux.o mkcalls.o
|
||||
|
||||
POFILES=parser.o syntax.o outputdfa.o outcalls.o findworst.o initlex.o Lpars.o
|
||||
|
||||
GENFILES=Lpars.h Lpars.c parserdummy parser.c syntax.c dfadummy\
|
||||
dfa.c dfa.c.save trans.c trans.c.save incalls.c incalls.c.save
|
||||
|
||||
all: $(LIBOPT)
|
||||
|
||||
install: all
|
||||
$(INSTALL) lib/$(LIBOPT)
|
||||
|
||||
cmp: all
|
||||
$(COMPARE) lib/$(LIBOPT)
|
||||
|
||||
pr:
|
||||
@pr $(SRCS)
|
||||
|
||||
opr:
|
||||
make pr | opr
|
||||
|
||||
clean:
|
||||
rm -f $(NOFILES) $(POFILES) $(GENFILES) parser core makerror
|
||||
|
||||
# set HOWMUCH to head -20 to limit number of patterns used
|
||||
#HOWMUCH=head -20
|
||||
HOWMUCH=cat
|
||||
|
||||
LEXLIB=-ll
|
||||
INCLDIR=-I$(EMHOME)/h -I$(EMHOME)/modules/h -I$(EMHOME)/modules/pkg -I../h
|
||||
INCLDIR=-I$(EMHOME)/h -I$(EMHOME)/modules/h -I$(EMHOME)/modules/pkg
|
||||
PREFLAGS=$(INCLDIR) -DPRIVATE=static
|
||||
PROFFLAG=-O
|
||||
CFLAGS=$(PREFLAGS) $(PROFFLAG)
|
||||
LLOPT=
|
||||
|
||||
GENFILES=Lpars.h Lpars.c parserdummy parser.c syntax.c dfadummy\
|
||||
dfa.c dfa.c.save trans.c trans.c.save incalls.c incalls.c.save
|
||||
$(LIBOPT): dfadummy $(NOFILES)
|
||||
rm -f $(LIBOPT)
|
||||
ar rc $(LIBOPT) $(NOFILES)
|
||||
-sh -c 'ranlib $(LIBOPT)'
|
||||
|
||||
all: libopt.a
|
||||
dfadummy: patterns parser
|
||||
-mv dfa.c dfa.c.save
|
||||
-mv trans.c trans.c.save
|
||||
-mv incalls.c incalls.c.save
|
||||
-/lib/cpp patterns | $(HOWMUCH) >/tmp/patts
|
||||
parser </tmp/patts
|
||||
-rm /tmp/patts
|
||||
-if cmp -s dfa.c dfa.c.save; then mv dfa.c.save dfa.c; else exit 0; fi
|
||||
-if cmp -s trans.c trans.c.save; then mv trans.c.save trans.c; else exit 0; fi
|
||||
-if cmp -s incalls.c incalls.c.save; then mv incalls.c.save incalls.c; else exit 0; fi
|
||||
touch dfadummy
|
||||
|
||||
NOFILES=nopt.o dfa.o trans.o incalls.o pseudo.o aux.o mkcalls.o
|
||||
# How to build program to parse patterns table and build c files.
|
||||
|
||||
libopt.a: dfadummy $(NOFILES)
|
||||
rm -f libopt.a
|
||||
ar rc libopt.a $(NOFILES)
|
||||
ranlib libopt.a
|
||||
PARSERLIB=$(EMHOME)/lib/em_data.a\
|
||||
$(EMHOME)/modules/lib/libprint.a\
|
||||
$(EMHOME)/modules/lib/liballoc.a\
|
||||
$(EMHOME)/modules/lib/libstring.a\
|
||||
$(EMHOME)/modules/lib/libsystem.a
|
||||
|
||||
dfadummy: patterns parser
|
||||
-mv dfa.c dfa.c.save
|
||||
-mv trans.c trans.c.save
|
||||
-mv incalls.c incalls.c.save
|
||||
-/lib/cpp patterns | $(HOWMUCH) >/tmp/patts
|
||||
parser </tmp/patts
|
||||
-rm /tmp/patts
|
||||
-if cmp -s dfa.c dfa.c.save; then mv dfa.c.save dfa.c; else exit 0; fi
|
||||
-if cmp -s trans.c trans.c.save; then mv trans.c.save trans.c; else exit 0; fi
|
||||
-if cmp -s incalls.c incalls.c.save; then mv incalls.c.save incalls.c; else exit 0; fi
|
||||
touch dfadummy
|
||||
parser: parserdummy $(POFILES) $(PARSERLIB)
|
||||
$(CC) -o parser $(LDFLAGS) $(POFILES) $(PARSERLIB) $(LEXLIB)
|
||||
|
||||
POFILES=parser.o syntax.o outputdfa.o outcalls.o findworst.o initlex.o Lpars.o
|
||||
parserdummy: parser.g
|
||||
LLgen $(LLOPT) parser.g
|
||||
touch parserdummy
|
||||
|
||||
PARSERLIB=$(EMHOME)/lib/em_data.a $(MODLIB)/libprint.a $(MODLIB)/liballoc.a\
|
||||
$(MODLIB)/libstring.a $(MODLIB)/libsystem.a
|
||||
|
||||
parser: parserdummy $(POFILES) $(PARSERLIB)
|
||||
$(CC) -o parser $(LDFLAGS) $(POFILES) $(PARSERLIB) $(LEXLIB)
|
||||
|
||||
GFILES=parser.g
|
||||
|
||||
parserdummy: $(GFILES)
|
||||
LLgen $(LLOPT) $(GFILES)
|
||||
touch parserdummy
|
||||
|
||||
clean:
|
||||
rm -f $(NOFILES) $(POFILES) $(GENFILES) parser
|
||||
|
||||
nopt.o: nopt.h
|
||||
dfa.o: nopt.h
|
||||
aux.o: nopt.h
|
||||
nopt.o: nopt.h
|
||||
dfa.o: nopt.h
|
||||
aux.o: nopt.h
|
||||
trans.o: nopt.h
|
||||
pseudo.o: nopt.h
|
||||
incalls.o: nopt.h
|
||||
|
|
Loading…
Reference in a new issue