1 # $FreeBSD: src/usr.bin/lex/Makefile,v 1.15.2.3 2002/07/22 14:21:52 ru Exp $
2 # $DragonFly: src/usr.bin/lex/Makefile,v 1.3 2004/04/04 21:31:14 joerg Exp $
4 # By default, flex will be configured to generate 8-bit scanners only if the
5 # -8 flag is given. If you want it to always generate 8-bit scanners, add
6 # "-DDEFAULT_CSIZE=256" to CFLAGS. Note that doing so will double the size
7 # of all uncompressed scanners.
9 # Bootstrapping of lex is handled automatically.
10 # Also note that flex.skel no longer gets installed.
14 LINKS+= ${BINDIR}/lex ${BINDIR}/lex++
15 LINKS+= ${BINDIR}/lex ${BINDIR}/flex
16 LINKS+= ${BINDIR}/lex ${BINDIR}/flex++
18 SRCS= scan.c ccl.c dfa.c ecs.c gen.c main.c misc.c nfa.c parse.y \
19 skel.c sym.c tblcmp.c yylex.c
21 CFLAGS+= -I. -I${.CURDIR}
22 INCSGROUPS= gcc2_INCS gcc3_INCS
23 gcc2_INCS= FlexLexer.h
24 gcc2_INCSDIR= ${INCLUDEDIR}/c++/2.95
25 gcc3_INCS= FlexLexer.h
26 gcc3_INCSDIR= ${INCLUDEDIR}/c++/3.3
28 MLINKS+= lex.1 flex++.1
29 MLINKS+= lex.1 lex++.1
31 CLEANFILES= scan.c skel.c
35 skel.c: mkskel.sh flex.skl
36 sh ${.CURDIR}/mkskel.sh ${.CURDIR}/flex.skl > skel.c
39 @cmp -s ${.CURDIR}/initscan.c scan.c || { \
40 echo "Bootstrapping flex" ; \
42 cp -f ${.CURDIR}/initscan.c scan.c ; \
47 ./$(PROG) $(LFLAGS) -t $(COMPRESSION) $(.CURDIR)/scan.l \
48 | sed s,\"$(.CURDIR)/scan.l",\"scan.l", \
49 | diff $(.CURDIR)/initscan.c -
50 @echo "Check successful"
52 .include <bsd.prog.mk>