Makefile.am 8.59 KB
Newer Older
1
# $Id: Makefile.am,v 1.43 2002/08/17 17:34:07 ceder Exp $
Per Cederqvist's avatar
Per Cederqvist committed
2
# Copyright (C) 1998-1999, 2001-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. 
#

25
26
SUBDIRS = testsuite

27
YFLAGS = -d
Per Cederqvist's avatar
Per Cederqvist committed
28
RM = rm -f
29

Per Cederqvist's avatar
Per Cederqvist committed
30
EXTRA_DIST = .cvsignore ChangeLog.1 Magics \
31
32
	call-switch.awk com-h.awk fnc-def-init.awk \
	prot-a-parse-arg-c.awk prot-a-parse-arg-h.awk \
33
	prot-a-is-legal-fnc.awk \
34
	fncdef.txt \
35
	handle-malloc-dump.el trace-mem.gdb
36
37

MOSTLYCLEANFILES = .gdbinit call-switch.incl com.h fnc-def-init.incl \
38
	fncdef-no-str-limit.txt prot-a-parse-arg.h version.incl \
39
	prot-a-is-legal-fnc.incl *.da *.bb *.gcov *.bbg \
Per Cederqvist's avatar
Per Cederqvist committed
40
	version-info.c prot-a-parse-arg.c aux.h
41

Per Cederqvist's avatar
Per Cederqvist committed
42
INCLUDES = -DDEFAULT_PREFIX='"$(prefix)"' \
Per Cederqvist's avatar
Per Cederqvist committed
43
44
45
46
47
48
49
50
	-I$(srcdir)/../include \
	-I$(srcdir)/../libraries/libmisc \
	-I$(srcdir)/../libraries/libisc-new/src \
	-I$(srcdir)/../libraries/regex \
	-I$(srcdir)/../libraries/libcommon

top_srcdir = @top_srcdir@

51
bin_PROGRAMS = lyskomd dbck updateLysKOM komrunning splitkomdb
52

53
check_LIBRARIES = libcheck.a
54
55
libcheck_a_SOURCES = local-to-global.c ram-parse.c ram-output.c \
	log.c ram-smalloc.c memory.c
Per Cederqvist's avatar
Per Cederqvist committed
56

57
lyskomd_SOURCES = $(DISKOBJS) $(GENOBJS) \
58
59
60
        aux-item-def-parse.y \
        aux-item-def-parse.h \
	aux-item-def-scan.l \
61
62
	admin.h async.h aux-items.h cache-node.h cache.h conf-file.h \
	connections.h end-of-atomic.h exp.h internal-connections.h \
63
	text.h isc-interface.h isc-malloc.h isc-parse.h \
64
	kom-memory.h local-to-global.h log.h lyskomd.h manipulate.h \
65
	minmax.h param.h prot-a-output.h prot-a-parse.h \
66
67
	prot-a-send-async.h prot-a.h ram-output.h ram-parse.h \
	rfc931.h send-async.h server-config.h string-malloc.h \
68
	text-garb.h version-info.h sigflags.h trace-alloc.h \
69
	lockdb.h lockdb.c server-time.h
70
nodist_lyskomd_SOURCES = $(NODIST_DISKOBJS) $(NODIST_GENOBJS)
71

Per Cederqvist's avatar
Per Cederqvist committed
72
73
74
READ_CONFIG = string-malloc.c ram-smalloc.c log.c conf-file.c server-config.c \
	 standalone.c

75
komrunning_SOURCES = komrunning.c pidfile.c pidfile.h $(READ_CONFIG)
Per Cederqvist's avatar
Per Cederqvist committed
76

77
updateLysKOM_SOURCES = updateLysKOM.c pidfile.c pidfile.h $(READ_CONFIG)
Per Cederqvist's avatar
Per Cederqvist committed
78

79
dbck_SOURCES = $(DBCK) \
80
	dbck-cache.h getopt.h standalone.c
81
nodist_dbck_SOURCES = $(NODIST_DBCK)
Per Cederqvist's avatar
Per Cederqvist committed
82

83
84
splitkomdb_SOURCES = splitkomdb.c $(READ_CONFIG)

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


# Files that implements protocol A.
93
94
NODIST_PROTA = prot-a-parse-arg.c
PROTA =  prot-a-output.c prot-a-parse.c prot-a.c \
Per Cederqvist's avatar
Per Cederqvist committed
95
96
97
98
99
	 prot-a-send-async.c

# Implementations of the atomic calls.

