1 # $FreeBSD: src/gnu/lib/libregex/test/Makefile,v 1.6 1999/08/27 23:32:58 peter Exp $
2 # $DragonFly: src/gnu/lib/libregex/test/Makefile,v 1.2 2003/06/17 04:25:44 dillon Exp $
4 # Generated automatically from Makefile.in by configure.
5 # Makefile for regex testing.
7 # Copyright (C) 1992 Free Software Foundation, Inc.
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 2, or (at your option)
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write to the Free Software
21 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
31 DEFS = -DHAVE_STRING_H=1
38 ALL_CPPFLAGS = -I. -I$(srcdir) -I../$(srcdir) $(DEFS) $(CPPFLAGS) $(debug)
41 $(CC) $(ALL_CPPFLAGS) $(CFLAGS) -c $<
44 # Define this as `../regex.o' to get the optimized version.
47 test_o = test.o bsd-interf.o other.o tregress.o psx-basic.o psx-extend.o \
48 psx-generic.o psx-group.o psx-interf.o psx-interv.o
49 common_o = printchar.o upcase.o xmalloc.o $(malloc)
51 # We have a lot of mallocs we can try when we run afoul of strange bugs.
53 #malloc = # the libc malloc
55 #malloc = debugmalloc.o
56 #malloc = emacsmalloc.o
57 emacsmallocflags = -Drcheck -Dbotch=abort -DUSG
59 # default is to do nothing.
64 regex: $(regex_o) $(common_o) $(test_o) main.o
65 $(CC) -o $@ $(LDFLAGS) $^ $(LIBS)
67 # As long as we're doing tests, we enable debugging.
68 dregex.o: ../regex.c ../regex.h
70 $(CC) $(ALL_CPPFLAGS) $(CFLAGS) -c ../$(srcdir)/regex.c
73 # iregex is the interactive regex.
74 iregex: $(common_o) $(regex_o) iregex.o
75 $(CC) -o $@ $(LDFLAGS) $^ $(LIBS)
77 # fileregex searches for an r.e. in every line of a given file.
78 fileregex_o = fileregex.o printchar.o $(regex_o)
79 fileregex: $(fileregex_o)
80 $(CC) -o $@ $(LDFLAGS) $(fileregex_o) $(LIBS)
82 # cppregex is regex with a preprocessed regex.c. Useful when the
83 # problem is inside some macro.
84 cppregex: regexcpp.o $(common_o) $(test_o) main.o
85 $(CC) -o $@ $(LDFLAGS) $^ $(LIBS)
87 regexcpp.o: regexcpp.c
89 regexcpp.c: regex.c regexcpp.sed
91 $(CC) -E $(ALL_CPPFLAGS) ../$(srcdir)/regex.c \
92 | egrep -v '^#|^ *$$' \
93 | sed -f regexcpp.sed \
97 # Have to give this malloc special flags.
98 emacsmalloc.o: emacsmalloc.c
99 $(CC) -c $(CFLAGS) $(ALL_CPPFLAGS) $(emacsmallocflags) \
100 ../$(srcdir)/test/emacsmalloc.c
103 $(CC) $(CFLAGS) -o $@ syntax.o
105 syntax.c: syntax.skel bits
106 sed '/\[\[\[replace.*\]\]\]/r bits' syntax.skel > $@
109 sed -n 1,/RE_SYNTAX_EMACS/p ../$(srcdir)/regex.h \
110 | grep "#define RE_.*1" \
111 | sed 's/^#define \(RE_[A-Z_]*\) .*/ TEST_BIT (\1);/' > $@
116 TAGS: regex.c regex.h *.h *.c
120 gcc -MM $(ALL_CPPFLAGS) *.c > /tmp/depend
127 rm -f *.o regex cppregex iregex fileregex regexcpp.c syntax
130 rm -f bits syntax.c Makefile
132 extraclean: distclean
133 rm -f *~* *\#* patch* *.orig *.rej *.bak core a.out
138 Makefile: Makefile.in ../config.status
139 (cd ..; sh config.status)
141 # Prevent GNU make 3 from overflowing arg limit on system V.
144 # Assumes $(distdir) is the place to put our files.
145 distfiles = ChangeLog TAGS *.in *.c *.h regexcpp.sed syntax.skel
148 ln $(distfiles) $(distdir)
150 # Automatically-generated dependencies below here.
152 bsd-interf.o : bsd-interf.c
153 debugmalloc.o : debugmalloc.c
154 emacsmalloc.o : emacsmalloc.c getpagesize.h
155 fileregex.o : fileregex.c .././regex.h
156 g++malloc.o : g++malloc.c //usr/include/stdio.h getpagesize.h
157 iregex.o : iregex.c .././regex.h
158 main.o : main.c test.h .././regex.h
159 malloc-test.o : malloc-test.c
160 other.o : other.c test.h .././regex.h
161 printchar.o : printchar.c
162 psx-basic.o : psx-basic.c test.h .././regex.h
163 psx-extend.o : psx-extend.c test.h .././regex.h
164 psx-generic.o : psx-generic.c test.h .././regex.h
165 psx-group.o : psx-group.c test.h .././regex.h
166 psx-interf.o : psx-interf.c test.h .././regex.h
167 psx-interv.o : psx-interv.c test.h .././regex.h
168 syntax.o : syntax.c .././regex.h
169 test.o : test.c test.h .././regex.h
170 tregress.o : tregress.c test.h .././regex.h
172 xmalloc.o : xmalloc.c