Makefile.am 4.06 KB
Newer Older
1
# $Id: Makefile.am,v 1.44 2002/09/09 10:28:49 ceder Exp $
2
# Copyright (C) 1998-2002  Lysator Academic Computer Association.
Per Cederqvist's avatar
Per Cederqvist committed
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#
# 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 mail bug reports to bug-lyskom@lysator.liu.se. 
#

Per Cederqvist's avatar
Per Cederqvist committed
25
SUBDIRS = config lyskomd.0
Per Cederqvist's avatar
Per Cederqvist committed
26
RM = rm -f
Per Cederqvist's avatar
Per Cederqvist committed
27

28
check_PROGRAMS = test-l2g bignum
Per Cederqvist's avatar
Per Cederqvist committed
29

30
noinst_DATA = site.exp .gdbinit valgrind.wrap
Per Cederqvist's avatar
Per Cederqvist committed
31

Per Cederqvist's avatar
Per Cederqvist committed
32
EXTRA_DIST = .cvsignore \
33
34
35
	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 \
36
	l2g.0/12.exp \
37
38
39
40
41
42
43
44
45
	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 \
David Byers's avatar
David Byers committed
46
47
	leaks.0/leaks09.exp \
	leaks.0/leaks10.exp \
Per Cederqvist's avatar
Per Cederqvist committed
48
	leaks.0/lots-aux-items.conf \
49
50
51
52
53
	leaks.0/no-aux-items.conf \
	locksuite.py \
	lyskomd.supp \
	renumber.el \
	tcpconnect.py \
54
	leaks.0/leaks99.exp
55

Per Cederqvist's avatar
Per Cederqvist committed
56

57
MOSTLYCLEANFILES = .gdbinit site.exp *.sum *.log usage-base.tmp usage.all \
58
59
                   lyskomd.*.usage lyskomd.*.base *.da *.bb *.gcov *.bbg \
		   valgrind-*.log valgrind.log valgrind.wrap
Per Cederqvist's avatar
Per Cederqvist committed
60

61
62
63
mostlyclean-local:
	 $(RM) -r -f db etc

64
65
66
test_l2g_SOURCES = test-l2g.c
test_l2g_LDADD = ../libcheck.a $(LDADD)

67
68
bignum_SOURCES = bignum.c

69
../libcheck.a:
Per Cederqvist's avatar
Per Cederqvist committed
70
71
72
73
	(cd .. && $(MAKE) libcheck.a)

../lyskomd:
	(cd .. && $(MAKE) lyskomd)
Per Cederqvist's avatar
Per Cederqvist committed
74

Per Cederqvist's avatar
Per Cederqvist committed
75
INCLUDES = -I$(srcdir)/.. \
Per Cederqvist's avatar
Per Cederqvist committed
76
77
78
79
80
81
82
83
84
85
	-I$(srcdir)/../../include \
	-I$(srcdir)/../../libraries/libmisc \
	-I$(srcdir)/../../libraries/libisc-new/src \
	-I$(srcdir)/../../libraries/regex \
	-I$(srcdir)/../../libraries/libcommon

LDADD = ../../libraries/libisc-new/src/libisc.a \
	../../libraries/libmisc/libmisc.a \
	../../libraries/libcommon/liblyskom-server.a \
	../../libraries/regex/libregex.a \
86
	../../libraries/libansi/libansi.a
Per Cederqvist's avatar
Per Cederqvist committed
87
88
89
90
91
92
93
94
95
96

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

97
check: check-l2g check-lyskomd check-leaks
Per Cederqvist's avatar
Per Cederqvist committed
98

99
check-l2g: test-l2g site.exp valgrind.wrap
100
101
	runtest --tool l2g --srcdir $(srcdir)

102
check-lyskomd: site.exp ../lyskomd valgrind.wrap bignum
103
	runtest --tool lyskomd --srcdir $(srcdir) \
104
		3<&- 4<&- 5<&- 6<&- 7<&- 8<&- 9<&-
Per Cederqvist's avatar
Per Cederqvist committed
105

Per Cederqvist's avatar
Per Cederqvist committed
106
107
108
109
110
# 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

111
check-leaks: site.exp ../lyskomd valgrind.wrap
112
113
114
	runtest --tool leaks --srcdir $(srcdir) \
		3<&- 4<&- 5<&- 6<&- 7<&- 8<&- 9<&-

115
site.exp: Makefile
Per Cederqvist's avatar
Per Cederqvist committed
116
117
	echo "# this file is automatically generated" > site.exp
	echo "set l2g ./test-l2g" >> site.exp
118
	echo "set top_srcdir $(top_srcdir)" >> site.exp
Per Cederqvist's avatar
Per Cederqvist committed
119
120
121
122
123
124
	if [ "$(VALGRIND)" ] ; \
	then \
	    echo "set valgrind \"$(VALGRIND)\"" >> site.exp ; \
	else \
	    echo "set valgrind \"\"" >> site.exp ; \
	fi
125
126
127
128
129

valgrind.wrap: Makefile
	$(RM) $@ $@.tmp
	echo "#!/bin/sh" > $@.tmp
	echo "# This file is generated by Makefile.  Do not edit." >> $@.tmp
130
	## If you change the "25", you also have to change config/unix.exp.
131
132
133
	echo 'exec 25>$$1' >> $@.tmp
	echo 'shift' >> $@.tmp
	echo 'echo $(VALGRIND) "$$@" >&25' >> $@.tmp
134
135
136
	echo 'exec $(VALGRIND) "$$@"' >> $@.tmp
	chmod 555 $@.tmp
	mv $@.tmp $@