- Factor out if_purgeaddrs_nolink(), which frees all non-link ifaddrs no
[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.6 2007/08/27 16:50:55 pavalos 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 INCS=           FlexLexer.h
23 INCSDIR=        ${INCLUDEDIR}/c++
24 MLINKS+=        lex.1 flex.1
25 MLINKS+=        lex.1 flex++.1
26 MLINKS+=        lex.1 lex++.1
27 WARNS?= 1
28
29 CLEANFILES=     scan.c skel.c
30
31 SUBDIR=         lib
32
33 skel.c: mkskel.sh flex.skl
34         sh ${.CURDIR}/mkskel.sh ${.CURDIR}/flex.skl > skel.c
35
36 bootstrap: initscan.c
37         @cmp -s ${.CURDIR}/initscan.c scan.c || { \
38                 echo "Bootstrapping flex" ; \
39                 rm -f scan.c ; \
40                 cp -f ${.CURDIR}/initscan.c scan.c ; \
41         }
42
43 test: check
44 check: $(PROG)
45         ./$(PROG) $(LFLAGS) -t $(COMPRESSION) $(.CURDIR)/scan.l \
46         | sed s,\"$(.CURDIR)/scan.l",\"scan.l", \
47         | diff $(.CURDIR)/initscan.c -
48         @echo "Check successful"
49
50 .include <bsd.prog.mk>