1 # $Id: proto.make,v 1.7 1994/06/24 10:57:22 ceriel Exp $
3 #PARAMS do not remove this line!
5 SRC_DIR = $(SRC_HOME)/util/flex
7 # make file for "flex" tool
9 # Porting considerations:
11 # For System V Unix machines, add -DUSG to CFLAGS (if it's not
12 # automatically defined)
13 # For Vax/VMS, add "-DVMS -DUSG" to CFLAGS.
14 # For MS-DOS, add "-DMS_DOS -DUSG" to CFLAGS. Create \tmp if not present.
15 # You will also want to rename flex.skel to something with a three
16 # character extension, change SKELETON_FILE below appropriately,
17 # See MSDOS.notes for more info.
18 # For Amiga, add "-DAMIGA -DUSG" to CFLAGS.
19 # For SCO Unix, add "-DSCO_UNIX" to CFLAGS.
21 # For C compilers which don't know about "void", add -Dvoid=int to CFLAGS.
23 # If your C compiler is ANSI standard but does not include the <stdlib.h>
24 # header file (some installations of gcc have this problem), then add
25 # -DDONT_HAVE_STDLIB_H to CFLAGS.
27 # By default, flex will be configured to generate 8-bit scanners only
28 # if the -8 flag is given. If you want it to always generate 8-bit
29 # scanners, add "-DDEFAULT_CSIZE=256" to CFLAGS. Note that doing
30 # so will double the size of all uncompressed scanners.
32 # If on your system you have trouble building flex due to 8-bit
33 # character problems, remove the -8 from FLEX_FLAGS and the
34 # "#define FLEX_8_BIT_CHARS" from the beginning of flexdef.h.
37 # the first time around use "make first_flex"
40 # Installation targeting. Files will be installed under the tree rooted
41 # at DESTDIR. User commands will be installed in BINDIR, library files
42 # in LIBDIR (which will be created if necessary), auxiliary files in
45 BINDIR = $(TARGET_HOME)/bin
46 AUXDIR = $(TARGET_HOME)/lib/flex
50 SKELETON_FILE = \"$(AUXDIR)/flex.skel\"
51 SKELFLAGS = -DDEFAULT_SKELETON_FILE=$(SKELETON_FILE)
52 INCLUDES = -I$(SRC_DIR) -I.
53 CFLAGS = $(COPTIONS) -DACK_MOD $(INCLUDES)
54 LDFLAGS = $(LDOPTIONS)
57 FLEX_FLAGS = -ist8 -Sflex.skel
58 # which "flex" to use to generate scan.c from scan.l
93 $(CC) -o flex $(LDFLAGS) $(FLEXOBJS)
96 cp $(SRC_DIR)/initscan.c scan.c
100 parse.h parse.c : $(SRC_DIR)/parse.y
101 yacc -d $(SRC_DIR)/parse.y
105 scan.c : $(SRC_DIR)/scan.l
106 $(FLEX) $(FLEX_FLAGS) $(COMPRESSION) $(SRC_DIR)/scan.l >scan.c
108 scan.$(SUF) : scan.c parse.h $(SRC_DIR)/flexdef.h
109 $(CC) $(CFLAGS) -c scan.c
111 main.$(SUF) : $(SRC_DIR)/main.c $(SRC_DIR)/flexdef.h
113 $(CC) $(CFLAGS) -c $(SKELFLAGS) $(SRC_DIR)/main.c
115 ccl.$(SUF) : $(SRC_DIR)/ccl.c $(SRC_DIR)/flexdef.h
116 $(CC) $(CFLAGS) -c $(SRC_DIR)/ccl.c
117 dfa.$(SUF) : $(SRC_DIR)/dfa.c $(SRC_DIR)/flexdef.h
118 $(CC) $(CFLAGS) -c $(SRC_DIR)/dfa.c
119 ecs.$(SUF) : $(SRC_DIR)/ecs.c $(SRC_DIR)/flexdef.h
120 $(CC) $(CFLAGS) -c $(SRC_DIR)/ecs.c
121 gen.$(SUF) : $(SRC_DIR)/gen.c $(SRC_DIR)/flexdef.h
122 $(CC) $(CFLAGS) -c $(SRC_DIR)/gen.c
123 misc.$(SUF) : $(SRC_DIR)/misc.c $(SRC_DIR)/flexdef.h
124 $(CC) $(CFLAGS) -c $(SRC_DIR)/misc.c
125 nfa.$(SUF) : $(SRC_DIR)/nfa.c $(SRC_DIR)/flexdef.h
126 $(CC) $(CFLAGS) -c $(SRC_DIR)/nfa.c
127 parse.$(SUF) : parse.c $(SRC_DIR)/flexdef.h
128 $(CC) $(CFLAGS) -c parse.c
129 sym.$(SUF) : $(SRC_DIR)/sym.c $(SRC_DIR)/flexdef.h
130 $(CC) $(CFLAGS) -c $(SRC_DIR)/sym.c
131 tblcmp.$(SUF) : $(SRC_DIR)/tblcmp.c $(SRC_DIR)/flexdef.h
132 $(CC) $(CFLAGS) -c $(SRC_DIR)/tblcmp.c
133 yylex.$(SUF) : $(SRC_DIR)/yylex.c $(SRC_DIR)/flexdef.h
134 $(CC) $(CFLAGS) -c $(SRC_DIR)/yylex.c
136 LINTFLAGS = $(LINTOPTIONS) $(INCLUDES)
137 lint : $(FLEX_C_SOURCES)
138 $(LINT) $(LINTFLAGS) $(FLEX_C_SOURCES)
140 firstinstall: first_flex $(SRC_DIR)/flex.skel
142 cp flex $(BINDIR)/flex
143 if [ $(DO_MACHINE_INDEP) = y ] ; \
144 then cp $(SRC_DIR)/flex.skel $(AUXDIR)/flex.skel ; \
145 mk_manpage $(SRC_DIR)/flex.1 $(TARGET_HOME) ; \
146 mk_manpage $(SRC_DIR)/flexdoc.1 $(TARGET_HOME) ; \
149 install: flex $(SRC_DIR)/flex.skel
151 cp flex $(BINDIR)/flex
152 if [ $(DO_MACHINE_INDEP) = y ] ; \
153 then cp $(SRC_DIR)/flex.skel $(AUXDIR)/flex.skel ; \
154 mk_manpage $(SRC_DIR)/flex.1 $(TARGET_HOME) ; \
155 mk_manpage $(SRC_DIR)/flexdoc.1 $(TARGET_HOME) ; \
158 cmp: flex $(SRC_DIR)/flex.skel
159 -cmp flex $(BINDIR)/flex
160 -cmp $(SRC_DIR)/flex.skel $(AUXDIR)/flex.skel
163 rm -f core errs flex *.$(SUF) parse.c *.lint parse.h tags scan.c
166 ctags $(FLEX_C_SOURCES)
169 ./flex $(FLEX_FLAGS) $(COMPRESSION) scan.l | diff scan.c -
172 rm -f scan.c ; $(MAKE) COMPRESSION="-C" test
173 rm -f scan.c ; $(MAKE) COMPRESSION="-Ce" test
174 rm -f scan.c ; $(MAKE) COMPRESSION="-Cm" test
175 rm -f scan.c ; $(MAKE) COMPRESSION="-Cfe" test
176 rm -f scan.c ; $(MAKE) COMPRESSION="-CFe" test
177 rm -f scan.c ; $(MAKE) COMPRESSION="-Cf" test
178 rm -f scan.c ; $(MAKE) COMPRESSION="-CF" test
179 rm -f scan.c ; $(MAKE)