# Copyright (C) 1989, 1992, 1993 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. 

srcdir = .

CXX=gcc
CXXFLAGS=-O2
CPPFLAGS=-I. -I/d/libgp271/g++-include
LIBS=/d/libgp271/lib/libg++.a /d/libgp271/lib/libstdc++.a

OBJS  = trie.o compact.o main.o version.o options.o
DEPEND_SOURCES = $(srcdir)/*.cc

#### package, host, target, and site dependent Makefile fragments come in here.
##

trie-gen.ttp: $(OBJS) 
	$(CXX) -o $@ $(OBJS) $(LIBS)
	strip -k $@
	chmod +x $@

LS_1 = /bin/ls # -1 default on most systems, not supported on all.

out.cc: trie-gen.ttp
	@echo "Generating a compacted minimal-prefix trie for files in /bin"
	$(LS_1) /bin | ./trie-gen -c > out.cc

check: out.o test.o
	$(CXX) out.o test.o $(LIBS)
	$(LS_1) /bin | ./a.out -v

run_tests: check

distrib: 
	(cd ..; rm -f trie-gen.tar.Z; tar cvf trie-gen.tar trie-gen; \
                compress trie-gen.tar)

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

compact.o : $(srcdir)/compact.cc $(srcdir)/compact.h 
main.o : $(srcdir)/main.cc $(srcdir)/options.h $(srcdir)/trie.h $(srcdir)/compact.h 
options.o : $(srcdir)/options.cc $(srcdir)/options.h 
trie.o : $(srcdir)/trie.cc $(srcdir)/trie.h $(srcdir)/compact.h 
version.o : $(srcdir)/version.cc 

# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
