2000-07-09 18:13:35 +00:00
|
|
|
# $FreeBSD$
|
|
|
|
# You probably want to take -DREDEBUG out of CFLAGS, and put something like
|
|
|
|
# -O in, *after* testing (-DREDEBUG strengthens testing by enabling a lot of
|
|
|
|
# internal assertion checking). Take -Dconst= out for an ANSI compiler.
|
|
|
|
# Do not take -DPOSIX_MISTAKE out. REGCFLAGS isn't important to you (it's
|
|
|
|
# for my use in some special contexts).
|
2000-07-10 06:10:47 +00:00
|
|
|
|
|
|
|
PATHS= ${.CURDIR}/.. ${.CURDIR}/../../locale ${.CURDIR}/../../../../include
|
|
|
|
.PATH: ${PATHS}
|
|
|
|
|
|
|
|
CFLAGS+= -DPOSIX_MISTAKE -DREDEBUG $(REGCFLAGS)
|
|
|
|
.for incpath in ${PATHS}
|
|
|
|
CFLAGS+= -I${incpath}
|
|
|
|
.endfor
|
2000-07-09 18:13:35 +00:00
|
|
|
|
|
|
|
# If you have an ANSI compiler, take -o out of MKHFLAGS. If you want
|
|
|
|
# the Berkeley __P macro, put -b in.
|
|
|
|
MKHFLAGS =
|
|
|
|
|
|
|
|
LDFLAGS =
|
|
|
|
|
|
|
|
# If you have an ANSI environment, take limits.h and stdlib.h out of
|
|
|
|
# HMISSING and take memmove out of SRCMISSING and OBJMISSING.
|
|
|
|
HMISSING =
|
|
|
|
SRCMISSING = split.c
|
|
|
|
OBJMISSING = split.o
|
2004-07-19 08:41:11 +00:00
|
|
|
H = cname.h regex2.h utils.h $(HMISSING)
|
2000-07-09 18:13:35 +00:00
|
|
|
REGSRC = regcomp.c regerror.c regexec.c regfree.c engine.c
|
|
|
|
SRC = $(REGSRC) debug.c main.c $(SRCMISSING)
|
|
|
|
|
|
|
|
# Internal stuff, should not need changing.
|
|
|
|
OBJPRODN = regcomp.o regexec.o regerror.o regfree.o
|
|
|
|
OBJS = $(OBJPRODN) debug.o main.o $(OBJMISSING)
|
|
|
|
|
|
|
|
# Stuff that matters only if you're trying to lint the package.
|
|
|
|
LINTFLAGS = -I. -Dstatic= -Dconst= -DREDEBUG
|
|
|
|
LINTC = regcomp.c regexec.c regerror.c regfree.c debug.c main.c $(SRCMISSING)
|
|
|
|
JUNKLINT =possible pointer alignment|null effect
|
|
|
|
|
|
|
|
.SUFFIXES: .ih .h
|
|
|
|
.c.ih:
|
2004-07-19 08:41:11 +00:00
|
|
|
sh mkh $(MKHFLAGS) -p $< >$@
|
2000-07-09 18:13:35 +00:00
|
|
|
|
|
|
|
default: r
|
|
|
|
|
|
|
|
re: $(OBJS)
|
|
|
|
$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) -o $@
|
|
|
|
|
|
|
|
o: $(OBJPRODN)
|
|
|
|
|
2004-07-19 08:48:17 +00:00
|
|
|
REGEXHSRC = ../regex2.h ../reg*.c
|
2000-07-09 18:13:35 +00:00
|
|
|
h: $(REGEXHSRC)
|
2004-07-19 08:41:11 +00:00
|
|
|
sh mkh $(MKHFLAGS) -i _REGEX_H_ $(REGEXHSRC) >regex.tmp
|
2000-07-09 18:13:35 +00:00
|
|
|
cmp -s regex.tmp regex.h 2>/dev/null || cp regex.tmp regex.h
|
|
|
|
rm -f regex.tmp
|
|
|
|
|
2004-07-19 08:48:17 +00:00
|
|
|
regex.h: h
|
|
|
|
|
2000-07-09 18:13:35 +00:00
|
|
|
regcomp.o regexec.o regfree.o debug.o: utils.h regex.h regex2.h
|
2004-07-19 08:41:11 +00:00
|
|
|
regcomp.o: cname.h regcomp.ih
|
2000-07-09 18:13:35 +00:00
|
|
|
regexec.o: engine.c engine.ih
|
|
|
|
regerror.o: regerror.ih
|
|
|
|
regerror.o: utils.h
|
|
|
|
debug.o: debug.ih
|
|
|
|
main.o: main.ih
|
|
|
|
|
|
|
|
r: re tests
|
|
|
|
./re <tests
|
|
|
|
./re -el <tests
|
|
|
|
./re -er <tests
|
|
|
|
|
|
|
|
ra: ./re tests
|
|
|
|
-./re <tests
|
|
|
|
-./re -el <tests
|
|
|
|
-./re -er <tests
|
|
|
|
|
|
|
|
rx: ./re tests
|
|
|
|
./re -x <tests
|
|
|
|
./re -x -el <tests
|
|
|
|
./re -x -er <tests
|
|
|
|
|
|
|
|
t: ./re tests
|
|
|
|
-time ./re <tests
|
|
|
|
-time ./re -cs <tests
|
|
|
|
-time ./re -el <tests
|
|
|
|
-time ./re -cs -el <tests
|
|
|
|
|
|
|
|
l: $(LINTC)
|
|
|
|
lint $(LINTFLAGS) -h $(LINTC) 2>&1 | egrep -v '$(JUNKLINT)' | tee lint
|
|
|
|
|
|
|
|
clean: tidy
|
|
|
|
rm -f *.o *.s *.ih re
|
|
|
|
|
|
|
|
tidy:
|
2004-07-19 08:41:11 +00:00
|
|
|
rm -f junk* core regex.tmp lint
|
2000-07-09 18:13:35 +00:00
|
|
|
|
|
|
|
spotless: clean
|
2004-07-19 08:41:11 +00:00
|
|
|
rm -f regex.h
|