# Makefile for regex testing.
# Copyright (C) 1992 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
VPATH
= @
srcdir@
:..
/@
srcdir@
LIBS
= @LIBS@
$(LOADLIBES
)
ALL_CPPFLAGS
= -I.
-I
$(srcdir) -I..
/$(srcdir) $(DEFS
) $(CPPFLAGS
) $(debug
)
$(CC
) $(ALL_CPPFLAGS
) $(CFLAGS
) -c
$<
# Define this as `../regex.o' to get the optimized version.
test_o
= test.o bsd-interf.o other.o tregress.o psx-basic.o psx-extend.o \
psx-generic.o psx-group.o psx-interf.o psx-interv.o
common_o
= printchar.o upcase.o xmalloc.o
$(malloc
)
# We have a lot of mallocs we can try when we run afoul of strange bugs.
#malloc = # the libc malloc
emacsmallocflags
= -Drcheck
-Dbotch
=abort
-DUSG
# default is to do nothing.
regex
: $(regex_o
) $(common_o
) $(test_o
) main.o
$(CC
) -o
$@
$(LDFLAGS
) $^
$(LIBS
)
# As long as we're doing tests, we enable debugging.
dregex.o
: ..
/regex.c ..
/regex.h
$(CC
) $(ALL_CPPFLAGS
) $(CFLAGS
) -c ..
/$(srcdir)/regex.c
# iregex is the interactive regex.
iregex
: $(common_o
) $(regex_o
) iregex.o
$(CC
) -o
$@
$(LDFLAGS
) $^
$(LIBS
)
# fileregex searches for an r.e. in every line of a given file.
fileregex_o
= fileregex.o printchar.o
$(regex_o
)
fileregex
: $(fileregex_o
)
$(CC
) -o
$@
$(LDFLAGS
) $(fileregex_o
) $(LIBS
)
# cppregex is regex with a preprocessed regex.c. Useful when the
# problem is inside some macro.
cppregex
: regexcpp.o
$(common_o
) $(test_o
) main.o
$(CC
) -o
$@
$(LDFLAGS
) $^
$(LIBS
)
regexcpp.c
: regex.c regexcpp.sed
$(CC
) -E
$(ALL_CPPFLAGS
) ..
/$(srcdir)/regex.c \
# Have to give this malloc special flags.
emacsmalloc.o
: emacsmalloc.c
$(CC
) -c
$(CFLAGS
) $(ALL_CPPFLAGS
) $(emacsmallocflags
) \
..
/$(srcdir)/test/emacsmalloc.c
$(CC
) $(CFLAGS
) -o
$@ syntax.o
syntax.c
: syntax.skel bits
sed
'/\[\[\[replace.*\]\]\]/r bits' syntax.skel
> $@
sed
-n
1,/RE_SYNTAX_EMACS
/p ..
/$(srcdir)/regex.h \
| grep
"#define RE_.*1" \
| sed
's/^#define \(RE_[A-Z_]*\) .*/ TEST_BIT (\1);/' > $@
TAGS
: regex.c regex.h
*.h
*.c
gcc
-MM
$(ALL_CPPFLAGS
) *.c
> /tmp
/depend
rm -f
*.o regex cppregex iregex fileregex regexcpp.c syntax
rm -f bits syntax.c Makefile
rm -f
*~
* *\
#* patch* *.orig *.rej *.bak core a.out
Makefile
: Makefile.in ..
/config.status
(cd ..
; sh config.status
)
# Prevent GNU make 3 from overflowing arg limit on system V.
# Assumes $(distdir) is the place to put our files.
distfiles
= ChangeLog TAGS
*.in
*.c
*.h regexcpp.sed syntax.skel
ln
$(distfiles
) $(distdir
)
# Automatically-generated dependencies below here.
bsd-interf.o
: bsd-interf.c
debugmalloc.o
: debugmalloc.c
emacsmalloc.o
: emacsmalloc.c getpagesize.h
fileregex.o
: fileregex.c ..
/.
/regex.h
g
++malloc.o
: g
++malloc.c
//usr
/include/stdio.h getpagesize.h
iregex.o
: iregex.c ..
/.
/regex.h
main.o
: main.c
test.h ..
/.
/regex.h
malloc-test.o
: malloc-test.c
other.o
: other.c
test.h ..
/.
/regex.h
printchar.o
: printchar.c
psx-basic.o
: psx-basic.c
test.h ..
/.
/regex.h
psx-extend.o
: psx-extend.c
test.h ..
/.
/regex.h
psx-generic.o
: psx-generic.c
test.h ..
/.
/regex.h
psx-group.o
: psx-group.c
test.h ..
/.
/regex.h
psx-interf.o
: psx-interf.c
test.h ..
/.
/regex.h
psx-interv.o
: psx-interv.c
test.h ..
/.
/regex.h
syntax.o
: syntax.c ..
/.
/regex.h
test.o
: test.c
test.h ..
/.
/regex.h
tregress.o
: tregress.c
test.h ..
/.
/regex.h