18ca5c256SDaniel C. Sobral# You probably want to take -DREDEBUG out of CFLAGS, and put something like 28ca5c256SDaniel C. Sobral# -O in, *after* testing (-DREDEBUG strengthens testing by enabling a lot of 38ca5c256SDaniel C. Sobral# internal assertion checking). Take -Dconst= out for an ANSI compiler. 48ca5c256SDaniel C. Sobral# Do not take -DPOSIX_MISTAKE out. REGCFLAGS isn't important to you (it's 58ca5c256SDaniel C. Sobral# for my use in some special contexts). 6c98c98a8SBrian Feldman 7*d0fd0203SEnji CooperPATHS= ${LIBC_SRCTOP}/regex ${LIBC_SRCTOP}/locale ${SRCTOP}/include 8c98c98a8SBrian Feldman.PATH: ${PATHS} 9c98c98a8SBrian Feldman 1013854755SEnji CooperCFLAGS+= -static -DPOSIX_MISTAKE -DREDEBUG $(REGCFLAGS) 11c98c98a8SBrian Feldman.for incpath in ${PATHS} 12c98c98a8SBrian FeldmanCFLAGS+= -I${incpath} 13c98c98a8SBrian Feldman.endfor 148ca5c256SDaniel C. Sobral 158ca5c256SDaniel C. Sobral# If you have an ANSI compiler, take -o out of MKHFLAGS. If you want 168ca5c256SDaniel C. Sobral# the Berkeley __P macro, put -b in. 178ca5c256SDaniel C. SobralMKHFLAGS = 188ca5c256SDaniel C. Sobral 198ca5c256SDaniel C. SobralLDFLAGS = 208ca5c256SDaniel C. Sobral 218ca5c256SDaniel C. Sobral# If you have an ANSI environment, take limits.h and stdlib.h out of 228ca5c256SDaniel C. Sobral# HMISSING and take memmove out of SRCMISSING and OBJMISSING. 238ca5c256SDaniel C. SobralHMISSING = 248ca5c256SDaniel C. SobralSRCMISSING = split.c 258ca5c256SDaniel C. SobralOBJMISSING = split.o 2640503383STim J. RobbinsH = cname.h regex2.h utils.h $(HMISSING) 278ca5c256SDaniel C. SobralREGSRC = regcomp.c regerror.c regexec.c regfree.c engine.c 288ca5c256SDaniel C. SobralSRC = $(REGSRC) debug.c main.c $(SRCMISSING) 298ca5c256SDaniel C. Sobral 308ca5c256SDaniel C. Sobral# Internal stuff, should not need changing. 318ca5c256SDaniel C. SobralOBJPRODN = regcomp.o regexec.o regerror.o regfree.o 328ca5c256SDaniel C. SobralOBJS = $(OBJPRODN) debug.o main.o $(OBJMISSING) 338ca5c256SDaniel C. Sobral 348ca5c256SDaniel C. Sobral# Stuff that matters only if you're trying to lint the package. 358ca5c256SDaniel C. SobralLINTFLAGS = -I. -Dstatic= -Dconst= -DREDEBUG 368ca5c256SDaniel C. SobralLINTC = regcomp.c regexec.c regerror.c regfree.c debug.c main.c $(SRCMISSING) 378ca5c256SDaniel C. SobralJUNKLINT =possible pointer alignment|null effect 388ca5c256SDaniel C. Sobral 398ca5c256SDaniel C. Sobral.SUFFIXES: .ih .h 408ca5c256SDaniel C. Sobral.c.ih: 4140503383STim J. Robbins sh mkh $(MKHFLAGS) -p $< >$@ 428ca5c256SDaniel C. Sobral 438ca5c256SDaniel C. Sobraldefault: r 448ca5c256SDaniel C. Sobral 458ca5c256SDaniel C. Sobralre: $(OBJS) 468ca5c256SDaniel C. Sobral $(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) -o $@ 478ca5c256SDaniel C. Sobral 488ca5c256SDaniel C. Sobralo: $(OBJPRODN) 498ca5c256SDaniel C. Sobral 502ff3ba33STim J. RobbinsREGEXHSRC = ../regex2.h ../reg*.c 518ca5c256SDaniel C. Sobralh: $(REGEXHSRC) 5240503383STim J. Robbins sh mkh $(MKHFLAGS) -i _REGEX_H_ $(REGEXHSRC) >regex.tmp 538ca5c256SDaniel C. Sobral cmp -s regex.tmp regex.h 2>/dev/null || cp regex.tmp regex.h 548ca5c256SDaniel C. Sobral rm -f regex.tmp 558ca5c256SDaniel C. Sobral 562ff3ba33STim J. Robbinsregex.h: h 572ff3ba33STim J. Robbins 588ca5c256SDaniel C. Sobralregcomp.o regexec.o regfree.o debug.o: utils.h regex.h regex2.h 5940503383STim J. Robbinsregcomp.o: cname.h regcomp.ih 608ca5c256SDaniel C. Sobralregexec.o: engine.c engine.ih 618ca5c256SDaniel C. Sobralregerror.o: regerror.ih 628ca5c256SDaniel C. Sobralregerror.o: utils.h 638ca5c256SDaniel C. Sobraldebug.o: debug.ih 64e3bc7f4dSEnji Coopermain.o: debug.ih main.ih split.ih 65e3bc7f4dSEnji Coopersplit.o: split.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