# --------------------------------------------------------------------
# Copyright (C) 1999-2004, 2006-2012 Free Software Foundation, Inc.

# 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, either version 3 of the License, 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, see <http://www.gnu.org/licenses/>.
# ----------------------------------------------------------------------
CLEANFILES = *~ *.bak core *.core *.o *.lo *.la fgr
bin_PROGRAMS = simple_hash
if WANT_GLIB
bin_PROGRAMS += filesystem
filesystem_SOURCES = filesystem.c ../src/dbh.c
filesystem_CFLAGS = -g @GLIB_CFLAGS@ -I../src `pkg-config gthread-2.0 --cflags`
filesystem_LDFLAGS = @GLIB_LIBS@ -lm -lpthread `pkg-config gthread-2.0 --libs`
endif

bin_PROGRAMS += performance
performance_SOURCES = performance.c ../src/dbh.c 
performance_LDFLAGS = -lm `pkg-config gthread-2.0 --libs` -lgdbm
performance_CFLAGS = -g -I../src `pkg-config gthread-2.0 --cflags`

simple_hash_SOURCES =  simple_hash.c ../src/dbh.c ../src/dbh.h ../src/dbh_static.i  ../src/dbh_exported.i

simple_hash_CFLAGS = -g -I../src @GLIB_CFLAGS@ 
simple_hash_LDADD =  -lm -lpthread @GLIB_LIBS@

if WANT_GLIB
test: filesystem
	./filesystem /usr/bin index
	./filesystem /usr/bin dump
	./filesystem /usr/bin regen
	./filesystem /usr/bin compare
	./filesystem /usr/bin thread
endif

