Initial import from FreeBSD RELENG_4:
[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 #
3 # By default, flex will be configured to generate 8-bit scanners only if the
4 # -8 flag is given.  If you want it to always generate 8-bit scanners, add
5 # "-DDEFAULT_CSIZE=256" to CFLAGS.  Note that doing so will double the size
6 # of all uncompressed scanners.
7 #
8 # Bootstrapping of lex is handled automatically.
9 # Also note that flex.skel no longer gets installed.
10 #
11
12 PROG=           lex
13 LINKS+= ${BINDIR}/lex ${BINDIR}/lex++
14 LINKS+= ${BINDIR}/lex ${BINDIR}/flex
15 LINKS+= ${BINDIR}/lex ${BINDIR}/flex++
16
17 SRCS=           scan.c ccl.c dfa.c ecs.c gen.c main.c misc.c nfa.c parse.y \
18                 skel.c sym.c tblcmp.c yylex.c
19 LFLAGS+=        -is
20 CFLAGS+=        -I. -I${.CURDIR}
21 INCS=           FlexLexer.h
22 INCSDIR=        ${INCLUDEDIR}/g++
23 MLINKS+=        lex.1 flex.1
24 MLINKS+=        lex.1 flex++.1
25 MLINKS+=        lex.1 lex++.1
26
27 CLEANFILES=     scan.c skel.c
28
29 SUBDIR=         lib
30
31 skel.c: mkskel.sh flex.skl
32         sh ${.CURDIR}/mkskel.sh ${.CURDIR}/flex.skl > skel.c
33
34 bootstrap: initscan.c
35         @cmp -s ${.CURDIR}/initscan.c scan.c || { \
36                 echo "Bootstrapping flex" ; \
37                 rm -f scan.c ; \
38                 cp -f ${.CURDIR}/initscan.c scan.c ; \
39         }
40
41 test: check
42 check: $(PROG)
43         ./$(PROG) $(LFLAGS) -t $(COMPRESSION) $(.CURDIR)/scan.l \
44         | sed s,\"$(.CURDIR)/scan.l",\"scan.l", \
45         | diff $(.CURDIR)/initscan.c -
46         @echo "Check successful"
47
48 .include <bsd.prog.mk>