home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / MISC / REGEX011.TAZ / REGEX011 / regex-0.11 / test / Makefile.in < prev    next >
Encoding:
Makefile  |  1992-09-17  |  4.5 KB  |  168 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 $<
  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) $< \
  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.  
  96. syntax: syntax.o
  97.     $(CC) $(CFLAGS) $< -o $@
  98.  
  99. syntax.c: syntax.skel bits
  100.     sed '/\[\[\[replace.*\]\]\]/r bits' syntax.skel > $@
  101.  
  102. bits: regex.h
  103.     sed -n 1,/RE_SYNTAX_EMACS/p $< \
  104.           | grep "#define RE_.*1" \
  105.           | sed 's/^#define \(RE_[A-Z_]*\) .*/  TEST_BIT (\1);/' > $@
  106.  
  107. check: regex
  108.     ./regex
  109.  
  110. TAGS: regex.h regex.c *.h *.c
  111.     $(ETAGS) -t $^
  112.  
  113. depend:
  114.     gcc -MM $(ALL_CPPFLAGS) *.c > /tmp/depend
  115. .PHONY: depend
  116.  
  117. install:
  118. .PHONY: install
  119.  
  120. clean mostlyclean:
  121.     rm -f *.o regex cppregex iregex fileregex regexcpp.c syntax
  122.  
  123. distclean: clean
  124.     rm -f bits syntax.c Makefile
  125.  
  126. extraclean: distclean
  127.     rm -f *~* *\#* patch* *.orig *.rej *.bak core a.out
  128.  
  129. realclean: distclean
  130.     rm -f TAGS
  131.  
  132. Makefile: Makefile.in ../config.status
  133.     (cd ..; sh config.status)
  134.  
  135. # Prevent GNU make 3 from overflowing arg limit on system V.
  136. .NOEXPORT:
  137.  
  138. # Assumes $(distdir) is the place to put our files.
  139. distfiles = ChangeLog TAGS *.in *.c *.h regexcpp.sed syntax.skel
  140. dist: Makefile TAGS
  141.     mkdir $(distdir)
  142.     ln $(distfiles) $(distdir)
  143.  
  144. # Automatically-generated dependencies below here.
  145. alloca.o : alloca.c 
  146. bsd-interf.o : bsd-interf.c 
  147. debugmalloc.o : debugmalloc.c 
  148. emacsmalloc.o : emacsmalloc.c getpagesize.h 
  149. fileregex.o : fileregex.c .././regex.h 
  150. g++malloc.o : g++malloc.c //usr/include/stdio.h getpagesize.h 
  151. iregex.o : iregex.c .././regex.h 
  152. main.o : main.c test.h .././regex.h 
  153. malloc-test.o : malloc-test.c 
  154. other.o : other.c test.h .././regex.h 
  155. printchar.o : printchar.c 
  156. psx-basic.o : psx-basic.c test.h .././regex.h 
  157. psx-extend.o : psx-extend.c test.h .././regex.h 
  158. psx-generic.o : psx-generic.c test.h .././regex.h 
  159. psx-group.o : psx-group.c test.h .././regex.h 
  160. psx-interf.o : psx-interf.c test.h .././regex.h 
  161. psx-interv.o : psx-interv.c test.h .././regex.h 
  162. syntax.o : syntax.c .././regex.h 
  163. test.o : test.c test.h .././regex.h 
  164. tregress.o : tregress.c test.h .././regex.h 
  165. upcase.o : upcase.c 
  166. xmalloc.o : xmalloc.c 
  167.