Make-template 9.31 KB
Newer Older
Kurt Zeilenga's avatar
Kurt Zeilenga committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#-----------------------------------------------------------------------------
# Copyright (c) 1995 Regents of the University of Michigan.
# All rights reserved.
#
# Redistribution and use in source and binary forms are permitted
# provided that this notice is preserved and that due credit is given
# to the University of Michigan at Ann Arbor. The name of the University
# may not be used to endorse or promote products derived from this
# software without specific prior written permission. This software
# is provided ``as is'' without express or implied warranty.
#
#       Stand alone LDAP server daemon makefile
#
#-----------------------------------------------------------------------------
LDAPSRC	= ../..
HDIR	= $(LDAPSRC)/include
LDIR	= $(LDAPSRC)/libraries
VERSIONFILE = $(LDAPSRC)/build/version

SRCS	= main.c daemon.c connection.c search.c filter.c add.c charray.c \
		attr.c entry.c config.c backend.c result.c operation.c \
		dn.c compare.c modify.c delete.c modrdn.c ch_malloc.c \
		value.c ava.c bind.c unbind.c abandon.c filterentry.c \
		phonetic.c regex.c acl.c str2filter.c aclparse.c init.c \
		detach.c strdup.c tempnam.c repl.c lock.c \
		schema.c schemaparse.c monitor.c configinfo.c
OBJS	= main.o daemon.o connection.o search.o filter.o add.o charray.o \
		attr.o entry.o config.o backend.o result.o operation.o \
		dn.o compare.o modify.o delete.o modrdn.o ch_malloc.o \
		value.o ava.o bind.o unbind.o abandon.o filterentry.o \
		phonetic.o regex.o acl.o str2filter.o aclparse.o init.o \
		detach.o strdup.o tempnam.o repl.o lock.o \
		schema.o schemaparse.o monitor.o configinfo.o

INCLUDES= -I. -I$(HDIR) $(KRBINCLUDEFLAG)
36
DEFINES = $(DEFS) $(LDAP_CRYPT) $(LDAP_TCP_WRAPPERS) $(SERVERDEFS)
Kurt Zeilenga's avatar
Kurt Zeilenga committed
37
38
39
CFLAGS	= $(INCLUDES) $(THREADSINCLUDE) $(DEFINES) $(ACFLAGS) $(THREADS)
LDFLAGS	= -L$(LDIR) $(KRBLIBFLAG)
LIBS	= $(KRBLIBS) -llber -lldbm -lavl -llthread -lldif $(THREADSLIB) \
40
		$(LDBMLIB) $(LDAP_CRYPT_LIB) $(LDAP_TCP_WRAPPERS_LIB) $(ALIBS)
Kurt Zeilenga's avatar
Kurt Zeilenga committed
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170

all: FORCE
	@if [ -z "$(MAKESLAPD)" ]; then \
		echo "uncomment the MAKESLAPD line in Make-common to make slapd"; \
		exit 0; \
	else \
		echo; \
		$(MAKE) $(MFLAGS) backendslib; \
		$(MAKE) $(MFLAGS) slapd; \
		(cd tools; $(MAKE) $(MFLAGS) all); \
	fi

backendslib:	FORCE
	@for i in back-*; do \
		if [ -d $$i ]; then \
			echo; echo "  cd $$i; $(MAKE) $(MFLAGS) all"; \
			( cd $$i; $(MAKE) $(MFLAGS) all ); \
		fi; \
	done; \
	echo; \
	$(MAKE) $(MFLAGS) libbackends.a

