#this is the -*- makefile -*- for animals.

# Copyright (c) 1997 by Jim Lynch.
# This software comes with NO WARRANTY WHATSOEVER.
#
# This program 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; version 2 dated June, 1991, or, at your
#    option, any LATER version.
#
#    This program 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 this program;  if not, write to the Free Software
#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
# On Debian Linux systems, the complete text of the GNU General
# Public License can be found in `/usr/doc/copyright/GPL' (on some
# installations) or /usr/share/common-licenses/GPL (on newer 
# ones).

# if you want the db in your home dir (maybe for testing)
#CPPFLAGS = -g -DDbName=\"$(HOME)/animals.db\"

# this one is pre-FHS, so uses FSSTND
#CPPFLAGS = -g -DDbName=\"/var/lib/games/animals/animals.db\"

# use this one for debian potato package
CPPFLAGS = -g -DDbName=\"/var/games/animals/animals.db\"

# Edited for Debian GNU/Linux.
DESTDIR =

animals: main.o db2++-stuff.o
	g++ -o animals main.o db2++-stuff.o -ldb2++

# various tests are conducted in test.cc
test: db2++-stuff.o test.o
	g++ -o test test.o db2++-stuff.o -ldb2++

main.o: main.cc Record.h Question.h Animal.h db2++-stuff.h

db2++-stuff.o: db2++-stuff.cc db2++-stuff.h

install: animals
	cp animals $(DESTDIR)/usr/games/animals
	mkdir -p $(DESTDIR)/var/games/animals

clean:
	rm -f animals test *.o *~ core
