Merge branch 'vendor/BZIP'
[dragonfly.git] / gnu / lib / libregex / test / Makefile.in
1 # $FreeBSD: src/gnu/lib/libregex/test/Makefile.in,v 1.6 1999/08/27 23:32:58 peter Exp $
2 # $DragonFly: src/gnu/lib/libregex/test/Makefile.in,v 1.2 2003/06/17 04:25:44 dillon Exp $
3
4 # Makefile for regex testing.
5 #
6 # Copyright (C) 1992 Free Software Foundation, Inc.
7 #
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2, or (at your option)
11 # any later version.
12 #
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 # GNU General Public License for more details.
17 #
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21
22 CPPFLAGS =
23 CFLAGS = -g
24 LDFLAGS =
25
26 srcdir = @srcdir@
27 VPATH = @srcdir@:../@srcdir@
28
29 CC = @CC@
30 DEFS = @DEFS@
31 LIBS = @LIBS@ $(LOADLIBES)
32
33 ETAGS = etags
34 SHELL = /bin/sh
35
36 debug = -DDEBUG
37 ALL_CPPFLAGS = -I. -I$(srcdir) -I../$(srcdir) $(DEFS) $(CPPFLAGS) $(debug)
38
39 .c.o:
40         $(CC) $(ALL_CPPFLAGS) $(CFLAGS) -c $<
41
42
43 # Define this as `../regex.o' to get the optimized version.
44 regex_o = dregex.o
45 test_h = test.h
46 test_o = test.o bsd-interf.o other.o tregress.o psx-basic.o psx-extend.o \
47          psx-generic.o psx-group.o psx-interf.o psx-interv.o
48 common_o = printchar.o upcase.o xmalloc.o $(malloc)
49
50 # We have a lot of mallocs we can try when we run afoul of strange bugs.
51 malloc = @ALLOCA@
52 #malloc = # the libc malloc
53 #malloc = g++malloc.o
54 #malloc = debugmalloc.o
55 #malloc = emacsmalloc.o
56 emacsmallocflags = -Drcheck -Dbotch=abort -DUSG
57
58 # default is to do nothing.
59 default:
60
61 all: regex syntax
62
63 regex: $(regex_o) $(common_o) $(test_o) main.o
64         $(CC) -o $@ $(LDFLAGS) $^ $(LIBS)
65
66 # As long as we're doing tests, we enable debugging.
67 dregex.o: ../regex.c ../regex.h
68         rm -f $@
69         $(CC) $(ALL_CPPFLAGS) $(CFLAGS) -c ../$(srcdir)/regex.c
70         mv -f regex.o $@
71
72 # iregex is the interactive regex.
73 iregex: $(common_o) $(regex_o) iregex.o
74         $(CC) -o $@ $(LDFLAGS) $^ $(LIBS)
75
76 # fileregex searches for an r.e. in every line of a given file.
77 fileregex_o = fileregex.o printchar.o $(regex_o)
78 fileregex: $(fileregex_o)
79         $(CC) -o $@ $(LDFLAGS) $(fileregex_o) $(LIBS)
80
81 # cppregex is regex with a preprocessed regex.c.  Useful when the
82 # problem is inside some macro.
83 cppregex: regexcpp.o $(common_o) $(test_o) main.o
84         $(CC) -o $@ $(LDFLAGS) $^ $(LIBS)
85
86 regexcpp.o: regexcpp.c
87
88 regexcpp.c: regex.c regexcpp.sed
89         rm -f regexcpp.c
90         $(CC) -E $(ALL_CPPFLAGS) ../$(srcdir)/regex.c \
91           | egrep -v '^#|^ *$$' \
92           | sed -f regexcpp.sed \
93           > regexcpp.c
94         chmod a-w regexcpp.c
95
96 # Have to give this malloc special flags.
97 emacsmalloc.o: emacsmalloc.c
98         $(CC) -c $(CFLAGS) $(ALL_CPPFLAGS) $(emacsmallocflags) \
99           ../$(srcdir)/test/emacsmalloc.c
100
101 syntax: syntax.o
102         $(CC) $(CFLAGS) -o $@ syntax.o
103
104 syntax.c: syntax.skel bits
105         sed '/\[\[\[replace.*\]\]\]/r bits' syntax.skel > $@
106
107 bits: regex.h
108         sed -n 1,/RE_SYNTAX_EMACS/p ../$(srcdir)/regex.h \
109           | grep "#define RE_.*1" \
110           | sed 's/^#define \(RE_[A-Z_]*\) .*/  TEST_BIT (\1);/' > $@
111
112 check: regex
113         ./regex
114
115 TAGS: regex.c regex.h *.h *.c
116         $(ETAGS) -t $^
117
118 depend:
119         gcc -MM $(ALL_CPPFLAGS) *.c > /tmp/depend
120 .PHONY: depend
121
122 install:
123 .PHONY: install
124
125 clean mostlyclean:
126         rm -f *.o regex cppregex iregex fileregex regexcpp.c syntax
127
128 distclean: clean
129         rm -f bits syntax.c Makefile
130
131 extraclean: distclean
132         rm -f *~* *\#* patch* *.orig *.rej *.bak core a.out
133
134 realclean: distclean
135         rm -f TAGS
136
137 Makefile: Makefile.in ../config.status
138         (cd ..; sh config.status)
139
140 # Prevent GNU make 3 from overflowing arg limit on system V.
141 .NOEXPORT:
142
143 # Assumes $(distdir) is the place to put our files.
144 distfiles = ChangeLog TAGS *.in *.c *.h regexcpp.sed syntax.skel
145 dist: Makefile TAGS
146         mkdir $(distdir)
147         ln $(distfiles) $(distdir)
148
149 # Automatically-generated dependencies below here.
150 alloca.o : alloca.c
151 bsd-interf.o : bsd-interf.c
152 debugmalloc.o : debugmalloc.c
153 emacsmalloc.o : emacsmalloc.c getpagesize.h
154 fileregex.o : fileregex.c .././regex.h
155 g++malloc.o : g++malloc.c //usr/include/stdio.h getpagesize.h
156 iregex.o : iregex.c .././regex.h
157 main.o : main.c test.h .././regex.h
158 malloc-test.o : malloc-test.c
159 other.o : other.c test.h .././regex.h
160 printchar.o : printchar.c
161 psx-basic.o : psx-basic.c test.h .././regex.h
162 psx-extend.o : psx-extend.c test.h .././regex.h
163 psx-generic.o : psx-generic.c test.h .././regex.h
164 psx-group.o : psx-group.c test.h .././regex.h
165 psx-interf.o : psx-interf.c test.h .././regex.h
166 psx-interv.o : psx-interv.c test.h .././regex.h
167 syntax.o : syntax.c .././regex.h
168 test.o : test.c test.h .././regex.h
169 tregress.o : tregress.c test.h .././regex.h
170 upcase.o : upcase.c
171 xmalloc.o : xmalloc.c