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 >
Wrap
Text File
|
1993-07-30
|
3KB
|
76 lines
# Copyright (C) 1989 Free Software Foundation, Inc.
# written by Douglas C. Schmidt (schmidt@ics.uci.edu)
#
# This file is part of GNU GPERF.
#
# GNU GPERF 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 1, or (at your option)
# any later version.
#
# GNU GPERF 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 GNU GPERF; see the file COPYING. If not, write to
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
SHELL = /bin/sh
GPERF = ../gperf
CC = gcc
CFLAGS = -O
all: test
test:
@echo "performing some tests of the perfect hash generator"
$(CC) -c $(CFLAGS) test.c
$(GPERF) -p -c -l -S1 -C -o c.gpf > cinset.c
$(CC) $(CFLAGS) -o cout cinset.c test.o
@echo "testing ANSI C reserved words, all items should be found in the set"
./cout -v < c.gpf > output.c
-diff -c -b expc output.c
$(GPERF) -k1,4,'$$' ada.gpf > adainset.c
# double '$$' is only there since make gets confused; program wants only 1 '$'
$(CC) $(CFLAGS) -o aout adainset.c test.o
@echo "testing Ada reserved words,all items should be found in the set"
./aout -v < ada.gpf > outares
-diff -c -b expares outares
$(GPERF) -p -D -k1,'$$' -s 2 -o adadefs.gpf > preinset.c
$(CC) $(CFLAGS) -o preout preinset.c test.o
@echo "testing Ada predefined words, all items should be found in the set"
./preout -v < adadefs.gpf > outapred
-diff -c -b expapred outapred
$(GPERF) -k1,2,'$$' -o modula3.gpf > m3inset.c
$(CC) $(CFLAGS) -o m3out m3inset.c test.o
@echo "testing Modula3 reserved words, all items should be found in the set"
./m3out -v < modula3.gpf > outmod
-diff -c -b expmod outmod
$(GPERF) -o -S2 -p < pascal.gpf > pinset.c
$(CC) $(CFLAGS) -o pout pinset.c test.o
@echo "testing Pascal reserved words, all items should be found in the set"
./pout -v < pascal.gpf > outpas
-diff -c -b exppas outpas
# these next 5 are demos that show off the generated code
$(GPERF) -p -j1 -g -o -t -N is_reserved_word -k1,3,'$$' c-parse.gpf > testout.1
-diff -c -b expout.1 testout.1
$(GPERF) -n -k1-8 -l modula2.gpf > testout.2
-diff -c -b expout.2 testout.2
$(GPERF) -p -j 1 -o -a -g -t -k1,4,$$ gplus.gpf > testout.3
-diff -c -b expout.3 testout.3
$(GPERF) -D -p -t < c-parse.gpf > testout.4
-diff -c -b expout.4 testout.4
$(GPERF) -g -o -j1 -t -p -N is_reserved_word gpc.gpf > testout.5
-diff -c -b expout.5 testout.5
# prints out the help message
-$(GPERF) -h > testout.6 2>&1
-diff -c -b expout.6 testout.6
@echo "only if, do, for, case, goto, else, while, and return should be found "
./aout -v < c.gpf > testout.7
-diff -c -b expout.7 testout.7
clean:
-rm -f *.o core *~ *inset.c testout.* *out #*#