Makefile revision 132862
150477Speter# $FreeBSD: head/usr.bin/lex/Makefile 132862 2004-07-30 00:08:15Z kan $
22258Scsgr#
32258Scsgr# By default, flex will be configured to generate 8-bit scanners only if the
42258Scsgr# -8 flag is given.  If you want it to always generate 8-bit scanners, add
52258Scsgr# "-DDEFAULT_CSIZE=256" to CFLAGS.  Note that doing so will double the size
62258Scsgr# of all uncompressed scanners.
72258Scsgr#
82258Scsgr# Bootstrapping of lex is handled automatically.
92307Scsgr# Also note that flex.skel no longer gets installed.
102258Scsgr#
112258Scsgr
122258ScsgrPROG=		lex
1313343SpeterLINKS+=	${BINDIR}/lex ${BINDIR}/lex++
1413343SpeterLINKS+=	${BINDIR}/lex ${BINDIR}/flex
1513343SpeterLINKS+=	${BINDIR}/lex ${BINDIR}/flex++
162258Scsgr
1735703SbdeSRCS=		scan.c ccl.c dfa.c ecs.c gen.c main.c misc.c nfa.c parse.y \
182258Scsgr		skel.c sym.c tblcmp.c yylex.c
192258ScsgrLFLAGS+=	-is
202258ScsgrCFLAGS+=	-I. -I${.CURDIR}
2196462SruINCS=		FlexLexer.h
22132862SkanINCSDIR=	${INCLUDEDIR}
2313343SpeterMLINKS+=	lex.1 flex.1
2413343SpeterMLINKS+=	lex.1 flex++.1
2513343SpeterMLINKS+=	lex.1 lex++.1
262258Scsgr
2753462SdtCLEANFILES=	scan.c skel.c
282258Scsgr
292258ScsgrSUBDIR=		lib
302258Scsgr
3153462Sdtskel.c: mkskel.sh flex.skl
3253462Sdt	sh ${.CURDIR}/mkskel.sh ${.CURDIR}/flex.skl > skel.c
3353462Sdt
3416519Snatebootstrap: initscan.c
3518372Speter	@cmp -s ${.CURDIR}/initscan.c scan.c || { \
3618372Speter		echo "Bootstrapping flex" ; \
3718372Speter		rm -f scan.c ; \
3818372Speter		cp -f ${.CURDIR}/initscan.c scan.c ; \
3918372Speter	}
402258Scsgr
412258Scsgrtest: check
422258Scsgrcheck: $(PROG)
432258Scsgr	./$(PROG) $(LFLAGS) -t $(COMPRESSION) $(.CURDIR)/scan.l \
442258Scsgr	| sed s,\"$(.CURDIR)/scan.l",\"scan.l", \
452258Scsgr	| diff $(.CURDIR)/initscan.c -
462258Scsgr	@echo "Check successful"
472258Scsgr
482258Scsgr.include <bsd.prog.mk>
49