1996-10-29 05:08:21 +00:00
|
|
|
# $Id: Makefile,v 1.7 1996/09/19 05:21:07 peter Exp $
|
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
|
|
|
|
1996-10-29 05:08:21 +00:00
|
|
|
SRCS= scan.c ccl.c dfa.c ecs.c gen.c main.c misc.c nfa.c parse.c \
|
1994-08-24 13:10:34 +00:00
|
|
|
skel.c sym.c tblcmp.c yylex.c
|
|
|
|
LFLAGS+= -is
|
|
|
|
CFLAGS+= -I. -I${.CURDIR}
|
1996-06-19 20:48:06 +00:00
|
|
|
MAN1= lex.1
|
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
|
|
|
|
1994-08-27 09:52:32 +00:00
|
|
|
CLEANFILES+= parse.c parse.h scan.c y.tab.h y.tab.c
|
1994-08-24 13:10:34 +00:00
|
|
|
|
1996-08-07 13:25:59 +00:00
|
|
|
.if !defined(NOLIB)
|
1994-08-24 13:10:34 +00:00
|
|
|
SUBDIR= lib
|
1996-08-07 13:25:59 +00:00
|
|
|
.endif
|
1994-08-24 13:10:34 +00:00
|
|
|
|
1996-01-08 09:17:39 +00:00
|
|
|
beforeinstall:
|
|
|
|
${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 644 \
|
|
|
|
${.CURDIR}/FlexLexer.h ${DESTDIR}/usr/include/g++
|
|
|
|
|
1994-08-24 13:10:34 +00:00
|
|
|
|
|
|
|
parse.c parse.h: parse.y
|
|
|
|
$(YACC) -d $(.CURDIR)/parse.y
|
1996-05-07 23:19:49 +00:00
|
|
|
mv -f y.tab.c parse.c
|
|
|
|
mv -f y.tab.h parse.h
|
1994-08-24 13:10:34 +00:00
|
|
|
|
1996-06-19 20:48:06 +00:00
|
|
|
bootstrap: initscan.c
|
1996-09-19 05:21:07 +00:00
|
|
|
@cmp -s ${.CURDIR}/initscan.c scan.c || { \
|
|
|
|
echo "Bootstrapping flex" ; \
|
|
|
|
rm -f scan.c ; \
|
|
|
|
cp -f ${.CURDIR}/initscan.c scan.c ; \
|
|
|
|
}
|
1996-06-19 20:48:06 +00:00
|
|
|
|
1996-10-29 05:08:21 +00:00
|
|
|
beforedepend: parse.h
|
|
|
|
scan.o: parse.h
|
1994-08-24 13:10:34 +00:00
|
|
|
|
|
|
|
test: check
|
|
|
|
check: $(PROG)
|
|
|
|
./$(PROG) $(LFLAGS) -t $(COMPRESSION) $(.CURDIR)/scan.l \
|
|
|
|
| sed s,\"$(.CURDIR)/scan.l",\"scan.l", \
|
|
|
|
| diff $(.CURDIR)/initscan.c -
|
|
|
|
@echo "Check successful"
|
|
|
|
|
|
|
|
.include <bsd.prog.mk>
|