Makefile.in 4.1 KB
Newer Older
1
2
3
4
##
## Makefile.in for slapd
##
PROGRAMS=slapd
5
6
XPROGRAMS=sslapd libbackends.a .backend
XSRCS=version.c
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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 \
		repl.c lock.c \
		suffixalias.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 acl.o str2filter.o aclparse.o init.o \
		repl.o lock.o \
		suffixalias.o schema.o schemaparse.o monitor.o configinfo.o

LDAP_INCDIR= ../../include
LDAP_LIBDIR= ../../libraries

Kurt Zeilenga's avatar
Kurt Zeilenga committed
25
26
27
28
29
30
# $(LTHREAD_LIBS) must be last
XLIBS = libbackends.a -lavl -lldbm -lldif -lldap -llber -llthread -llutil
XXLIBS = $(LDBM_LIBS) $(SLAPD_LIBS) \
	$(KRB_LIBS) $(LUTIL_LIBS)
XXXLIBS = $(LTHREAD_LIBS)

31
32
33
BUILD_OPT = "--enable-slapd"
BUILD_SRV = @BUILD_SLAPD@

34
all-local-srv: FORCE
35
36
37
38
39
	$(MAKE) $(MFLAGS) backendslib
	$(MAKE) $(MFLAGS) slapd
	(cd tools; $(MAKE) $(MFLAGS) all)

slapd: version.o
40
	$(LTLINK) -o $@ $(OBJS) version.o $(LIBS) $(WRAP_LIBS)
41
42

sslapd: version.o
43
	$(LTLINK) -static -o $@ $(OBJS) version.o $(LIBS) $(WRAP_LIBS)
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

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

78
version.c: libbackends.a $(OBJS) $(SLAPD_LIBDEPEND) 
79
80
81
82
83
84
85
	$(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}|" \
	< $(srcdir)/Version.c > $@)

86
depend-local-srv: FORCE
87
88
89
90
91
92
93
	@for i in back-* shell-backends tools; do \
		if [ -d $$i ]; then \
			echo; echo "  cd $$i; $(MAKE) $(MFLAGS) depend"; \
			( cd $$i; $(MAKE) $(MFLAGS) depend ); \
		fi; \
	done

94
clean-local-srv: FORCE
95
	@for i in back-* shell-backends tools; do \
96
97
98
99
100
101
		if [ -d $$i ]; then \
			echo; echo "  cd $$i; $(MAKE) $(MFLAGS) clean"; \
			( cd $$i; $(MAKE) $(MFLAGS) clean ); \
		fi; \
	done

102
103
104
105
106
107
108
109
veryclean-local-srv: FORCE
	@for i in back-* shell-backends tools; do \
		if [ -d $$i ]; then \
			echo; echo "  cd $$i; $(MAKE) $(MFLAGS) clean"; \
			( cd $$i; $(MAKE) $(MFLAGS) veryclean ); \
		fi; \
	done

110
install-local-srv: install-slapd install-conf install-tools
111
112
113

install-slapd: FORCE
	@-$(MKDIR) $(libexecdir)
Kurt Zeilenga's avatar
Kurt Zeilenga committed
114
	@-$(MKDIR) $(localstatedir)
115
	$(LTINSTALL) $(INSTALLFLAGS) -m 755 slapd $(libexecdir)
116

117
118
CFFILES=slapd.conf slapd.at.conf slapd.oc.conf

119
install-conf: FORCE
120
	@-$(MKDIR) $(sysconfdir)
121
	@-$(MKDIR) $(localstatedir)/openldap-ldbm
122
123
	@for i in $(CFFILES); do \
		tmpcf=/tmp/$$i.$$ ; \
124
125
126
127
128
		if test $$i = slapd.conf ; then \
			mode=600 ; \
		else \
			mode=644 ; \
		fi ; \
129
130
131
		$(SED) -e 's;%SYSCONFDIR%;$(sysconfdir);' \
			-e 's;%LOCALSTATEDIR%;$(localstatedir);' \
			$(srcdir)/$$i > $$tmpcf ; \
132
133
		if test ! -f $(sysconfdir)/$$i; then \
			echo "installing $$i in $(sysconfdir)"; \
134
135
			echo "$(INSTALL) $(INSTALLFLAGS) -m $$mode $$tmpcf $(sysconfdir)/$$i"; \
			$(INSTALL) $(INSTALLFLAGS) -m $$mode $$tmpcf $(sysconfdir)/$$i; \
136
137
138
		else \
			echo "PRESERVING EXISTING CONFIGURATION FILE $(sysconfdir)/$$i" ; \
		fi; \
139
		$(INSTALL) $(INSTALLFLAGS) -m $$mode $$tmpcf $(sysconfdir)/$$i.default ; \
Kurt Zeilenga's avatar
Kurt Zeilenga committed
140
		$(RM) -f $$tmpcf ; \
141
	done
142
143
144
145
146

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