# $Id: Makefile.am,v 1.67 2003/08/23 16:38:12 ceder Exp $ # Copyright (C) 1998-2003 Lysator Academic Computer Association. # # This file is part of the LysKOM server. # # LysKOM 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. # # LysKOM 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 LysKOM; see the file COPYING. If not, write to # Lysator, c/o ISY, Linkoping University, S-581 83 Linkoping, SWEDEN, # or the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, # MA 02139, USA. # # Please report bugs at http://bugzilla.lysator.liu.se/. # include $(top_srcdir)/scripts/common.make SUBDIRS = config lyskomd.0 check_PROGRAMS = test-l2g bignum testfd test-select test-sigjmp \ timeval-overflow get-time-often check_DATA = site.exp .gdbinit valgrind.wrap ## The proper value of this depends on PROTECTED_FDS. See config/unix.exp. VALGRIND_FD = 21 EXTRA_DIST = \ l2g.0/00.exp l2g.0/01.exp l2g.0/02.exp l2g.0/03.exp \ l2g.0/04.exp l2g.0/05.exp l2g.0/06.exp l2g.0/07.exp \ l2g.0/08.exp l2g.0/09.exp l2g.0/10.exp l2g.0/11.exp \ l2g.0/12.exp \ leaks.0/leaks00.exp \ leaks.0/leaks01.exp \ leaks.0/leaks02.exp \ leaks.0/leaks03.exp \ leaks.0/leaks04.exp \ leaks.0/leaks05.exp \ leaks.0/leaks06.exp \ leaks.0/leaks07.exp \ leaks.0/leaks08.exp \ leaks.0/leaks09.exp \ leaks.0/leaks10.exp \ leaks.0/lots-aux-items.conf \ leaks.0/no-aux-items.conf \ locksuite.py \ lyskomd.supp \ renumber.el \ tcpconnect.py \ leaks.0/leaks99.exp MOSTLYCLEANFILES = .gdbinit site.exp *.sum *.log usage-base.tmp usage.all \ lyskomd.*.usage lyskomd.*.base *.da *.bb *.gcov *.bbg \ valgrind-*.log valgrind.log valgrind.wrap \ memory-usage-*.log mostlyclean-local: $(RM) -r -f db etc test_l2g_SOURCES = test-l2g.c test_l2g_LDADD = ../libcheck.a \ ../../libraries/libmisc/libmisc.a \ ../../libraries/libcommon/liblyskom-server.a \ ../libcheck.a \ ../../libraries/libansi/libansi.a bignum_SOURCES = bignum.c testfd_SOURCES = testfd.c timeval_overflow_SOURCES = timeval-overflow.c test_select_SOURCES = test-select.c test_select_LDADD = ../../libraries/libansi/libansi.a test_sigjmp_SOURCES = test-sigjmp.c test_sigjmp_LDADD = ../../libraries/libansi/libansi.a get_time_often_SOURCES = get-time-often.c get_time_often_LDADD = \ ../libcheck.a \ ../../libraries/libisc-new/src/libisc.a \ ../../libraries/liboop/liboop.a \ ../../libraries/adns/src/libadns.a \ ../../libraries/libmisc/libmisc.a \ ../libcheck.a ../libcheck.a: (cd .. && $(MAKE) libcheck.a) ../lyskomd: (cd .. && $(MAKE) lyskomd) AM_CPPFLAGS = -I$(srcdir)/.. \ -I../../.. \ -I$(srcdir)/../../include \ -I$(srcdir)/../../libraries/libansi \ -I$(srcdir)/../../libraries/libmisc \ -I$(srcdir)/../../libraries/libisc-new/src \ -I$(srcdir)/../../libraries/liboop \ -I$(srcdir)/../../libraries/regex \ -I$(srcdir)/../../libraries/libcommon top_srcdir = @top_srcdir@ .gdbinit: Makefile $(RM) -f .gdbinit echo dir $(top_srcdir)/src/libraries/libcommon >.gdbinit echo dir $(top_srcdir)/src/libraries/libansi >>.gdbinit echo dir $(top_srcdir)/src/libraries/libisc-new >>.gdbinit echo dir $(top_srcdir)/src/libraries/libmisc >>.gdbinit echo dir $(top_srcdir)/src/libraries/libisc-new/src >>.gdbinit echo dir $(top_srcdir)/src/libraries/liboop >>.gdbinit check: check-nondejagnu check-dejagnu check-nondejagnu: check-testfd check-test-select check-test-sigjmp check-dejagnu: check-l2g check-lyskomd check-leaks check-l2g: test-l2g site.exp valgrind.wrap runtest --tool l2g --srcdir $(srcdir) check-lyskomd: site.exp ../lyskomd valgrind.wrap bignum timeval-overflow if HAVE_PYTHON runtest --tool lyskomd --srcdir $(srcdir) \ 3<&- 4<&- 5<&- 6<&- 7<&- 8<&- 9<&- else @echo >&2 @echo WARNING: no python interpreter was found by configure, so >&2 @echo most tests could not be run. >&2 @echo >&2 endif # We need to build all test cases in lyskomd.0 before running check-lyskomd. # I have found no better way to express that check-lyskomd depends on # "make check" in lyskomd.0. check-lyskomd: check-recursive check-leaks: site.exp ../lyskomd valgrind.wrap if HAVE_PYTHON runtest --tool leaks --srcdir $(srcdir) \ 3<&- 4<&- 5<&- 6<&- 7<&- 8<&- 9<&- else @echo >&2 @echo WARNING: no python interpreter was found by configure, so >&2 @echo most tests could not be run. >&2 @echo >&2 endif check-testfd: testfd ./testfd check-test-select: test-select sleep 6|./test-select --no-sa-restart check-test-sigjmp: test-sigjmp sleep 6|./test-sigjmp sleep 6|./test-sigjmp --no-sa-restart ../../libraries/adns/client/adnshost: (cd ../../libraries/adns/client && $(MAKE) check) site.exp: Makefile ../../libraries/adns/client/adnshost $(RM) $@ $@.tmp echo "# this file is automatically generated by Makefile.am" > $@.tmp echo "set l2g ./test-l2g" >> $@.tmp echo "set top_srcdir $(top_srcdir)" >> $@.tmp if [ "$(VALGRIND)" ] ; \ then \ echo "set valgrind \"$(VALGRIND)\"" >> $@.tmp ; \ else \ echo "set valgrind \"\"" >> $@.tmp ; \ fi (../../libraries/adns/client/adnshost -i 127.0.0.1 2>/dev/null \ || echo 1.0.0.127.in-addr.arpa PTR 127.0.0.1) \ | sed -e 's/.*PTR /set lyskomd_host "/' -e 's/$$/"/' -e q >> $@.tmp echo set valgrind_fd $(VALGRIND_FD) >> $@.tmp echo set python \"$(PYTHON)\" >> $@.tmp chmod 444 $@.tmp mv $@.tmp $@ valgrind.wrap: Makefile $(RM) $@ $@.tmp echo "#!/bin/sh" > $@.tmp echo "# This file is generated by Makefile.am. Do not edit." >> $@.tmp echo 'exec $(VALGRIND_FD)>$$1' >> $@.tmp echo 'shift' >> $@.tmp echo 'echo $(VALGRIND) "$$@" >&$(VALGRIND_FD)' >> $@.tmp echo 'exec $(VALGRIND) "$$@"' >> $@.tmp chmod 555 $@.tmp mv $@.tmp $@