Correct C++ header handling for gcc2 and lex.
[dragonfly.git] / usr.bin / lex / Makefile
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 $
3 #
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.
8 #
9 # Bootstrapping of lex is handled automatically.
10 # Also note that flex.skel no longer gets installed.
11 #
12
13 PROG=           lex
14 LINKS+= ${BINDIR}/lex ${BINDIR}/lex++
15 LINKS+= ${BINDIR}/lex ${BINDIR}/flex
16 LINKS+= ${BINDIR}/lex ${BINDIR}/flex++
17
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
20 LFLAGS+=        -is
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
27 MLINKS+=        lex.1 flex.1
28 MLINKS+=        lex.1 flex++.1
29 MLINKS+=        lex.1 lex++.1
30
31 CLEANFILES=     scan.c skel.c
32
33 SUBDIR=         lib
34
35 skel.c: mkskel.sh flex.skl
36         sh ${.CURDIR}/mkskel.sh ${.CURDIR}/flex.skl > skel.c
37
38 bootstrap: initscan.c
39         @cmp -s ${.CURDIR}/initscan.c scan.c || { \
40                 echo "Bootstrapping flex" ; \
41                 rm -f scan.c ; \
42                 cp -f ${.CURDIR}/initscan.c scan.c ; \
43         }
44
45 test: check
46 check: $(PROG)
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"
51
52 .include <bsd.prog.mk>