Makefile.src 6.91 KB
Newer Older
Per Cederqvist's avatar
Per Cederqvist committed
1
#
2
# $Id: Makefile.src,v 1.31 1998/06/14 14:50:31 byers Exp $
Per Cederqvist's avatar
Per Cederqvist committed
3
# Copyright (C) 1991, 1993, 1994, 1995, 1996  Lysator Academic Computer Association.
Per Cederqvist's avatar
Per Cederqvist committed
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
LK_STD([includes binaries])
26
[
27
LIBS = @LIBS@
28
29
BISON = @BISON@
FLEX = @FLEX@
30
KOMLIBS = $(LIBDIR)/libisc-new$(PROFILE-LIB-SUFFIX).a \
31
32
	$(LIBDIR)/libmisc$(PROFILE-LIB-SUFFIX).a \
	$(LIBDIR)/liblyskom-server$(PROFILE-LIB-SUFFIX).a \
33
34
	$(LIBDIR)/libregex.a \
	$(LIBDIR)/libansi$(PROFILE-LIB-SUFFIX).a
Per Cederqvist's avatar
Per Cederqvist committed
35

36
37
MALLOCLIB=`if [ "@GNUMALLOC@" = gnumalloc ];then echo $(LIBDIR)/libgmalloc$(PROFILE-LIB-SUFFIX).a;fi`

Per Cederqvist's avatar
Per Cederqvist committed
38
39
40
41
42
43
44
45
46
# Files that implements protocol A.
PROTA =  prot-a-output.o prot-a-parse-arg.o prot-a-parse.o prot-a.o \
	 prot-a-send-async.o

MUX = mux.o mux-parse.o

# Implementations of the atomic calls.

ATOMS = text.o membership.o person.o conference.o session.o admin.o \
47
	regex-match.o aux-items.o
Per Cederqvist's avatar
Per Cederqvist committed
48
49
50
51
52
53

# These files are needed by all versions of the LysKOM server.
GENOBJS = connections.o log.o $(ATOMS) \
          kom-types.o \
          send-async.o server-config.o text-garb.o \
          isc-parse.o memory.o $(PROTA) $(MUX) \
54
	  internal-connections.o rfc931.o isc-malloc.o \
55
	  conf-file.o local-to-global.o 
56

Per Cederqvist's avatar
Per Cederqvist committed
57
58
59
60

# Files for lyskomd.

DISKOBJS = ramkomd.o ram-smalloc.o simple-cache.o ram-parse.o ram-output.o \
61
62
	disk-end-of-atomic.o cache-node.o string-malloc.o version-info.o \
        aux-item-def.tab.o aux-item-def.lex.o
Per Cederqvist's avatar
Per Cederqvist committed
63

64
# Files for dbck.
Per Cederqvist's avatar
Per Cederqvist committed
65

Per Cederqvist's avatar
Per Cederqvist committed
66
GETOPT = getopt.o getopt1.o
Per Cederqvist's avatar
Per Cederqvist committed
67
68
DBCK = dbck.o dbck-cache.o ram-smalloc.o ram-parse.o server-config.o\
	kom-types.o\
Per Cederqvist's avatar
Per Cederqvist committed
69
	ram-output.o memory.o conf-file.o $(GETOPT) version-info.o
Per Cederqvist's avatar
Per Cederqvist committed
70

71
72
# Files for encrypt (a program to transform the database from unencrypted
# apasswords to encrypted).  No longer supported.
Per Cederqvist's avatar
Per Cederqvist committed
73

74
ENCRYPT = encrypt-passwd.o dbck-cache.o ram-smalloc.o ram-parse.o \
75
	server-config.o\
Per Cederqvist's avatar
Per Cederqvist committed
76
77
78
	kom-types.o\
	ram-output.o memory.o

79
C_SPECIALS = prot-a-parse-arg.c version-info.c
80
81
82

SPECIALS = call-switch.incl com.h fnc-def-init.incl \
	prot-a-parse-arg.h fncdef-no-str-limit.txt .gdbinit \
83
	version.incl \
84
	$(C_SPECIALS)
Per Cederqvist's avatar
Per Cederqvist committed
85

86
PROGRAMS = lyskomd dbck updateLysKOM
Per Cederqvist's avatar
Per Cederqvist committed
87

88
lyskomd: $(DISKOBJS) $(GENOBJS) $(KOMLIBS)
89
90
	$(PURIFY) $(CC) $(LDFLAGS) -o lyskomd $(DISKOBJS) $(GENOBJS) \
		$(KOMLIBS) \
91
		$(MALLOCLIB) $(LIBS)
Per Cederqvist's avatar
Per Cederqvist committed
92

93
updateLysKOM: updateLysKOM.o $(KOMLIBS)
94
	$(PURIFY) $(CC) $(LDFLAGS) -o updateLysKOM updateLysKOM.o $(KOMLIBS) \
95
		$(MALLOCLIB) $(LIBS)
96

97
encrypt: $(ENCRYPT) $(KOMLIBS)
98
99
	$(CC) $(LDFLAGS) -o enrypt $(ENCRYPT) $(KOMLIBS) \
		$(MALLOCLIB) $(LIBS)
Per Cederqvist's avatar
Per Cederqvist committed
100

101
dbck: $(DBCK) $(KOMLIBS)
102
	$(PURIFY) $(CC) $(LDFLAGS) -o dbck $(DBCK) $(KOMLIBS) \
103
		$(MALLOCLIB) $(LIBS)
Per Cederqvist's avatar
Per Cederqvist committed
104
105

call-switch.incl: call-switch.awk fncdef-no-str-limit.txt
Per Cederqvist's avatar
Per Cederqvist committed
106
107
	$(AWK) -f $(srcdir)/call-switch.awk fncdef-no-str-limit.txt \
		> call-switch.incl
Per Cederqvist's avatar
Per Cederqvist committed
108
109

com.h: com-h.awk fncdef-no-str-limit.txt
Per Cederqvist's avatar
Per Cederqvist committed
110
	$(AWK) -f $(srcdir)/com-h.awk fncdef-no-str-limit.txt > com.h
Per Cederqvist's avatar
Per Cederqvist committed
111
112

fnc-def-init.incl: fnc-def-init.awk fncdef-no-str-limit.txt
Per Cederqvist's avatar
Per Cederqvist committed
113
114
	$(AWK) -f $(srcdir)/fnc-def-init.awk fncdef-no-str-limit.txt \
		> fnc-def-init.incl
Per Cederqvist's avatar
Per Cederqvist committed
115

116
aux-item-def.tab.c: aux-item-def.y
117
	$(BISON) -d -p aux_item_def_ -o aux-item-def.tab.c aux-item-def.y
118
119
120
121

aux-item-def.lex.c: aux-item-def.l
	$(FLEX) -oaux-item-def.lex.c aux-item-def.l

Per Cederqvist's avatar
Per Cederqvist committed
122
prot-a-parse-arg.c: prot-a-parse-arg-c.awk fncdef.txt prot-a-parse-arg.h
Per Cederqvist's avatar
Per Cederqvist committed
123
124
	$(AWK) -f $(srcdir)/prot-a-parse-arg-c.awk $(srcdir)/fncdef.txt \
		> prot-a-parse-arg.c
Per Cederqvist's avatar
Per Cederqvist committed
125
126

prot-a-parse-arg.h: prot-a-parse-arg-h.awk fncdef-no-str-limit.txt
Per Cederqvist's avatar
Per Cederqvist committed
127
128
	$(AWK) -f $(srcdir)/prot-a-parse-arg-h.awk \
		fncdef-no-str-limit.txt > prot-a-parse-arg.h
Per Cederqvist's avatar
Per Cederqvist committed
129
130
131

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

135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
version.incl: @SRCTOPDIR@/versions
	echo '/* Do not edit -- automaticaly generated file */'     > $@.tmp
	sed -n 's/SERVER-COMPAT-VERSION: //p' @SRCTOPDIR@/versions  >>$@.tmp
	echo '/* Do not edit -- automaticaly generated file */'     >>$@.tmp
	mv $@.tmp $@

version-info.c: @SRCTOPDIR@/versions
	echo '/* Do not edit -- automaticaly generated file */'    > $@.tmp
	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
	echo 'Version_info_internal kom_version_info = {'          >>$@.tmp
	sed -n 's/PROTOCOL-A-LEVEL: \(.*\)/    \1,/p' \
		@SRCTOPDIR@/versions                               >>$@.tmp
	sed -n 's/SERVER-SOFTWARE: \(.*\)/    "\1",/p' \
		@SRCTOPDIR@/versions                               >>$@.tmp
	sed -n 's/SERVER-VERSION: \(.*\)/    "\1"/p' \
		@SRCTOPDIR@/versions                               >>$@.tmp
	echo '};'                                                  >>$@.tmp
	echo '/* Do not edit -- automaticaly generated file */'    >>$@.tmp
	mv $@.tmp $@

Per Cederqvist's avatar
Per Cederqvist committed
160
161
162
.gdbinit: Makefile
	$(RM) -f .gdbinit
	echo handle 13 nostop noprint 			>.gdbinit
163
164
	echo dir @SRCTOPDIR@/src/libraries/libcommon	>>.gdbinit
	echo dir @SRCTOPDIR@/src/libraries/libansi	>>.gdbinit
165
	echo dir @SRCTOPDIR@/src/libraries/libisc-new	>>.gdbinit
166
	echo dir @SRCTOPDIR@/src/libraries/libmisc	>>.gdbinit
167
	echo dir @SRCTOPDIR@/src/libraries/gnumalloc	>>.gdbinit
Per Cederqvist's avatar
Per Cederqvist committed
168
169
170

tags:
	$(RM) TAGS
171
	etags $(INCLUDEDIR)/*.h $(srcdir)/*.h \
172
173
		@SRCTOPDIR@/src/libraries/libisc-new/src/*.h \
		@SRCTOPDIR@/src/libraries/lib*/*.h \
174
		$(srcdir)/*.c \
175
176
		@SRCTOPDIR@/src/libraries/libisc-new/src/*.c \
		@SRCTOPDIR@/src/libraries/lib*/*.c
177

178
server-config.o: Makefile
179
180
	$(CC) -c $(CPPFLAGS) -DDEFAULT_PREFIX='"$(prefix)"' $(ALL_CFLAGS) \
		$(srcdir)/server-config.c
181
182
183
184

updateLysKOM.o: Makefile
	$(CC) -c $(CPPFLAGS) -DDEFAULT_PREFIX='"$(prefix)"' $(ALL_CFLAGS) \
		$(srcdir)/updateLysKOM.c
185
]
186
187
define([preinstall],[[$(PROGRAMS)]])dnl
define([doinstall],
188
189
190
[[	for i in $(PROGRAMS); do \
	    $(INSTALL_PROGRAM) $$i $(bindir)/$$i; \
	done
191
192
193
194
]])dnl end of doinstall
dnl
define([prebinaries],[[$(PROGRAMS)]])dnl
dnl
195
196
197
define([domostlyclean],
LK_QUOTE(domostlyclean)LK_cmd([[$(RM) $(SPECIALS)]]))dnl
dnl
198
LK_INSTALL_BUILT_HDRS([com.h])
199
LK_ALL_C_DEPEND
Per Cederqvist's avatar
Per Cederqvist committed
200
define([predepend],[[$(SPECIALS)]])dnl
201
LK_DESCEND