ATOMS = text.c membership.c person.c conference.c session.c admin.c \
100
	regex-match.c aux-items.c debug.c
Per Cederqvist's avatar
Per Cederqvist committed
101
102

# These files are needed by all versions of the LysKOM server.
Per Cederqvist's avatar
Per Cederqvist committed
103
NODIST_GENOBJS = $(NODIST_PROTA) aux.h
Per Cederqvist's avatar
Per Cederqvist committed
104
105
GENOBJS = connections.c log.c $(ATOMS) \
          send-async.c server-config.c text-garb.c \
106
          isc-parse.c memory.c $(PROTA) \
Per Cederqvist's avatar
Per Cederqvist committed
107
108
109
110
111
112
	  internal-connections.c rfc931.c isc-malloc.c \
	  conf-file.c local-to-global.c 


# Files for lyskomd.

113
NODIST_DISKOBJS = version-info.c
Per Cederqvist's avatar
Per Cederqvist committed
114
DISKOBJS = ramkomd.c ram-smalloc.c simple-cache.c ram-parse.c ram-output.c \
115
	disk-end-of-atomic.c cache-node.c string-malloc.c
Per Cederqvist's avatar
Per Cederqvist committed
116
117
118
119

# Files for dbck.

GETOPT = getopt.c getopt1.c
120
NODIST_DBCK = version-info.c
121
DBCK = dbck.c dbck-cache.c ram-smalloc.c ram-parse.c server-config.c \
122
	ram-output.c memory.c conf-file.c $(GETOPT) \
123
	local-to-global.c lockdb.h lockdb.c
Per Cederqvist's avatar
Per Cederqvist committed
124
125
126
127
128
129
130
131
132
133
134

# Files for encrypt (a program to transform the database from unencrypted
# apasswords to encrypted).  No longer supported.

ENCRYPT = encrypt-passwd.c dbck-cache.c ram-smalloc.c ram-parse.c \
	server-config.c\
	ram-output.c memory.c

BUILT_SOURCES = prot-a-parse-arg.c version-info.c \
	call-switch.incl com.h fnc-def-init.incl \
	prot-a-parse-arg.h fncdef-no-str-limit.txt .gdbinit \
Per Cederqvist's avatar
Per Cederqvist committed
135
	version.incl prot-a-is-legal-fnc.incl aux.h
Per Cederqvist's avatar
Per Cederqvist committed
136
137
138
139
140
141
142
143
144
145
146
147

call-switch.incl: call-switch.awk fncdef-no-str-limit.txt
	$(AWK) -f $(srcdir)/call-switch.awk fncdef-no-str-limit.txt \
		> call-switch.incl

com.h: com-h.awk fncdef-no-str-limit.txt
	$(AWK) -f $(srcdir)/com-h.awk fncdef-no-str-limit.txt > com.h

fnc-def-init.incl: fnc-def-init.awk fncdef-no-str-limit.txt
	$(AWK) -f $(srcdir)/fnc-def-init.awk fncdef-no-str-limit.txt \
		> fnc-def-init.incl

148
149
150
151
prot-a-is-legal-fnc.incl: fncdef-no-str-limit.txt prot-a-is-legal-fnc.awk
	$(AWK) -f $(srcdir)/prot-a-is-legal-fnc.awk fncdef-no-str-limit.txt \
		> prot-a-is-legal-fnc.incl

Per Cederqvist's avatar
Per Cederqvist committed
152
153
154
155
156
157
158
159
160
161
162
163
164
165
prot-a-parse-arg.c: prot-a-parse-arg-c.awk fncdef.txt prot-a-parse-arg.h
	$(AWK) -f $(srcdir)/prot-a-parse-arg-c.awk $(srcdir)/fncdef.txt \
		> prot-a-parse-arg.c

prot-a-parse-arg.h: prot-a-parse-arg-h.awk fncdef-no-str-limit.txt
	$(AWK) -f $(srcdir)/prot-a-parse-arg-h.awk \
		fncdef-no-str-limit.txt > prot-a-parse-arg.h

fncdef-no-str-limit.txt: fncdef.txt
	(echo \# Do not edit this file! It is generated from fncdef.txt.;\
	  cat $(srcdir)/fncdef.txt) \
	| sed 's/([^)]*)//g' > fncdef-no-str-limit.txt

version.incl: $(top_srcdir)/versions
Per Cederqvist's avatar
Per Cederqvist committed
166
	echo '/* Do not edit -- automatically generated file */'      > $@.tmp
