Makefile.src 6.58 KB
Newer Older
Per Cederqvist's avatar
Per Cederqvist committed
1
#
Per Cederqvist's avatar
Per Cederqvist committed
2
# $Id: Makefile.src,v 1.25 1996/02/25 20:37:54 ceder Exp $
3
# Copyright (C) 1991, 1993, 1994, 1995  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
28
LIBS = @LIBS@
KOMLIBS = $(LIBDIR)/libisc-new$(PROFILE-LIB-SUFFIX).a \
29
30
31
	$(LIBDIR)/libmisc$(PROFILE-LIB-SUFFIX).a \
	$(LIBDIR)/liblyskom-server$(PROFILE-LIB-SUFFIX).a \
	$(LIBDIR)/libansi$(PROFILE-LIB-SUFFIX).a \
32
	$(LIBDIR)/libregex.a
Per Cederqvist's avatar
Per Cederqvist committed
33

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

Per Cederqvist's avatar
Per Cederqvist committed
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# 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 \
	regex-match.o

# 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) \
52
53
	  internal-connections.o rfc931.o isc-malloc.o \
	  conf-file.o
Per Cederqvist's avatar
Per Cederqvist committed
54
55
56
57

# Files for lyskomd.

DISKOBJS = ramkomd.o ram-smalloc.o simple-cache.o ram-parse.o ram-output.o \
58
	disk-end-of-atomic.o cache-node.o string-malloc.o version-info.o
Per Cederqvist's avatar
Per Cederqvist committed
59

60
# Files for dbck.
Per Cederqvist's avatar
Per Cederqvist committed
61

Per Cederqvist's avatar
Per Cederqvist committed
62
GETOPT = getopt.o getopt1.o
Per Cederqvist's avatar
Per Cederqvist committed
63
64
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
65
	ram-output.o memory.o conf-file.o $(GETOPT) version-info.o
Per Cederqvist's avatar
Per Cederqvist committed
66

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

70
ENCRYPT = encrypt-passwd.o dbck-cache.o ram-smalloc.o ram-parse.o \
71
	server-config.o\
Per Cederqvist's avatar
Per Cederqvist committed
72
73
74
	kom-types.o\
	ram-output.o memory.o

75
C_SPECIALS = prot-a-parse-arg.c version-info.c
76
77
78

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

82
PROGRAMS = lyskomd dbck updateLysKOM
Per Cederqvist's avatar
Per Cederqvist committed
83

84
lyskomd: $(DISKOBJS) $(GENOBJS) $(KOMLIBS)
85
86
	$(CC) $(LDFLAGS) -o lyskomd $(DISKOBJS) $(GENOBJS) $(KOMLIBS) \
		$(MALLOCLIB) $(LIBS)
Per Cederqvist's avatar
Per Cederqvist committed
87

88
updateLysKOM: updateLysKOM.o $(KOMLIBS)
89
90
	$(CC) $(LDFLAGS) -o updateLysKOM updateLysKOM.o $(KOMLIBS) \
		$(MALLOCLIB) $(LIBS)
91

92
encrypt: $(ENCRYPT) $(KOMLIBS)
93
94
	$(CC) $(LDFLAGS) -o enrypt $(ENCRYPT) $(KOMLIBS) \
		$(MALLOCLIB) $(LIBS)
Per Cederqvist's avatar
Per Cederqvist committed
95

96
dbck: $(DBCK) $(KOMLIBS)
97
98
	$(CC) $(LDFLAGS) -o dbck $(DBCK) $(KOMLIBS) \
		$(MALLOCLIB) $(LIBS)
Per Cederqvist's avatar
Per Cederqvist committed
99
100

call-switch.incl: call-switch.awk fncdef-no-str-limit.txt
Per Cederqvist's avatar
Per Cederqvist committed
101
102
	$(AWK) -f $(srcdir)/call-switch.awk fncdef-no-str-limit.txt \
		> call-switch.incl
Per Cederqvist's avatar
Per Cederqvist committed
103
104

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

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

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
112
113
	$(AWK) -f $(srcdir)/prot-a-parse-arg-c.awk $(srcdir)/fncdef.txt \
		> prot-a-parse-arg.c
Per Cederqvist's avatar
Per Cederqvist committed
114
115

prot-a-parse-arg.h: prot-a-parse-arg-h.awk fncdef-no-str-limit.txt
Per Cederqvist's avatar
Per Cederqvist committed
116
117
	$(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
118
119
120

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
121
122
	  cat $(srcdir)/fncdef.txt) \
	| sed 's/([^)]*)//g' > fncdef-no-str-limit.txt
Per Cederqvist's avatar
Per Cederqvist committed
123

124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
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
149
150
151
.gdbinit: Makefile
	$(RM) -f .gdbinit
	echo handle 13 nostop noprint 			>.gdbinit
152
153
	echo dir @SRCTOPDIR@/src/libraries/libcommon	>>.gdbinit
	echo dir @SRCTOPDIR@/src/libraries/libansi	>>.gdbinit
154
	echo dir @SRCTOPDIR@/src/libraries/libisc-new	>>.gdbinit
155
	echo dir @SRCTOPDIR@/src/libraries/libmisc	>>.gdbinit
156
	echo dir @SRCTOPDIR@/src/libraries/gnumalloc	>>.gdbinit
Per Cederqvist's avatar
Per Cederqvist committed
157
158
159

tags:
	$(RM) TAGS
160
	etags $(INCLUDEDIR)/*.h $(srcdir)/*.h \
161
162
		@SRCTOPDIR@/src/libraries/libisc-new/src/*.h \
		@SRCTOPDIR@/src/libraries/lib*/*.h \
163
		$(srcdir)/*.c \
164
165
		@SRCTOPDIR@/src/libraries/libisc-new/src/*.c \
		@SRCTOPDIR@/src/libraries/lib*/*.c
166

167
server-config.o: Makefile
168
169
	$(CC) -c $(CPPFLAGS) -DDEFAULT_PREFIX='"$(prefix)"' $(ALL_CFLAGS) \
		$(srcdir)/server-config.c
170
171
172
173

updateLysKOM.o: Makefile
	$(CC) -c $(CPPFLAGS) -DDEFAULT_PREFIX='"$(prefix)"' $(ALL_CFLAGS) \
		$(srcdir)/updateLysKOM.c
174
]
175
176
define([preinstall],[[$(PROGRAMS)]])dnl
define([doinstall],
177
178
179
[[	for i in $(PROGRAMS); do \
	    $(INSTALL_PROGRAM) $$i $(bindir)/$$i; \
	done
180
181
182
183
]])dnl end of doinstall
dnl
define([prebinaries],[[$(PROGRAMS)]])dnl
dnl
184
185
186
define([domostlyclean],
LK_QUOTE(domostlyclean)LK_cmd([[$(RM) $(SPECIALS)]]))dnl
dnl
187
LK_INSTALL_BUILT_HDRS([com.h])
188
LK_ALL_C_DEPEND
Per Cederqvist's avatar
Per Cederqvist committed
189
define([predepend],[[$(SPECIALS)]])dnl
190
LK_DESCEND