xref: /freebsd/lib/libc/regex/grot/Makefile (revision 2ff3ba336eb76c046818643c49adcb6fc4f67e87)
18ca5c256SDaniel C. Sobral# $FreeBSD$
28ca5c256SDaniel C. Sobral# You probably want to take -DREDEBUG out of CFLAGS, and put something like
38ca5c256SDaniel C. Sobral# -O in, *after* testing (-DREDEBUG strengthens testing by enabling a lot of
48ca5c256SDaniel C. Sobral# internal assertion checking).  Take -Dconst= out for an ANSI compiler.
58ca5c256SDaniel C. Sobral# Do not take -DPOSIX_MISTAKE out.  REGCFLAGS isn't important to you (it's
68ca5c256SDaniel C. Sobral# for my use in some special contexts).
7c98c98a8SBrian Feldman
8c98c98a8SBrian FeldmanPATHS= ${.CURDIR}/.. ${.CURDIR}/../../locale ${.CURDIR}/../../../../include
9c98c98a8SBrian Feldman.PATH: ${PATHS}
10c98c98a8SBrian Feldman
11c98c98a8SBrian FeldmanCFLAGS+= -DPOSIX_MISTAKE -DREDEBUG $(REGCFLAGS)
12c98c98a8SBrian Feldman.for incpath in ${PATHS}
13c98c98a8SBrian FeldmanCFLAGS+= -I${incpath}
14c98c98a8SBrian Feldman.endfor
158ca5c256SDaniel C. Sobral
168ca5c256SDaniel C. Sobral# If you have an ANSI compiler, take -o out of MKHFLAGS.  If you want
178ca5c256SDaniel C. Sobral# the Berkeley __P macro, put -b in.
188ca5c256SDaniel C. SobralMKHFLAGS =
198ca5c256SDaniel C. Sobral
208ca5c256SDaniel C. SobralLDFLAGS =
218ca5c256SDaniel C. Sobral
228ca5c256SDaniel C. Sobral# If you have an ANSI environment, take limits.h and stdlib.h out of
238ca5c256SDaniel C. Sobral# HMISSING and take memmove out of SRCMISSING and OBJMISSING.
248ca5c256SDaniel C. SobralHMISSING =
258ca5c256SDaniel C. SobralSRCMISSING = split.c
268ca5c256SDaniel C. SobralOBJMISSING = split.o
2740503383STim J. RobbinsH = cname.h regex2.h utils.h $(HMISSING)
288ca5c256SDaniel C. SobralREGSRC = regcomp.c regerror.c regexec.c regfree.c engine.c
298ca5c256SDaniel C. SobralSRC = $(REGSRC) debug.c main.c $(SRCMISSING)
308ca5c256SDaniel C. Sobral
318ca5c256SDaniel C. Sobral# Internal stuff, should not need changing.
328ca5c256SDaniel C. SobralOBJPRODN = regcomp.o regexec.o regerror.o regfree.o
338ca5c256SDaniel C. SobralOBJS = $(OBJPRODN) debug.o main.o $(OBJMISSING)
348ca5c256SDaniel C. Sobral
358ca5c256SDaniel C. Sobral# Stuff that matters only if you're trying to lint the package.
368ca5c256SDaniel C. SobralLINTFLAGS = -I. -Dstatic= -Dconst= -DREDEBUG
378ca5c256SDaniel C. SobralLINTC = regcomp.c regexec.c regerror.c regfree.c debug.c main.c $(SRCMISSING)
388ca5c256SDaniel C. SobralJUNKLINT =possible pointer alignment|null effect
398ca5c256SDaniel C. Sobral
408ca5c256SDaniel C. Sobral.SUFFIXES:	.ih .h
418ca5c256SDaniel C. Sobral.c.ih:
4240503383STim J. Robbins	sh mkh $(MKHFLAGS) -p $< >$@
438ca5c256SDaniel C. Sobral
448ca5c256SDaniel C. Sobraldefault:	r
458ca5c256SDaniel C. Sobral
468ca5c256SDaniel C. Sobralre:	$(OBJS)
478ca5c256SDaniel C. Sobral	$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) -o $@
488ca5c256SDaniel C. Sobral
498ca5c256SDaniel C. Sobralo:	$(OBJPRODN)
508ca5c256SDaniel C. Sobral
512ff3ba33STim J. RobbinsREGEXHSRC = ../regex2.h ../reg*.c
528ca5c256SDaniel C. Sobralh:	$(REGEXHSRC)
5340503383STim J. Robbins	sh mkh $(MKHFLAGS) -i _REGEX_H_ $(REGEXHSRC) >regex.tmp
548ca5c256SDaniel C. Sobral	cmp -s regex.tmp regex.h 2>/dev/null || cp regex.tmp regex.h
558ca5c256SDaniel C. Sobral	rm -f regex.tmp
568ca5c256SDaniel C. Sobral
572ff3ba33STim J. Robbinsregex.h: h
582ff3ba33STim J. Robbins
598ca5c256SDaniel C. Sobralregcomp.o regexec.o regfree.o debug.o:	utils.h regex.h regex2.h
6040503383STim J. Robbinsregcomp.o:	cname.h regcomp.ih
618ca5c256SDaniel C. Sobralregexec.o:	engine.c engine.ih
628ca5c256SDaniel C. Sobralregerror.o:	regerror.ih
638ca5c256SDaniel C. Sobralregerror.o:	utils.h
648ca5c256SDaniel C. Sobraldebug.o:	debug.ih
658ca5c256SDaniel C. Sobralmain.o:	main.ih
668ca5c256SDaniel C. Sobral
678ca5c256SDaniel C. Sobralr:	re tests
688ca5c256SDaniel C. Sobral	./re <tests
698ca5c256SDaniel C. Sobral	./re -el <tests
708ca5c256SDaniel C. Sobral	./re -er <tests
718ca5c256SDaniel C. Sobral
728ca5c256SDaniel C. Sobralra:	./re tests
738ca5c256SDaniel C. Sobral	-./re <tests
748ca5c256SDaniel C. Sobral	-./re -el <tests
758ca5c256SDaniel C. Sobral	-./re -er <tests
768ca5c256SDaniel C. Sobral
778ca5c256SDaniel C. Sobralrx:	./re tests
788ca5c256SDaniel C. Sobral	./re -x <tests
798ca5c256SDaniel C. Sobral	./re -x -el <tests
808ca5c256SDaniel C. Sobral	./re -x -er <tests
818ca5c256SDaniel C. Sobral
828ca5c256SDaniel C. Sobralt:	./re tests
838ca5c256SDaniel C. Sobral	-time ./re <tests
848ca5c256SDaniel C. Sobral	-time ./re -cs <tests
858ca5c256SDaniel C. Sobral	-time ./re -el <tests
868ca5c256SDaniel C. Sobral	-time ./re -cs -el <tests
878ca5c256SDaniel C. Sobral
888ca5c256SDaniel C. Sobrall:	$(LINTC)
898ca5c256SDaniel C. Sobral	lint $(LINTFLAGS) -h $(LINTC) 2>&1 | egrep -v '$(JUNKLINT)' | tee lint
908ca5c256SDaniel C. Sobral
918ca5c256SDaniel C. Sobralclean:	tidy
928ca5c256SDaniel C. Sobral	rm -f *.o *.s *.ih re
938ca5c256SDaniel C. Sobral
948ca5c256SDaniel C. Sobraltidy:
9540503383STim J. Robbins	rm -f junk* core regex.tmp lint
968ca5c256SDaniel C. Sobral
978ca5c256SDaniel C. Sobralspotless:	clean
9840503383STim J. Robbins	rm -f regex.h
99