Per Cederqvist's avatar
Per Cederqvist committed
167
	sed -n 's/SERVER-COMPAT-VERSION: //p' $(top_srcdir)/versions  >>$@.tmp
Per Cederqvist's avatar
Per Cederqvist committed
168
	echo '/* Do not edit -- automatically generated file */'      >>$@.tmp
Per Cederqvist's avatar
Per Cederqvist committed
169
170
171
	mv $@.tmp $@

version-info.c: $(top_srcdir)/versions
Per Cederqvist's avatar
Per Cederqvist committed
172
	echo '/* Do not edit -- automatically generated file */'   > $@.tmp
173
174
175
	echo '#ifdef HAVE_CONFIG_H'                                >>$@.tmp
	echo '#  include <config.h>'                               >>$@.tmp
	echo '#endif'                                              >>$@.tmp
Per Cederqvist's avatar
Per Cederqvist committed
176
177
178
179
180
181
	echo '#include <limits.h>'                                 >>$@.tmp
	echo '#include <sys/types.h>'                              >>$@.tmp
	echo '#include "misc-types.h"'                             >>$@.tmp
	echo '#include "s-string.h"'                               >>$@.tmp
	echo '#include "kom-types.h"'                              >>$@.tmp
	echo '#include "version-info.h"'                           >>$@.tmp
182
	echo 'const Version_info_internal kom_version_info = {'    >>$@.tmp
Per Cederqvist's avatar
Per Cederqvist committed
183
184
185
186
187
188
189
	sed -n 's/PROTOCOL-A-LEVEL: \(.*\)/    \1,/p' \
		$(top_srcdir)/versions                               >>$@.tmp
	sed -n 's/SERVER-SOFTWARE: \(.*\)/    "\1",/p' \
		$(top_srcdir)/versions                               >>$@.tmp
	sed -n 's/SERVER-VERSION: \(.*\)/    "\1"/p' \
		$(top_srcdir)/versions                               >>$@.tmp
	echo '};'                                                  >>$@.tmp
Per Cederqvist's avatar
Per Cederqvist committed
190
	echo '/* Do not edit -- automatically generated file */'   >>$@.tmp
Per Cederqvist's avatar
Per Cederqvist committed
191
192
	mv $@.tmp $@

Per Cederqvist's avatar
Per Cederqvist committed
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
aux.h: $(top_srcdir)/run-support/aux-items.conf Makefile
	$(RM) $@ $@.tmp
	echo '/* Do not edit -- automatically generated file */'    >>$@.tmp
	echo '#ifndef AUX_H_INCLUDED'				    >>$@.tmp
	echo '#define AUX_H_INCLUDED'				    >>$@.tmp
	echo 'enum aux_no {'					    >>$@.tmp
	LC_ALL=C LC_CTYPE=C LANG=C sed \
	    -e '/^#/d' \
	    -e '/^{/,/^}/d' \
	    -e 's/^\([0-9]*\) : \([a-z\-]*\) .*/aux_\2 \1/' \
	    -e '/^ *$$/d' \
	    -e 'y/-/_/' \
	    < $(top_srcdir)/run-support/aux-items.conf \
	| awk '{printf "    %-25s = %5s,\n", $$1, $$2}'		    >>$@.tmp
	echo '};'						    >>$@.tmp
	echo '#endif'						    >>$@.tmp
	echo '/* Do not edit -- automatically generated file */'    >>$@.tmp
210
211
	chmod 444 $@.tmp
	mv -f $@.tmp $@
Per Cederqvist's avatar
Per Cederqvist committed
212
213


Per Cederqvist's avatar
Per Cederqvist committed
214
215
216
217
218
219
220
221
.gdbinit:
	$(RM) -f .gdbinit
	echo handle 13 nostop noprint 			>.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

Per Cederqvist's avatar
Per Cederqvist committed
222
223
224
225
226
227
check-lyskomd: libcheck.a lyskomd dbck
	cd testsuite && $(MAKE) check-lyskomd

check-leaks: libcheck.a lyskomd dbck
	cd testsuite && $(MAKE) check-leaks

Per Cederqvist's avatar
Per Cederqvist committed
228
229
230
# Make sure these gets recompiled if $(prefix) changes.
server-config.o: Makefile
updateLysKOM.o: Makefile
231

232
233
234
# This dependency is needed after a "make maintainer-clean".
aux-item-def-scan.o: aux-item-def-parse.h

235
# 
236
237
all-recursive: lyskomd$(EXEEXT) dbck$(EXEEXT)
check-recursive: libcheck.a lyskomd$(EXEEXT) dbck$(EXEEXT)