xref: /original-bsd/lib/libcompat/regexp/Makefile (revision 0999a820)
1# Things you might want to put in ENV and LENV:
2# -Dvoid=int		compilers that don't do void
3# -DCHARBITS=0377	compilers that don't do unsigned char
4# -DSTATIC=extern	compilers that don't like "static foo();" as forward decl
5# -DSTRCSPN		library does not have strcspn()
6# -Dstrchr=index	library does not have strchr()
7# -DERRAVAIL		have utzoo-compatible error() function and friends
8ENV=
9LENV=
10
11# Things you might want to put in TEST:
12# -DDEBUG		debugging hooks
13# -I.			regexp.h from current directory, not /usr/include
14TEST= -I.
15
16# Things you might want to put in PROF:
17# -Dstatic='/* */'	make everything global so profiler can see it.
18# -p			profiler
19PROF=
20
21CFLAGS=-O $(ENV) $(TEST) $(PROF)
22LINTFLAGS=$(LENV) $(TEST) -ha
23#LDFLAGS=-i		uncomment for pdp 11
24
25OBJ=regexp.o regsub.o
26LSRC=regexp.c regsub.c regerror.c
27DTR=README.regexp dMakefile regexp.3 regexp.h regexp.c regsub.c regerror.c \
28	regmagic.h try.c timer.c tests
29
30try:	try.o $(OBJ)
31	cc $(LDFLAGS) try.o $(OBJ) -o try
32
33# Making timer will probably require putting stuff in $(PROF) and then
34# recompiling everything; the following is just the final stage.
35timer:	timer.o $(OBJ)
36	cc $(LDFLAGS) $(PROF) timer.o $(OBJ) -o timer
37
38timer.o:	timer.c timer.t.h
39
40timer.t.h:	tests
41	sed 's/	/","/g;s/\\/&&/g;s/.*/{"&"},/' tests >timer.t.h
42
43# Regression test.
44r:	try tests
45	@echo 'No news is good news...'
46	try <tests
47
48lint:	timer.t.h
49	@echo 'Complaints about multiply-declared regerror() are legit.'
50	lint $(LINTFLAGS) $(LSRC) try.c
51	lint $(LINTFLAGS) $(LSRC) timer.c
52
53regexp.o:	regexp.c regexp.h regmagic.h
54regsub.o:	regsub.c regexp.h regmagic.h
55
56clean:
57	rm -f *.o core mon.out timer.t.h dMakefile dtr try timer
58
59dtr:	r makedtr $(DTR)
60	makedtr $(DTR) >dtr
61
62dMakefile:	Makefile
63	sed '/^L*ENV=/s/ *-DERRAVAIL//' Makefile >dMakefile
64