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 $
4 # Makefile for regex testing.
6 # Copyright (C) 1992 Free Software Foundation, Inc.
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)
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.
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.
27 VPATH = @srcdir@:../@srcdir@
31 LIBS = @LIBS@ $(LOADLIBES)
37 ALL_CPPFLAGS = -I. -I$(srcdir) -I../$(srcdir) $(DEFS) $(CPPFLAGS) $(debug)
40 $(CC) $(ALL_CPPFLAGS) $(CFLAGS) -c $<
43 # Define this as `../regex.o' to get the optimized version.
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)
50 # We have a lot of mallocs we can try when we run afoul of strange bugs.
52 #malloc = # the libc malloc
54 #malloc = debugmalloc.o
55 #malloc = emacsmalloc.o
56 emacsmallocflags = -Drcheck -Dbotch=abort -DUSG
58 # default is to do nothing.
63 regex: $(regex_o) $(common_o) $(test_o) main.o
64 $(CC) -o $@ $(LDFLAGS) $^ $(LIBS)
66 # As long as we're doing tests, we enable debugging.
67 dregex.o: ../regex.c ../regex.h
69 $(CC) $(ALL_CPPFLAGS) $(CFLAGS) -c ../$(srcdir)/regex.c
72 # iregex is the interactive regex.
73 iregex: $(common_o) $(regex_o) iregex.o
74 $(CC) -o $@ $(LDFLAGS) $^ $(LIBS)
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)
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)
86 regexcpp.o: regexcpp.c
88 regexcpp.c: regex.c regexcpp.sed
90 $(CC) -E $(ALL_CPPFLAGS) ../$(srcdir)/regex.c \
91 | egrep -v '^#|^ *$$' \
92 | sed -f regexcpp.sed \
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
102 $(CC) $(CFLAGS) -o $@ syntax.o
104 syntax.c: syntax.skel bits
105 sed '/\[\[\[replace.*\]\]\]/r bits' syntax.skel > $@
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);/' > $@
115 TAGS: regex.c regex.h *.h *.c
119 gcc -MM $(ALL_CPPFLAGS) *.c > /tmp/depend
126 rm -f *.o regex cppregex iregex fileregex regexcpp.c syntax
129 rm -f bits syntax.c Makefile
131 extraclean: distclean
132 rm -f *~* *\#* patch* *.orig *.rej *.bak core a.out
137 Makefile: Makefile.in ../config.status
138 (cd ..; sh config.status)
140 # Prevent GNU make 3 from overflowing arg limit on system V.
143 # Assumes $(distdir) is the place to put our files.
144 distfiles = ChangeLog TAGS *.in *.c *.h regexcpp.sed syntax.skel
147 ln $(distfiles) $(distdir)
149 # Automatically-generated dependencies below here.
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
171 xmalloc.o : xmalloc.c