1 #-----------------------------------------------------------------------------
2 # Copyright (c) 1995 Regents of the University of Michigan.
5 # Redistribution and use in source and binary forms are permitted
6 # provided that this notice is preserved and that due credit is given
7 # to the University of Michigan at Ann Arbor. The name of the University
8 # may not be used to endorse or promote products derived from this
9 # software without specific prior written permission. This software
10 # is provided ``as is'' without express or implied warranty.
12 # Stand alone LDAP server daemon makefile
14 #-----------------------------------------------------------------------------
16 HDIR = $(LDAPSRC)/include
17 LDIR = $(LDAPSRC)/libraries
18 VERSIONFILE = $(LDAPSRC)/build/version
20 SRCS = main.c daemon.c connection.c search.c filter.c add.c charray.c \
21 attr.c entry.c config.c backend.c result.c operation.c \
22 dn.c compare.c modify.c delete.c modrdn.c ch_malloc.c \
23 value.c ava.c bind.c unbind.c abandon.c filterentry.c \
24 phonetic.c regex.c acl.c str2filter.c aclparse.c init.c \
25 detach.c strdup.c tempnam.c repl.c lock.c \
26 schema.c schemaparse.c monitor.c configinfo.c
27 OBJS = main.o daemon.o connection.o search.o filter.o add.o charray.o \
28 attr.o entry.o config.o backend.o result.o operation.o \
29 dn.o compare.o modify.o delete.o modrdn.o ch_malloc.o \
30 value.o ava.o bind.o unbind.o abandon.o filterentry.o \
31 phonetic.o regex.o acl.o str2filter.o aclparse.o init.o \
32 detach.o strdup.o tempnam.o repl.o lock.o \
33 schema.o schemaparse.o monitor.o configinfo.o
35 INCLUDES= -I. -I$(HDIR) $(KRBINCLUDEFLAG)
36 DEFINES = $(DEFS) $(SERVERDEFS)
37 CFLAGS = $(INCLUDES) $(THREADSINCLUDE) $(DEFINES) $(ACFLAGS) $(THREADS)
38 LDFLAGS = -L$(LDIR) $(KRBLIBFLAG)
39 LIBS = $(KRBLIBS) -llber -lldbm -lavl -llthread -lldif $(THREADSLIB) \
43 @if [ -z "$(MAKESLAPD)" ]; then \
44 echo "uncomment the MAKESLAPD line in Make-common to make slapd"; \
48 $(MAKE) $(MFLAGS) backendslib; \
49 $(MAKE) $(MFLAGS) slapd; \
50 (cd tools; $(MAKE) $(MFLAGS) all); \
54 @for i in back-*; do \
56 echo; echo " cd $$i; $(MAKE) $(MFLAGS) all"; \
57 ( cd $$i; $(MAKE) $(MFLAGS) all ); \
61 $(MAKE) $(MFLAGS) libbackends.a
63 libbackends.a: .backend
66 @-for i in back-*/*.a; do \
70 pre=`echo $$i | sed -e 's/\/.*$$//' -e 's/back-//'`; \
74 $(AR) ruv libbackends.a *.o 2>&1 | grep -v truncated; \
75 $(RM) *.o __.SYMDEF; \
76 echo "added backend library $$i"; \
79 @mv -f tmp/libbackends.a ./libbackends.a
81 @if [ ! -z "$(RANLIB)" ]; then \
82 $(RANLIB) libbackends.a; \
87 $(CC) $(ALDFLAGS) -o slapd $(OBJS) version.o libbackends.a \
90 purify $(CC) $(ALDFLAGS) -o slapd.pure $(OBJS) version.o libbackends.a \
93 version.c: libbackends.a $(OBJS) $(LDIR)/liblber/liblber.a \
94 $(LDIR)/libldbm/libldbm.a $(LDIR)/liblthread/liblthread.a \
95 $(LDIR)/libavl/libavl.a $(LDIR)/libldif/libldif.a
97 (u=$${USER-root} v=`$(CAT) $(VERSIONFILE)` d=`$(PWD)` h=`$(HOSTNAME)` \
98 t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \
99 -e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \
100 -e "s|%VERSION%|$${v}|" \
103 install: all $(ETCDIR) $(ETCDIR)/slapd $(ETCDIR)/slapd.conf \
104 $(ETCDIR)/slapd.at.conf $(ETCDIR)/slapd.oc.conf \
107 $(ETCDIR)/slapd: slapd
108 $(INSTALL) $(INSTALLFLAGS) -m 755 slapd $(ETCDIR)
110 $(ETCDIR)/slapd.conf: slapd.conf
111 $(SED) -e 's;%ETCDIR%;$(RUNTIMEETCDIR);' slapd.conf > /tmp/slapd.$$
112 -$(MV) $(ETCDIR)/slapd.conf $(ETCDIR)/slapd.conf-
113 $(INSTALL) $(INSTALLFLAGS) -m 644 /tmp/slapd.$$ $(ETCDIR)/slapd.conf
114 $(RM) -f /tmp/slapd.$$
116 $(ETCDIR)/slapd.at.conf: slapd.at.conf
117 -$(MV) $(ETCDIR)/slapd.at.conf $(ETCDIR)/slapd.at.conf-
118 $(INSTALL) $(INSTALLFLAGS) -m 644 slapd.at.conf $(ETCDIR)
120 $(ETCDIR)/slapd.oc.conf: slapd.oc.conf
121 -$(MV) $(ETCDIR)/slapd.oc.conf $(ETCDIR)/slapd.oc.conf-
122 $(INSTALL) $(INSTALLFLAGS) -m 644 slapd.oc.conf $(ETCDIR)
125 (cd tools; $(MAKE) $(MFLAGS) install)
128 $(LINT) $(INCLUDES) $(DEFINES) $(SRCS)
131 $(5LINT) $(INCLUDES) $(DEFINES) $(SRCS)
134 @echo "making clean in `$(PWD)`"
135 $(RM) slapd slapd.pure *.o core a.out version.c libbackends.a .backend
136 @for i in back-* tools; do \
137 if [ -d $$i -a $$i != "RCS" ]; then \
138 echo; echo " cd $$i; $(MAKE) $(MFLAGS) clean"; \
139 ( cd $$i; $(MAKE) $(MFLAGS) clean ); \
144 $(MKDEP) $(INCLUDES) $(DEFINES) $(SRCS)
145 @for i in back-* tools; do \
146 if [ -d $$i -a $$i != "RCS" ]; then \
147 echo; echo " cd $$i; $(MAKE) $(MFLAGS) depend"; \
148 ( cd $$i; $(MAKE) $(MFLAGS) depend ); \
154 @echo "making links in `$(PWD)`"
155 @$(LN) .src/*.[ch] .src/*.conf .
157 @for i in .src/back-* .src/tools; do \
158 if [ -d $$i -a $$i != ".src/RCS" ]; then \
160 ( $(MKDIR) $$d; cd $$d; $(LN) ../.src/$$d .src; \
161 $(LN) ../.src/$$d/Make-template . ; \
162 $(MAKE) $(MFLAGS) MKDIR="$(MKDIR)" LN="$(LN)" \
163 -f Make-template links ) ; \
168 # DO NOT DELETE THIS LINE -- mkdep uses it.
169 # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
171 main.o: main.c ../../include/portable.h slap.h ../../include/avl.h
172 main.o: ../../include/lber.h ../../include/ldap.h ../../include/lthread.h
173 main.o: ../../include/ldif.h ../../include/ldapconfig.h
174 daemon.o: daemon.c slap.h ../../include/avl.h ../../include/lber.h
175 daemon.o: ../../include/ldap.h ../../include/lthread.h ../../include/ldif.h
176 daemon.o: ../../include/portable.h ../../include/ldapconfig.h
177 connection.o: connection.c ../../include/portable.h slap.h ../../include/avl.h
178 connection.o: ../../include/lber.h ../../include/ldap.h ../../include/lthread.h
179 connection.o: ../../include/ldif.h
180 search.o: search.c slap.h ../../include/avl.h ../../include/lber.h
181 search.o: ../../include/ldap.h ../../include/lthread.h ../../include/ldif.h
182 search.o: ../../include/ldapconfig.h
183 filter.o: filter.c slap.h ../../include/avl.h ../../include/lber.h
184 filter.o: ../../include/ldap.h ../../include/lthread.h ../../include/ldif.h
185 add.o: add.c slap.h ../../include/avl.h ../../include/lber.h
186 add.o: ../../include/ldap.h ../../include/lthread.h ../../include/ldif.h
187 charray.o: charray.c slap.h ../../include/avl.h ../../include/lber.h
188 charray.o: ../../include/ldap.h ../../include/lthread.h ../../include/ldif.h
189 attr.o: attr.c ../../include/portable.h slap.h ../../include/avl.h
190 attr.o: ../../include/lber.h ../../include/ldap.h ../../include/lthread.h
191 attr.o: ../../include/ldif.h
192 entry.o: entry.c slap.h ../../include/avl.h ../../include/lber.h
193 entry.o: ../../include/ldap.h ../../include/lthread.h ../../include/ldif.h
194 config.o: config.c slap.h ../../include/avl.h ../../include/lber.h
195 config.o: ../../include/ldap.h ../../include/lthread.h ../../include/ldif.h
196 config.o: ../../include/ldapconfig.h
197 backend.o: backend.c slap.h ../../include/avl.h ../../include/lber.h
198 backend.o: ../../include/ldap.h ../../include/lthread.h ../../include/ldif.h
199 result.o: result.c ../../include/portable.h slap.h ../../include/avl.h
200 result.o: ../../include/lber.h ../../include/ldap.h ../../include/lthread.h
201 result.o: ../../include/ldif.h
202 operation.o: operation.c slap.h ../../include/avl.h ../../include/lber.h
203 operation.o: ../../include/ldap.h ../../include/lthread.h ../../include/ldif.h
204 dn.o: dn.c ../../include/portable.h slap.h ../../include/avl.h
205 dn.o: ../../include/lber.h ../../include/ldap.h ../../include/lthread.h
206 dn.o: ../../include/ldif.h
207 compare.o: compare.c slap.h ../../include/avl.h ../../include/lber.h
208 compare.o: ../../include/ldap.h ../../include/lthread.h ../../include/ldif.h
209 modify.o: modify.c slap.h ../../include/avl.h ../../include/lber.h
210 modify.o: ../../include/ldap.h ../../include/lthread.h ../../include/ldif.h
211 delete.o: delete.c slap.h ../../include/avl.h ../../include/lber.h
212 delete.o: ../../include/ldap.h ../../include/lthread.h ../../include/ldif.h
213 modrdn.o: modrdn.c slap.h ../../include/avl.h ../../include/lber.h
214 modrdn.o: ../../include/ldap.h ../../include/lthread.h ../../include/ldif.h
215 ch_malloc.o: ch_malloc.c slap.h ../../include/avl.h ../../include/lber.h
216 ch_malloc.o: ../../include/ldap.h ../../include/lthread.h ../../include/ldif.h
217 value.o: value.c ../../include/portable.h slap.h ../../include/avl.h
218 value.o: ../../include/lber.h ../../include/ldap.h ../../include/lthread.h
219 value.o: ../../include/ldif.h
220 ava.o: ava.c slap.h ../../include/avl.h ../../include/lber.h
221 ava.o: ../../include/ldap.h ../../include/lthread.h ../../include/ldif.h
222 bind.o: bind.c slap.h ../../include/avl.h ../../include/lber.h
223 bind.o: ../../include/ldap.h ../../include/lthread.h ../../include/ldif.h
224 unbind.o: unbind.c slap.h ../../include/avl.h ../../include/lber.h
225 unbind.o: ../../include/ldap.h ../../include/lthread.h ../../include/ldif.h
226 abandon.o: abandon.c slap.h ../../include/avl.h ../../include/lber.h
227 abandon.o: ../../include/ldap.h ../../include/lthread.h ../../include/ldif.h
228 filterentry.o: filterentry.c ../../include/regex.h slap.h ../../include/avl.h
229 filterentry.o: ../../include/lber.h ../../include/ldap.h
230 filterentry.o: ../../include/lthread.h ../../include/ldif.h
231 phonetic.o: phonetic.c ../../include/portable.h slap.h ../../include/avl.h
232 phonetic.o: ../../include/lber.h ../../include/ldap.h ../../include/lthread.h
233 phonetic.o: ../../include/ldif.h
234 regex.o: regex.c ../../include/portable.h
235 acl.o: acl.c ../../include/regex.h slap.h ../../include/avl.h
236 acl.o: ../../include/lber.h ../../include/ldap.h ../../include/lthread.h
237 acl.o: ../../include/ldif.h
238 str2filter.o: str2filter.c slap.h ../../include/avl.h ../../include/lber.h
239 str2filter.o: ../../include/ldap.h ../../include/lthread.h ../../include/ldif.h
240 aclparse.o: aclparse.c ../../include/regex.h slap.h ../../include/avl.h
241 aclparse.o: ../../include/lber.h ../../include/ldap.h ../../include/lthread.h
242 aclparse.o: ../../include/ldif.h ../../include/portable.h
243 init.o: init.c ../../include/portable.h slap.h ../../include/avl.h
244 init.o: ../../include/lber.h ../../include/ldap.h ../../include/lthread.h
245 init.o: ../../include/ldif.h
246 detach.o: detach.c ../../include/portable.h
249 repl.o: repl.c slap.h ../../include/avl.h ../../include/lber.h
250 repl.o: ../../include/ldap.h ../../include/lthread.h ../../include/ldif.h
251 lock.o: lock.c ../../include/portable.h slap.h ../../include/avl.h
252 lock.o: ../../include/lber.h ../../include/ldap.h ../../include/lthread.h
253 lock.o: ../../include/ldif.h
254 schema.o: schema.c slap.h ../../include/avl.h ../../include/lber.h
255 schema.o: ../../include/ldap.h ../../include/lthread.h ../../include/ldif.h
256 schemaparse.o: schemaparse.c slap.h ../../include/avl.h ../../include/lber.h
257 schemaparse.o: ../../include/ldap.h ../../include/lthread.h
258 schemaparse.o: ../../include/ldif.h
259 monitor.o: monitor.c slap.h ../../include/avl.h ../../include/lber.h
260 monitor.o: ../../include/ldap.h ../../include/lthread.h ../../include/ldif.h
261 monitor.o: ../../include/ldapconfig.h
262 configinfo.o: configinfo.c slap.h ../../include/avl.h ../../include/lber.h
263 configinfo.o: ../../include/ldap.h ../../include/lthread.h ../../include/ldif.h
264 configinfo.o: ../../include/ldapconfig.h
266 # IF YOU PUT ANYTHING HERE IT WILL GO AWAY