libbackends.a: .backend
	@$(RM) -r tmp
	@$(MKDIR) tmp
	@-for i in back-*/*.a; do \
		( \
		  cd tmp; \
		  $(AR) x ../$$i; \
		  pre=`echo $$i | sed -e 's/\/.*$$//' -e 's/back-//'`; \
		  for j in *.o; do \
			mv $$j $${pre}$$j; \
		  done; \
		  $(AR) ruv libbackends.a *.o 2>&1 | grep -v truncated; \
		  $(RM) *.o __.SYMDEF; \
		  echo "added backend library $$i"; \
		); \
	done
	@mv -f tmp/libbackends.a ./libbackends.a
	@$(RM) -r tmp
	@if [ ! -z "$(RANLIB)" ]; then \
		$(RANLIB) libbackends.a; \
	fi
	@ls -l libbackends.a

slapd: version.o
	$(CC) $(ALDFLAGS) -o slapd $(OBJS) version.o libbackends.a \
		$(LDFLAGS) $(LIBS)
slapd.pure: version.o
	purify $(CC) $(ALDFLAGS) -o slapd.pure $(OBJS) version.o libbackends.a \
		$(LDFLAGS) $(LIBS)

version.c: libbackends.a $(OBJS) $(LDIR)/liblber/liblber.a \
		$(LDIR)/libldbm/libldbm.a $(LDIR)/liblthread/liblthread.a \
		$(LDIR)/libavl/libavl.a $(LDIR)/libldif/libldif.a
	$(RM) $@
	(u=$${USER-root} v=`$(CAT) $(VERSIONFILE)` d=`$(PWD)` h=`$(HOSTNAME)` \
	t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \
	-e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \
	-e "s|%VERSION%|$${v}|" \
	< Version.c > $@)

install: all $(ETCDIR) $(ETCDIR)/slapd $(ETCDIR)/slapd.conf \
		$(ETCDIR)/slapd.at.conf $(ETCDIR)/slapd.oc.conf \
		install-tools

$(ETCDIR)/slapd:	slapd
	$(INSTALL) $(INSTALLFLAGS) -m 755 slapd $(ETCDIR)

$(ETCDIR)/slapd.conf:	slapd.conf
	$(SED) -e 's;%ETCDIR%;$(RUNTIMEETCDIR);' slapd.conf > /tmp/slapd.$$
	-$(MV) $(ETCDIR)/slapd.conf $(ETCDIR)/slapd.conf-
	$(INSTALL) $(INSTALLFLAGS) -m 644 /tmp/slapd.$$ $(ETCDIR)/slapd.conf
	$(RM) -f /tmp/slapd.$$

$(ETCDIR)/slapd.at.conf:	slapd.at.conf
	-$(MV) $(ETCDIR)/slapd.at.conf $(ETCDIR)/slapd.at.conf-
	$(INSTALL) $(INSTALLFLAGS) -m 644 slapd.at.conf $(ETCDIR)

$(ETCDIR)/slapd.oc.conf:	slapd.oc.conf
	-$(MV) $(ETCDIR)/slapd.oc.conf $(ETCDIR)/slapd.oc.conf-
	$(INSTALL) $(INSTALLFLAGS) -m 644 slapd.oc.conf $(ETCDIR)

install-tools: FORCE
	(cd tools; $(MAKE) $(MFLAGS) install)

lint:	FORCE
	$(LINT) $(INCLUDES) $(DEFINES) $(SRCS)

5lint:	FORCE
	$(5LINT) $(INCLUDES) $(DEFINES) $(SRCS)

clean:	FORCE
	@echo "making clean in `$(PWD)`"
	$(RM) slapd slapd.pure *.o core a.out version.c libbackends.a .backend
	@for i in back-* tools; do \
		if [ -d $$i -a $$i != "RCS" ]; then \
		echo; echo "  cd $$i; $(MAKE) $(MFLAGS) clean"; \
		( cd $$i; $(MAKE) $(MFLAGS) clean ); \
		fi; \
	done

depend:	FORCE
	$(MKDEP) $(INCLUDES) $(DEFINES) $(SRCS)
	@for i in back-* tools; do \
		if [ -d $$i -a $$i != "RCS" ]; then \
		echo; echo "  cd $$i; $(MAKE) $(MFLAGS) depend"; \
		( cd $$i; $(MAKE) $(MFLAGS) depend ); \
		fi; \
	done


links:
	@echo "making links in `$(PWD)`"
	@$(LN) .src/*.[ch] .src/*.conf .
	@touch .backend
	@for i in .src/back-* .src/tools; do \
	    if [ -d $$i -a $$i != ".src/RCS" ]; then \
		d=`basename $$i`; \
		( $(MKDIR) $$d; cd $$d; $(LN) ../.src/$$d .src; \
		  $(LN) ../.src/$$d/Make-template . ; \
		  $(MAKE) $(MFLAGS) MKDIR="$(MKDIR)" LN="$(LN)" \
		    -f Make-template links ) ; \
	    fi; \
	done; 


# DO NOT DELETE THIS LINE -- mkdep uses it.
# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.

171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
main.o: main.c ../../include/portable.h ../../include/avl.h
main.o: ../../include/ldap.h ../../include/lthread.h ../../include/ldapconfig.h
daemon.o: daemon.c ../../include/avl.h ../../include/ldap.h
daemon.o: ../../include/lthread.h ../../include/portable.h
connection.o: connection.c ../../include/portable.h ../../include/avl.h
connection.o: ../../include/ldap.h ../../include/lthread.h
search.o: search.c ../../include/proto-lber.h ../../include/proto-ldap.h
search.o: ../../include/ldif.h
filter.o: filter.c ../../include/proto-lber.h ../../include/proto-ldap.h
filter.o: ../../include/ldif.h
add.o: add.c ../../include/avl.h ../../include/ldap.h
add.o: ../../include/proto-ldap.h ../../include/ldif.h
charray.o: charray.c ../../include/proto-lber.h ../../include/proto-ldap.h
charray.o: ../../include/ldif.h
attr.o: attr.c ../../include/proto-lber.h ../../include/proto-ldap.h
Kurt Zeilenga's avatar
Kurt Zeilenga committed
186
attr.o: ../../include/ldif.h
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
entry.o: entry.c ../../include/avl.h ../../include/ldap.h
entry.o: ../../include/lthread.h
config.o: config.c ../../include/proto-lber.h ../../include/proto-ldap.h
config.o: ../../include/ldif.h
backend.o: backend.c ../../include/avl.h ../../include/ldap.h
backend.o: ../../include/lthread.h
result.o: result.c ../../include/portable.h ../../include/avl.h
result.o: ../../include/ldap.h ../../include/lthread.h
operation.o: operation.c ../../include/proto-lber.h ../../include/proto-ldap.h
operation.o: ../../include/ldif.h
dn.o: dn.c ../../include/portable.h ../../include/avl.h ../../include/ldap.h
dn.o: ../../include/lthread.h
compare.o: compare.c ../../include/avl.h ../../include/ldap.h
compare.o: ../../include/lthread.h
modify.o: modify.c ../../include/avl.h ../../include/ldap.h
modify.o: ../../include/proto-ldap.h ../../include/ldif.h
delete.o: delete.c ../../include/proto-lber.h ../../include/proto-ldap.h
delete.o: ../../include/ldif.h
modrdn.o: modrdn.c ../../include/proto-lber.h ../../include/proto-ldap.h
modrdn.o: ../../include/ldif.h
ch_malloc.o: ch_malloc.c ../../include/avl.h ../../include/ldap.h
ch_malloc.o: ../../include/lthread.h
value.o: value.c ../../include/portable.h ../../include/avl.h
value.o: ../../include/ldap.h ../../include/lthread.h
ava.o: ava.c ../../include/proto-lber.h ../../include/proto-ldap.h
ava.o: ../../include/ldif.h
bind.o: bind.c ../../include/proto-lber.h ../../include/proto-ldap.h
bind.o: ../../include/ldif.h
unbind.o: unbind.c ../../include/avl.h ../../include/ldap.h
unbind.o: ../../include/lthread.h
abandon.o: abandon.c ../../include/avl.h ../../include/ldap.h
abandon.o: ../../include/lthread.h
filterentry.o: filterentry.c ../../include/proto-lber.h
filterentry.o: ../../include/proto-ldap.h ../../include/ldif.h
phonetic.o: phonetic.c ../../include/portable.h ../../include/avl.h
phonetic.o: ../../include/ldap.h ../../include/lthread.h
regex.o: regex.c
acl.o: acl.c slap.h ../../include/proto-lber.h ../../include/proto-ldap.h
Kurt Zeilenga's avatar
Kurt Zeilenga committed
225
acl.o: ../../include/ldif.h
226
227
228
229
230
231
232
str2filter.o: str2filter.c ../../include/avl.h ../../include/ldap.h
str2filter.o: ../../include/lthread.h
aclparse.o: aclparse.c slap.h ../../include/proto-lber.h
aclparse.o: ../../include/proto-ldap.h ../../include/ldif.h
init.o: init.c ../../include/portable.h ../../include/avl.h
init.o: ../../include/ldap.h ../../include/lthread.h
detach.o: detach.c
Kurt Zeilenga's avatar
Kurt Zeilenga committed
233
234
strdup.o: strdup.c
tempnam.o: tempnam.c
235
236
237
238
239
240
241
242
243
244
repl.o: repl.c ../../include/proto-lber.h ../../include/lthread.h
lock.o: lock.c ../../include/avl.h ../../include/ldap.h ../../include/lthread.h
schema.o: schema.c ../../include/proto-lber.h ../../include/proto-ldap.h
schema.o: ../../include/ldif.h
schemaparse.o: schemaparse.c ../../include/avl.h ../../include/ldap.h
schemaparse.o: ../../include/lthread.h
monitor.o: monitor.c ../../include/avl.h ../../include/ldap.h
monitor.o: ../../include/proto-ldap.h ../../include/ldif.h
configinfo.o: configinfo.c ../../include/avl.h ../../include/ldap.h
configinfo.o: ../../include/lthread.h ../../include/ldapconfig.h
Kurt Zeilenga's avatar
Kurt Zeilenga committed
245
246

# IF YOU PUT ANYTHING HERE IT WILL GO AWAY