home *** CD-ROM | disk | FTP | other *** search
/ GEMini Atari / GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso / zip / gnu / gperf.lzh / GPERF / MAKEFILE < prev    next >
Text File  |  1993-07-30  |  3KB  |  76 lines

  1. # Copyright (C) 1989 Free Software Foundation, Inc.
  2. # written by Douglas C. Schmidt (schmidt@ics.uci.edu)
  3. # This file is part of GNU GPERF.
  4. # GNU GPERF 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 1, or (at your option)
  7. # any later version.
  8. # GNU GPERF is distributed in the hope that it will be useful,
  9. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  11. # GNU General Public License for more details.
  12. # You should have received a copy of the GNU General Public License
  13. # along with GNU GPERF; see the file COPYING.  If not, write to
  14. # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 
  15.  
  16. SHELL = /bin/sh
  17. GPERF = ../gperf
  18. CC = gcc
  19. CFLAGS = -O
  20.  
  21. all: test
  22.  
  23. test:
  24.     @echo "performing some tests of the perfect hash generator"   
  25.     $(CC) -c $(CFLAGS) test.c
  26.     $(GPERF) -p -c -l -S1 -C -o c.gpf > cinset.c
  27.     $(CC) $(CFLAGS) -o cout cinset.c test.o
  28.     @echo "testing ANSI C reserved words, all items should be found in the set"
  29.     ./cout -v < c.gpf > output.c
  30.     -diff -c -b expc output.c
  31.     $(GPERF) -k1,4,'$$' ada.gpf > adainset.c
  32. # double '$$' is only there since make gets confused; program wants only 1 '$'
  33.     $(CC) $(CFLAGS) -o aout adainset.c test.o
  34.     @echo "testing Ada reserved words,all items should be found in the set"
  35.     ./aout -v < ada.gpf > outares
  36.     -diff -c -b expares outares
  37.     $(GPERF) -p -D -k1,'$$' -s 2 -o adadefs.gpf > preinset.c
  38.     $(CC) $(CFLAGS) -o preout preinset.c test.o
  39.     @echo "testing Ada predefined words, all items should be found in the set"
  40.     ./preout -v < adadefs.gpf > outapred
  41.     -diff -c -b expapred outapred
  42.     $(GPERF) -k1,2,'$$' -o modula3.gpf > m3inset.c
  43.     $(CC) $(CFLAGS) -o m3out m3inset.c test.o
  44.     @echo "testing Modula3 reserved words, all items should be found in the set"
  45.     ./m3out -v < modula3.gpf > outmod
  46.     -diff -c -b expmod outmod
  47.     $(GPERF) -o -S2 -p < pascal.gpf > pinset.c
  48.     $(CC) $(CFLAGS) -o pout pinset.c test.o
  49.     @echo "testing Pascal reserved words, all items should be found in the set"
  50.     ./pout -v < pascal.gpf > outpas
  51.     -diff -c -b exppas outpas
  52. # these next 5 are demos that show off the generated code
  53.     $(GPERF) -p -j1 -g -o -t -N is_reserved_word -k1,3,'$$' c-parse.gpf > testout.1
  54.     -diff -c -b expout.1 testout.1
  55.     $(GPERF) -n -k1-8 -l modula2.gpf > testout.2
  56.     -diff -c -b expout.2 testout.2
  57.     $(GPERF) -p -j 1 -o -a -g -t -k1,4,$$ gplus.gpf > testout.3
  58.     -diff -c -b expout.3 testout.3
  59.     $(GPERF) -D -p -t < c-parse.gpf > testout.4
  60.     -diff -c -b expout.4 testout.4
  61.     $(GPERF) -g -o -j1 -t -p -N is_reserved_word gpc.gpf > testout.5
  62.     -diff -c -b expout.5 testout.5
  63. # prints out the help message
  64.     -$(GPERF) -h > testout.6 2>&1
  65.     -diff -c -b expout.6 testout.6
  66.     @echo "only if, do, for, case, goto, else, while, and return should be found "
  67.     ./aout -v < c.gpf > testout.7
  68.     -diff -c -b expout.7 testout.7
  69.  
  70. clean: 
  71.     -rm -f *.o core *~ *inset.c testout.* *out #*#
  72.