Makefile.in 3.28 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
##
## 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 \
		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 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

BUILD_OPT = "--enable-slapd"
BUILD_SRV = @BUILD_SLAPD@

24
all-local: FORCE
Kurt Zeilenga's avatar
Kurt Zeilenga committed
25
26
27
28
	$(MAKE) $(MFLAGS) backendslib
	$(MAKE) $(MFLAGS) slapd
	(cd tools; $(MAKE) $(MFLAGS) all)

Kurt Zeilenga's avatar
Kurt Zeilenga committed
29
30
31
XDEFS = @SLAPD_DEFS@ @LDBM_DEFS@ @LTHREAD_DEFS@
XLIBS = @SLAPD_LIBS@ libbackends.a \
	-lavl -llutil -lldbm @LDBM_LIBS@ -llthread @LTHREAD_LIBS@
Kurt Zeilenga's avatar
Kurt Zeilenga committed
32
33
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
71
72
73
74
75
76
77
78
79
80
81

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

version.c: libbackends.a $(OBJS) \
		$(LDAP_LIBDIR)/liblber.a \
		$(LDAP_LIBDIR)/liblldbm.a \
		$(LDAP_LIBDIR)/liblavl.a \
		$(LDAP_LIBDIR)/liblldif.a \
		$(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}|" \
	< Version.c > $@)

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

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

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

install-conf: FORCE
	@-$(MKDIR) -p $(sysconfdir)
Kurt Zeilenga's avatar
Kurt Zeilenga committed
98
	$(SED) -e 's;%SYSCONFDIR%;$(sysconfdir);' slapd.conf > /tmp/slapd.$$
Kurt Zeilenga's avatar
Kurt Zeilenga committed
99
100
101
102
103
104
105
106
107
108
109
110
	-$(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)