home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / NEXTSTEP / UNIX / Mail / appnmail-1.8-Solaris / regex-0.12 / test / Makefile.in < prev    next >
Encoding:
Makefile  |  1992-12-12  |  4.6 KB  |  169 lines

  1. # Makefile for regex testing.
  2. # Copyright (C) 1992 Free Software Foundation, Inc.
  3. #
  4. # This program is free software; you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation; either version 2, or (at your option)
  7. # any later version.
  8. #
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. # GNU General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU General Public License
  15. # along with this program; if not, write to the Free Software
  16. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17.  
  18. CPPFLAGS =
  19. CFLAGS = -g
  20. LDFLAGS =
  21.  
  22. srcdir = @srcdir@
  23. VPATH = @srcdir@:../@srcdir@
  24.  
  25. CC = @CC@
  26. DEFS = @DEFS@
  27. LIBS = @LIBS@ $(LOADLIBES)
  28.  
  29. ETAGS = etags
  30. SHELL = /bin/sh
  31.  
  32. debug = -DDEBUG
  33. ALL_CPPFLAGS = -I. -I$(srcdir) -I../$(srcdir) $(DEFS) $(CPPFLAGS) $(debug)
  34.  
  35. .c.o:
  36.     $(CC) $(ALL_CPPFLAGS) $(CFLAGS) -c $<
  37.  
  38.  
  39. # Define this as `../regex.o' to get the optimized version.
  40. regex_o = dregex.o
  41. test_h = test.h
  42. test_o = test.o bsd-interf.o other.o tregress.o psx-basic.o psx-extend.o \
  43.          psx-generic.o psx-group.o psx-interf.o psx-interv.o
  44. common_o = printchar.o upcase.o xmalloc.o $(malloc)
  45.  
  46. # We have a lot of mallocs we can try when we run afoul of strange bugs.
  47. malloc = @ALLOCA@
  48. #malloc = # the libc malloc
  49. #malloc = g++malloc.o
  50. #malloc = debugmalloc.o
  51. #malloc = emacsmalloc.o
  52. emacsmallocflags = -Drcheck -Dbotch=abort -DUSG
  53.  
  54. # default is to do nothing.
  55. default:
  56.  
  57. all: regex syntax
  58.  
  59. regex: $(regex_o) $(common_o) $(test_o) main.o
  60.     $(CC) -o $@ $(LDFLAGS) $^ $(LIBS)
  61.  
  62. # As long as we're doing tests, we enable debugging.
  63. dregex.o: ../regex.c ../regex.h
  64.     rm -f $@
  65.     $(CC) $(ALL_CPPFLAGS) $(CFLAGS) -c ../$(srcdir)/regex.c
  66.     mv regex.o $@
  67.  
  68. # iregex is the interactive regex.
  69. iregex: $(common_o) $(regex_o) iregex.o
  70.     $(CC) -o $@ $(LDFLAGS) $^ $(LIBS)
  71.  
  72. # fileregex searches for an r.e. in every line of a given file.
  73. fileregex_o = fileregex.o printchar.o $(regex_o)
  74. fileregex: $(fileregex_o)
  75.     $(CC) -o $@ $(LDFLAGS) $(fileregex_o) $(LIBS)
  76.  
  77. # cppregex is regex with a preprocessed regex.c.  Useful when the
  78. # problem is inside some macro.
  79. cppregex: regexcpp.o $(common_o) $(test_o) main.o
  80.     $(CC) -o $@ $(LDFLAGS) $^ $(LIBS)
  81.  
  82. regexcpp.o: regexcpp.c 
  83.  
  84. regexcpp.c: regex.c regexcpp.sed
  85.     rm -f regexcpp.c
  86.     $(CC) -E $(ALL_CPPFLAGS) ../$(srcdir)/regex.c \
  87.           | egrep -v '^#|^ *$$' \
  88.           | sed -f regexcpp.sed \
  89.           > regexcpp.c
  90.     chmod a-w regexcpp.c
  91.  
  92. # Have to give this malloc special flags.
  93. emacsmalloc.o: emacsmalloc.c
  94.     $(CC) -c $(CFLAGS) $(ALL_CPPFLAGS) $(emacsmallocflags) \
  95.       ../$(srcdir)/test/emacsmalloc.c
  96.  
  97. syntax: syntax.o
  98.     $(CC) $(CFLAGS) -o $@ syntax.o
  99.  
  100. syntax.c: syntax.skel bits
  101.     sed '/\[\[\[replace.*\]\]\]/r bits' syntax.skel > $@
  102.  
  103. bits: regex.h
  104.     sed -n 1,/RE_SYNTAX_EMACS/p ../$(srcdir)/regex.h \
  105.           | grep "#define RE_.*1" \
  106.           | sed 's/^#define \(RE_[A-Z_]*\) .*/  TEST_BIT (\1);/' > $@
  107.  
  108. check: regex
  109.     ./regex
  110.  
  111. TAGS: regex.c regex.h *.h *.c
  112.     $(ETAGS) -t $^
  113.  
  114. depend:
  115.     gcc -MM $(ALL_CPPFLAGS) *.c > /tmp/depend
  116. .PHONY: depend
  117.  
  118. install:
  119. .PHONY: install
  120.  
  121. clean mostlyclean:
  122.     rm -f *.o regex cppregex iregex fileregex regexcpp.c syntax
  123.  
  124. distclean: clean
  125.     rm -f bits syntax.c Makefile
  126.  
  127. extraclean: distclean
  128.     rm -f *~* *\#* patch* *.orig *.rej *.bak core a.out
  129.  
  130. realclean: distclean
  131.     rm -f TAGS
  132.  
  133. Makefile: Makefile.in ../config.status
  134.     (cd ..; sh config.status)
  135.  
  136. # Prevent GNU make 3 from overflowing arg limit on system V.
  137. .NOEXPORT:
  138.  
  139. # Assumes $(distdir) is the place to put our files.
  140. distfiles = ChangeLog TAGS *.in *.c *.h regexcpp.sed syntax.skel
  141. dist: Makefile TAGS
  142.     mkdir $(distdir)
  143.     ln $(distfiles) $(distdir)
  144.  
  145. # Automatically-generated dependencies below here.
  146. alloca.o : alloca.c 
  147. bsd-interf.o : bsd-interf.c 
  148. debugmalloc.o : debugmalloc.c 
  149. emacsmalloc.o : emacsmalloc.c getpagesize.h 
  150. fileregex.o : fileregex.c .././regex.h 
  151. g++malloc.o : g++malloc.c //usr/include/stdio.h getpagesize.h 
  152. iregex.o : iregex.c .././regex.h 
  153. main.o : main.c test.h .././regex.h 
  154. malloc-test.o : malloc-test.c 
  155. other.o : other.c test.h .././regex.h 
  156. printchar.o : printchar.c 
  157. psx-basic.o : psx-basic.c test.h .././regex.h 
  158. psx-extend.o : psx-extend.c test.h .././regex.h 
  159. psx-generic.o : psx-generic.c test.h .././regex.h 
  160. psx-group.o : psx-group.c test.h .././regex.h 
  161. psx-interf.o : psx-interf.c test.h .././regex.h 
  162. psx-interv.o : psx-interv.c test.h .././regex.h 
  163. syntax.o : syntax.c .././regex.h 
  164. test.o : test.c test.h .././regex.h 
  165. tregress.o : tregress.c test.h .././regex.h 
  166. upcase.o : upcase.c 
  167. xmalloc.o : xmalloc.c 
  168.