]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - lib/libc/regex/grot/Makefile
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / lib / libc / regex / grot / Makefile
1 # $FreeBSD$
2 # You probably want to take -DREDEBUG out of CFLAGS, and put something like
3 # -O in, *after* testing (-DREDEBUG strengthens testing by enabling a lot of
4 # internal assertion checking).  Take -Dconst= out for an ANSI compiler.
5 # Do not take -DPOSIX_MISTAKE out.  REGCFLAGS isn't important to you (it's
6 # for my use in some special contexts).
7
8 PATHS= ${.CURDIR}/.. ${.CURDIR}/../../locale ${.CURDIR}/../../../../include
9 .PATH: ${PATHS}
10
11 CFLAGS+= -DPOSIX_MISTAKE -DREDEBUG $(REGCFLAGS)
12 .for incpath in ${PATHS}
13 CFLAGS+= -I${incpath}
14 .endfor
15
16 # If you have an ANSI compiler, take -o out of MKHFLAGS.  If you want
17 # the Berkeley __P macro, put -b in.
18 MKHFLAGS =
19
20 LDFLAGS =
21
22 # If you have an ANSI environment, take limits.h and stdlib.h out of
23 # HMISSING and take memmove out of SRCMISSING and OBJMISSING.
24 HMISSING =
25 SRCMISSING = split.c
26 OBJMISSING = split.o
27 H = cname.h regex2.h utils.h $(HMISSING)
28 REGSRC = regcomp.c regerror.c regexec.c regfree.c engine.c
29 SRC = $(REGSRC) debug.c main.c $(SRCMISSING)
30
31 # Internal stuff, should not need changing.
32 OBJPRODN = regcomp.o regexec.o regerror.o regfree.o
33 OBJS = $(OBJPRODN) debug.o main.o $(OBJMISSING)
34
35 # Stuff that matters only if you're trying to lint the package.
36 LINTFLAGS = -I. -Dstatic= -Dconst= -DREDEBUG
37 LINTC = regcomp.c regexec.c regerror.c regfree.c debug.c main.c $(SRCMISSING)
38 JUNKLINT =possible pointer alignment|null effect
39
40 .SUFFIXES:      .ih .h
41 .c.ih:
42         sh mkh $(MKHFLAGS) -p $< >$@
43
44 default:        r
45
46 re:     $(OBJS)
47         $(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) -o $@
48
49 o:      $(OBJPRODN)
50
51 REGEXHSRC = ../regex2.h ../reg*.c
52 h:      $(REGEXHSRC)
53         sh mkh $(MKHFLAGS) -i _REGEX_H_ $(REGEXHSRC) >regex.tmp
54         cmp -s regex.tmp regex.h 2>/dev/null || cp regex.tmp regex.h
55         rm -f regex.tmp
56
57 regex.h: h
58
59 regcomp.o regexec.o regfree.o debug.o:  utils.h regex.h regex2.h
60 regcomp.o:      cname.h regcomp.ih
61 regexec.o:      engine.c engine.ih
62 regerror.o:     regerror.ih
63 regerror.o:     utils.h
64 debug.o:        debug.ih
65 main.o: main.ih
66
67 r:      re tests
68         ./re <tests
69         ./re -el <tests
70         ./re -er <tests
71
72 ra:     ./re tests
73         -./re <tests
74         -./re -el <tests
75         -./re -er <tests
76
77 rx:     ./re tests
78         ./re -x <tests
79         ./re -x -el <tests
80         ./re -x -er <tests
81
82 t:      ./re tests
83         -time ./re <tests
84         -time ./re -cs <tests
85         -time ./re -el <tests
86         -time ./re -cs -el <tests
87
88 l:      $(LINTC)
89         lint $(LINTFLAGS) -h $(LINTC) 2>&1 | egrep -v '$(JUNKLINT)' | tee lint
90
91 clean:  tidy
92         rm -f *.o *.s *.ih re
93
94 tidy:
95         rm -f junk* core regex.tmp lint
96
97 spotless:       clean
98         rm -f regex.h