1999-08-28 01:08:13 +00:00
|
|
|
# $FreeBSD$
|
1994-08-24 13:10:34 +00:00
|
|
|
#
|
|
|
|
# By default, flex will be configured to generate 8-bit scanners only if the
|
|
|
|
# -8 flag is given. If you want it to always generate 8-bit scanners, add
|
|
|
|
# "-DDEFAULT_CSIZE=256" to CFLAGS. Note that doing so will double the size
|
|
|
|
# of all uncompressed scanners.
|
|
|
|
#
|
|
|
|
# Bootstrapping of lex is handled automatically.
|
1994-08-27 09:52:32 +00:00
|
|
|
# Also note that flex.skel no longer gets installed.
|
1994-08-24 13:10:34 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
PROG= lex
|
1996-01-08 09:17:39 +00:00
|
|
|
LINKS+= ${BINDIR}/lex ${BINDIR}/lex++
|
|
|
|
LINKS+= ${BINDIR}/lex ${BINDIR}/flex
|
|
|
|
LINKS+= ${BINDIR}/lex ${BINDIR}/flex++
|
1994-08-24 13:10:34 +00:00
|
|
|
|
2020-06-18 18:09:16 +00:00
|
|
|
FLEXDIR= ${SRCTOP}/contrib/flex/src
|
2013-05-21 19:32:35 +00:00
|
|
|
|
|
|
|
.PATH: ${FLEXDIR}
|
|
|
|
|
|
|
|
SRCS= buf.c ccl.c dfa.c ecs.c filter.c gen.c main.c misc.c \
|
|
|
|
nfa.c options.c parse.y regex.c scan.c scanflags.c \
|
|
|
|
scanopt.c skel.c sym.c tables.c tables_shared.c \
|
|
|
|
tblcmp.c yylex.c
|
1994-08-24 13:10:34 +00:00
|
|
|
LFLAGS+= -is
|
2013-05-21 19:32:35 +00:00
|
|
|
CFLAGS+= -I. -I${.CURDIR} -I${FLEXDIR} -DHAVE_CONFIG_H
|
2002-05-12 16:01:00 +00:00
|
|
|
INCS= FlexLexer.h
|
2004-07-30 00:08:15 +00:00
|
|
|
INCSDIR= ${INCLUDEDIR}
|
1996-01-08 09:17:39 +00:00
|
|
|
MLINKS+= lex.1 flex.1
|
|
|
|
MLINKS+= lex.1 flex++.1
|
|
|
|
MLINKS+= lex.1 lex++.1
|
1994-08-24 13:10:34 +00:00
|
|
|
|
2013-05-21 19:32:35 +00:00
|
|
|
WARNS?= 3
|
2010-01-02 10:27:05 +00:00
|
|
|
|
2020-01-31 19:06:49 +00:00
|
|
|
NO_WMISLEADING_INDENTATION=
|
|
|
|
|
1999-11-20 15:41:43 +00:00
|
|
|
CLEANFILES= scan.c skel.c
|
2013-05-21 19:32:35 +00:00
|
|
|
GENFILES= parse.c parse.h scan.c skel.c
|
1994-08-24 13:10:34 +00:00
|
|
|
|
|
|
|
SUBDIR= lib
|
|
|
|
|
2013-05-21 19:32:35 +00:00
|
|
|
FLEX_VERSION= `awk -f ${.CURDIR}/version.awk ${.CURDIR}/config.h`
|
|
|
|
|
|
|
|
skel.c: config.h mkskel.sh flex.skl version.awk
|
2020-06-18 18:09:16 +00:00
|
|
|
sh ${FLEXDIR}/mkskel.sh ${FLEXDIR} m4 ${FLEX_VERSION} > ${.TARGET}
|
1999-11-20 15:41:43 +00:00
|
|
|
|
2013-05-21 19:32:35 +00:00
|
|
|
bootstrap: ${GENFILES:S/^/init/g}
|
|
|
|
.for _f in ${GENFILES}
|
|
|
|
@diff -I '^#line ' -I '\$$FreeBS[D]: .*\$$' -q \
|
|
|
|
${.CURDIR}/init${_f} ${_f} 2> /dev/null || { \
|
|
|
|
echo "Bootstrapping ${_f}" ; \
|
2015-01-16 21:39:08 +00:00
|
|
|
${CP} ${.CURDIR}/init${_f} ${_f} ; \
|
1996-09-19 05:21:07 +00:00
|
|
|
}
|
2013-05-21 19:32:35 +00:00
|
|
|
.endfor
|
1996-06-19 20:48:06 +00:00
|
|
|
|
1994-08-24 13:10:34 +00:00
|
|
|
test: check
|
2013-05-21 19:32:35 +00:00
|
|
|
check: ${PROG}
|
|
|
|
./${PROG} ${LFLAGS} -t ${COMPRESSION} ${FLEXDIR}/scan.l | \
|
|
|
|
diff -I '^#line ' -I '\$$FreeBS[D]: .*\$$' ${.CURDIR}/initscan.c -
|
1994-08-24 13:10:34 +00:00
|
|
|
@echo "Check successful"
|
|
|
|
|
|
|
|
.include <bsd.prog.mk>
|