# Copyright (C) 1989 Free Software Foundation, Inc.
# written by Douglas C. Schmidt (schmidt@ics.uci.edu)
# 
# This file is part of GNU TRIE-GEN.
# 
# GNU TRIE-GEN 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 trie-gen 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 trie-gen; see the file COPYING.  If not, write to
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 

GXX   = g++
DFLAGS= -g -Wall -DUNLIMIT_STACK
OFLAGS= -O -fdelayed-branch -fsave-memoized \
        -finline-functions -fstrength-reduce -felide-constructors
GFLAGS= $(DFLAGS) $(OFLAGS)
OBJS  = trie.o compact.o main.o
LIBS  = -lg++
.SUFFIXES: .cc
.cc.o:
	$(GXX) $(GFLAGS) -c  $<

all: trie-gen 

trie-gen: $(OBJS) 
	$(GXX) $(GFLAGS) -o trie-gen $(OBJS) $(LIBS)

test: trie-gen
	@echo "Generating a compacted minimal-prefix trie for files in /bin"
	/bin/ls -1 /bin | trie-gen -c > out.c
	g++ out.c test.c
	/bin/ls -1 /bin | a.out -v

clean: 
	-rm -f trie-gen *.o a.out out.c core *~ #*# mon.out

# DO NOT DELETE THIS LINE -- g++dep uses it.
# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.

compact.o : compact.cc compact.h 
main.o : main.cc 
trie.o : trie.cc trie.h compact.h 

# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
