1996-05-07 23:19:49 +00:00
|
|
|
# $Id: Makefile,v 1.3 1996/01/08 09:17:39 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
|
|
|
|
|
|
|
SRCS= ccl.c dfa.c ecs.c gen.c main.c misc.c nfa.c parse.y \
|
|
|
|
skel.c sym.c tblcmp.c yylex.c
|
|
|
|
OBJS+= scan.o
|
|
|
|
LFLAGS+= -is
|
|
|
|
CFLAGS+= -I. -I${.CURDIR}
|
1994-08-27 09:52:32 +00:00
|
|
|
MAN1= lex.1 lexdoc.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
|
|
|
|
|
|
|
|
|
|
|
SUBDIR= lib
|
|
|
|
|
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
|
|
|
.depend: parse.h
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
.if exists(/usr/bin/lex)
|
|
|
|
scan.o: parse.c
|
|
|
|
.else
|
|
|
|
# We must bootstrap
|
|
|
|
scan.o: scan.c parse.h
|
|
|
|
|
|
|
|
scan.c:
|
|
|
|
@echo "Bootstrapping flex"
|
|
|
|
@rm -f scan.c
|
|
|
|
@cp -pf ${.CURDIR}/initscan.c scan.c
|
|
|
|
.endif
|
|
|
|
|
|
|
|
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>
|