Add the DragonFly cvs id and perform general cleanups on cvs/rcs/sccs ids. Most
[games.git] / gnu / lib / libregex / test / Makefile
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 $
3
4 # Generated automatically from Makefile.in by configure.
5 # Makefile for regex testing.
6 #
7 # Copyright (C) 1992 Free Software Foundation, Inc.
8 #
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)
12 # any later version.
13 #
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.
18 #
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.
22
23 CPPFLAGS =
24 CFLAGS = -g
25 LDFLAGS =
26
27 srcdir = .
28 VPATH = .:../.
29
30 CC = gcc
31 DEFS =  -DHAVE_STRING_H=1
32 LIBS =  $(LOADLIBES)
33
34 ETAGS = etags
35 SHELL = /bin/sh
36
37 debug = -DDEBUG
38 ALL_CPPFLAGS = -I. -I$(srcdir) -I../$(srcdir) $(DEFS) $(CPPFLAGS) $(debug)
39
40 .c.o:
41         $(CC) $(ALL_CPPFLAGS) $(CFLAGS) -c $<
42
43
44 # Define this as `../regex.o' to get the optimized version.
45 regex_o = dregex.o
46 test_h = test.h
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)
50
51 # We have a lot of mallocs we can try when we run afoul of strange bugs.
52 malloc =
53 #malloc = # the libc malloc
54 #malloc = g++malloc.o
55 #malloc = debugmalloc.o
56 #malloc = emacsmalloc.o
57 emacsmallocflags = -Drcheck -Dbotch=abort -DUSG
58
59 # default is to do nothing.
60 default:
61
62 all: regex syntax
63
64 regex: $(regex_o) $(common_o) $(test_o) main.o
65         $(CC) -o $@ $(LDFLAGS) $^ $(LIBS)
66
67 # As long as we're doing tests, we enable debugging.
68 dregex.o: ../regex.c ../regex.h
69         rm -f $@
70         $(CC) $(ALL_CPPFLAGS) $(CFLAGS) -c ../$(srcdir)/regex.c
71         mv -f regex.o $@
72
73 # iregex is the interactive regex.
74 iregex: $(common_o) $(regex_o) iregex.o
75         $(CC) -o $@ $(LDFLAGS) $^ $(LIBS)
76
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)
81
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)
86
87 regexcpp.o: regexcpp.c
88
89 regexcpp.c: regex.c regexcpp.sed
90         rm -f regexcpp.c
91         $(CC) -E $(ALL_CPPFLAGS) ../$(srcdir)/regex.c \
92           | egrep -v '^#|^ *$$' \
93           | sed -f regexcpp.sed \
94           > regexcpp.c
95         chmod a-w regexcpp.c
96
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
101
102 syntax: syntax.o
103         $(CC) $(CFLAGS) -o $@ syntax.o
104
105 syntax.c: syntax.skel bits
106         sed '/\[\[\[replace.*\]\]\]/r bits' syntax.skel > $@
107
108 bits: regex.h
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);/' > $@
112
113 check: regex
114         ./regex
115
116 TAGS: regex.c regex.h *.h *.c
117         $(ETAGS) -t $^
118
119 depend:
120         gcc -MM $(ALL_CPPFLAGS) *.c > /tmp/depend
121 .PHONY: depend
122
123 install:
124 .PHONY: install
125
126 clean mostlyclean:
127         rm -f *.o regex cppregex iregex fileregex regexcpp.c syntax
128
129 distclean: clean
130         rm -f bits syntax.c Makefile
131
132 extraclean: distclean
133         rm -f *~* *\#* patch* *.orig *.rej *.bak core a.out
134
135 realclean: distclean
136         rm -f TAGS
137
138 Makefile: Makefile.in ../config.status
139         (cd ..; sh config.status)
140
141 # Prevent GNU make 3 from overflowing arg limit on system V.
142 .NOEXPORT:
143
144 # Assumes $(distdir) is the place to put our files.
145 distfiles = ChangeLog TAGS *.in *.c *.h regexcpp.sed syntax.skel
146 dist: Makefile TAGS
147         mkdir $(distdir)
148         ln $(distfiles) $(distdir)
149
150 # Automatically-generated dependencies below here.
151 alloca.o : alloca.c
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
171 upcase.o : upcase.c
172 xmalloc.o : xmalloc.c