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

21
22
23
24
VINCLUDEDIR= -I../../include
VLIBDIR= ../../libraries
VLIBS= -L$(VLIBDIR)

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

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

33
XDEFS = @SLAPD_DEFS@ @LDBM_DEFS@ @LTHREAD_DEFS@ @LUTIL_DEFS@
Kurt Zeilenga's avatar
Kurt Zeilenga committed
34
XLIBS = @SLAPD_LIBS@ libbackends.a \
35
	-lavl -llutil -lldbm @LDBM_LIBS@ -llthread @LTHREAD_LIBS@ @LUTIL_LIBS@
Kurt Zeilenga's avatar
Kurt Zeilenga committed
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
82
83

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}|" \
84
	< $(srcdir)/Version.c > $@)
Kurt Zeilenga's avatar
Kurt Zeilenga committed
85

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

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

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

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