cvs: Rebuild without gnuregex library
[dragonfly.git] / gnu / lib / libregex / test / Makefile.in
CommitLineData
984263bc 1# $FreeBSD: src/gnu/lib/libregex/test/Makefile.in,v 1.6 1999/08/27 23:32:58 peter Exp $
1de703da 2# $DragonFly: src/gnu/lib/libregex/test/Makefile.in,v 1.2 2003/06/17 04:25:44 dillon Exp $
984263bc
MD
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
22CPPFLAGS =
23CFLAGS = -g
24LDFLAGS =
25
26srcdir = @srcdir@
27VPATH = @srcdir@:../@srcdir@
28
29CC = @CC@
30DEFS = @DEFS@
31LIBS = @LIBS@ $(LOADLIBES)
32
33ETAGS = etags
34SHELL = /bin/sh
35
36debug = -DDEBUG
37ALL_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.
44regex_o = dregex.o
45test_h = test.h
46test_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
48common_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.
51malloc = @ALLOCA@
52#malloc = # the libc malloc
53#malloc = g++malloc.o
54#malloc = debugmalloc.o
55#malloc = emacsmalloc.o
56emacsmallocflags = -Drcheck -Dbotch=abort -DUSG
57
58# default is to do nothing.
59default:
60
61all: regex syntax
62
63regex: $(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.
67dregex.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.
73iregex: $(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.
77fileregex_o = fileregex.o printchar.o $(regex_o)
78fileregex: $(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.
83cppregex: regexcpp.o $(common_o) $(test_o) main.o
84 $(CC) -o $@ $(LDFLAGS) $^ $(LIBS)
85
86regexcpp.o: regexcpp.c
87
88regexcpp.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.
97emacsmalloc.o: emacsmalloc.c
98 $(CC) -c $(CFLAGS) $(ALL_CPPFLAGS) $(emacsmallocflags) \
99 ../$(srcdir)/test/emacsmalloc.c
100
101syntax: syntax.o
102 $(CC) $(CFLAGS) -o $@ syntax.o
103
104syntax.c: syntax.skel bits
105 sed '/\[\[\[replace.*\]\]\]/r bits' syntax.skel > $@
106
107bits: 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
112check: regex
113 ./regex
114
115TAGS: regex.c regex.h *.h *.c
116 $(ETAGS) -t $^
117
118depend:
119 gcc -MM $(ALL_CPPFLAGS) *.c > /tmp/depend
120.PHONY: depend
121
122install:
123.PHONY: install
124
125clean mostlyclean:
126 rm -f *.o regex cppregex iregex fileregex regexcpp.c syntax
127
128distclean: clean
129 rm -f bits syntax.c Makefile
130
131extraclean: distclean
132 rm -f *~* *\#* patch* *.orig *.rej *.bak core a.out
133
134realclean: distclean
135 rm -f TAGS
136
137Makefile: 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.
144distfiles = ChangeLog TAGS *.in *.c *.h regexcpp.sed syntax.skel
145dist: Makefile TAGS
146 mkdir $(distdir)
147 ln $(distfiles) $(distdir)
148
149# Automatically-generated dependencies below here.
150alloca.o : alloca.c
151bsd-interf.o : bsd-interf.c
152debugmalloc.o : debugmalloc.c
153emacsmalloc.o : emacsmalloc.c getpagesize.h
154fileregex.o : fileregex.c .././regex.h
155g++malloc.o : g++malloc.c //usr/include/stdio.h getpagesize.h
156iregex.o : iregex.c .././regex.h
157main.o : main.c test.h .././regex.h
158malloc-test.o : malloc-test.c
159other.o : other.c test.h .././regex.h
160printchar.o : printchar.c
161psx-basic.o : psx-basic.c test.h .././regex.h
162psx-extend.o : psx-extend.c test.h .././regex.h
163psx-generic.o : psx-generic.c test.h .././regex.h
164psx-group.o : psx-group.c test.h .././regex.h
165psx-interf.o : psx-interf.c test.h .././regex.h
166psx-interv.o : psx-interv.c test.h .././regex.h
167syntax.o : syntax.c .././regex.h
168test.o : test.c test.h .././regex.h
169tregress.o : tregress.c test.h .././regex.h
170upcase.o : upcase.c
171xmalloc.o : xmalloc.c