Makefile.in 3.32 KB
Newer Older
Kurt Zeilenga's avatar
Kurt Zeilenga committed
1
2
3
4
5
6
7
8
9
10
##
## Makefile.in for slapd
##
PROGRAMS=slapd
XPROGRAMS=libbackends.a .backend
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 acl.c str2filter.c aclparse.c init.c \
11
		detach.c repl.c lock.c \
Kurt Zeilenga's avatar
Kurt Zeilenga committed
12
		suffixAlias.c schema.c schemaparse.c monitor.c configinfo.c
Kurt Zeilenga's avatar
Kurt Zeilenga committed
13
14
15
16
17
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 acl.o str2filter.o aclparse.o init.o \
18
		detach.o repl.o lock.o \
Kurt Zeilenga's avatar
Kurt Zeilenga committed
19
		suffixalias.o schema.o schemaparse.o monitor.o configinfo.o
Kurt Zeilenga's avatar
Kurt Zeilenga committed
20

Kurt Zeilenga's avatar
Kurt Zeilenga committed
21
22
LDAP_INCDIR= ../../include
LDAP_LIBDIR= ../../libraries
23

Kurt Zeilenga's avatar
Kurt Zeilenga committed
24
25
26
BUILD_OPT = "--enable-slapd"
BUILD_SRV = @BUILD_SLAPD@

27
all-local: FORCE
Kurt Zeilenga's avatar
Kurt Zeilenga committed
28
29
30
31
	$(MAKE) $(MFLAGS) backendslib
	$(MAKE) $(MFLAGS) slapd
	(cd tools; $(MAKE) $(MFLAGS) all)

Kurt Zeilenga's avatar
Kurt Zeilenga committed
32
XLIBS = @SLAPD_LIBS@ libbackends.a \
33
	-lavl -llutil -lldbm @LDBM_LIBS@ -llthread @LTHREAD_LIBS@ @LUTIL_LIBS@
Kurt Zeilenga's avatar
Kurt Zeilenga committed
34
35
36
37
38
39
40
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

slapd: version.o
	$(CC) $(LDFLGS) -o $@ $(OBJS) version.o $(LIBS)

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

Kurt Zeilenga's avatar
Kurt Zeilenga committed
71
version.c: libbackends.a $(OBJS) $(LDAP_LIBDEPEND) \
Kurt Zeilenga's avatar
Kurt Zeilenga committed
72
73
74
75
		$(LDAP_LIBDIR)/libldbm.a \
		$(LDAP_LIBDIR)/libavl.a \
		$(LDAP_LIBDIR)/libldif.a \
		$(LDAP_LIBDIR)/liblutil.a \
Kurt Zeilenga's avatar
Kurt Zeilenga committed
76
77
78
79
80
81
		$(LDAP_LIBDIR)/liblthread.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}|" \
82
	< $(srcdir)/Version.c > $@)
Kurt Zeilenga's avatar
Kurt Zeilenga committed
83

84
clean-local: FORCE
Kurt Zeilenga's avatar
Kurt Zeilenga committed
85
	@for i in back-* tools; do \
86
		if [ -d $$i ]; then \
Kurt Zeilenga's avatar
Kurt Zeilenga committed
87
88
89
90
91
			echo; echo "  cd $$i; $(MAKE) $(MFLAGS) clean"; \
			( cd $$i; $(MAKE) $(MFLAGS) clean ); \
		fi; \
	done

92
install-local: install-slapd install-conf install-tools
Kurt Zeilenga's avatar
Kurt Zeilenga committed
93
94
95
96
97
98
99

install-slapd: FORCE
	@-$(MKDIR) $(libexecdir)
	$(INSTALL) $(INSTALLFLAGS) -m 755 slapd $(libexecdir)

install-conf: FORCE
	@-$(MKDIR) -p $(sysconfdir)
Kurt Zeilenga's avatar
Kurt Zeilenga committed
100
	$(SED) -e 's;%SYSCONFDIR%;$(sysconfdir);' slapd.conf > /tmp/slapd.$$
Kurt Zeilenga's avatar
Kurt Zeilenga committed
101
102
103
104
105
106
107
108
109
110
111
112
	-$(MV) $(sysconfdir)/slapd.conf $(sysconfdir)/slapd.conf-
	$(INSTALL) $(INSTALLFLAGS) -m 644 /tmp/slapd.$$ $(sysconfdir)/slapd.conf
	$(RM) -f /tmp/slapd.$$
	-$(MV) $(sysconfdir)/slapd.at.conf $(sysconfdir)/slapd.at.conf-
	$(INSTALL) $(INSTALLFLAGS) -m 644 slapd.at.conf $(sysconfdir)
	-$(MV) $(sysconfdir)/slapd.oc.conf $(sysconfdir)/slapd.oc.conf-
	$(INSTALL) $(INSTALLFLAGS) -m 644 slapd.oc.conf $(sysconfdir)

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