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 tools makefile
14 #-----------------------------------------------------------------------------
15 HAVE_ISODE = @HAVE_ISODE@
16 BUILD_LDBM = @BUILD_LDBM@
17 BUILD_BDB2 = @BUILD_BDB2@
19 LDAP_INCDIR= ../../../include
20 LDAP_LIBDIR= ../../../libraries
22 XDEFS = $(MODULES_CPPFLAGS)
23 XLDFLAGS = $(MODULES_LDFLAGS)
25 XLIBS = -lavl -lldif -lldbm -lldap_r -llber -llutil
26 XXLIBS = $(LDAPD_LIBS) $(SLAPD_LIBS) \
27 $(PERL_LDFLAGS) $(LDBM_LIBS) $(KRB_LIBS) $(TLS_LIBS) $(LUTIL_LIBS)
28 XXXLIBS = $(LTHREAD_LIBS)
30 PROGRAMS=ldif2index ldif2ldbm ldbmcat ldif2id2entry ldif2id2children \
31 centipede ldbmtest ldif
33 PROGRAMS2=ldif2index-bdb2 ldif2ldbm-bdb2 \
34 ldif2id2entry-bdb2 ldif2id2children-bdb2
36 SRCS = centipede.c ldbmcat.c ldbmtest.c sizecount.c \
37 ldif.c ldif2id2children.c ldif2id2entry.c ldif2index.c ldif2ldbm.c \
40 SRCS2 = ldif2id2children-bdb2.c ldif2id2entry-bdb2.c \
41 ldif2index-bdb2.c ldif2ldbm-bdb2.c
45 EDB2LDIFSRCS = edb2ldif.c ldapsyntax.c
46 EDB2LDIFOBJS = edb2ldif.o ldapsyntax.o
49 ../config.o ../ch_malloc.o ../backend.o ../charray.o \
50 ../module.o ../aclparse.o ../schema.o ../filterentry.o \
51 ../acl.o ../phonetic.o ../attr.o ../value.o ../entry.o \
52 ../dn.o ../filter.o ../str2filter.o ../ava.o ../init.o \
53 ../controls.o ../schemaparse.o
55 all-local: build-ldbm build-bdb2 build-edb2ldif build-chlog2replog
58 @if [ "$(BUILD_LDBM)" = "yes" ]; then \
59 $(MAKE) $(MFLAGS) ldbm-tools; \
61 echo "run configure with --with-ldbm to build LDBM tools"; \
65 @if [ "$(BUILD_BDB2)" = "yes" ]; then \
66 $(MAKE) $(MFLAGS) bdb2-tools; \
68 echo "run configure with --enable-bdb2 to build BDB2 tools"; \
71 ldbm-tools: $(PROGRAMS)
73 bdb2-tools: $(PROGRAMS2)
76 @if [ "$(HAVE_ISODE)" = "yes" ]; then \
77 $(MAKE) $(MFLAGS) edb2ldif; \
79 echo "run configure with --with-isode to build edb2ldif"; \
83 $(CC) $(LDFLAGS) -o $@ $(EDB2LDIFOBJS) edb2-vers.o $(LIBS)
85 edb2-vers.c: $(EDB2LDIFOBJS)
87 $(MKVERSION) ebd2ldif > $@
89 build-chlog2replog: FORCE
90 @if [ "$(HAVE_ISODE)" = "yes" ]; then \
91 $(MAKE) $(MFLAGS) chlog2replog; \
93 echo "run configure with --with-isode to build chlog2replog"; \
96 chlog2replog: chlog2replog.o ../lock.o ../ch_malloc.o $(SLAPD_LIBDEPEND)
97 $(LTLINK) -o $@ chlog2replog.o ../lock.o ../ch_malloc.o $(LIBS)
99 ldif2index: ldif2index.o ../libbackends.a $(OBJS2) $(SLAPD_LIBDEPEND)
100 $(LTLINK) -o $@ ldif2index.o $(OBJS2) ../libbackends.a $(LIBS)
102 ldif2index-bdb2: ldif2index-bdb2.o ../libbackends.a \
103 $(OBJS2) $(SLAPD_LIBDEPEND)
104 $(LTLINK) -o $@ ldif2index-bdb2.o $(OBJS2) ../libbackends.a $(LIBS)
106 ldif2ldbm: ldif2ldbm.o ../libbackends.a $(OBJS2) $(SLAPD_LIBDEPEND)
107 $(LTLINK) -o $@ ldif2ldbm.o $(OBJS2) ../libbackends.a $(LIBS)
109 ldif2ldbm-bdb2: ldif2ldbm-bdb2.o ../libbackends.a $(OBJS2) $(SLAPD_LIBDEPEND)
110 $(LTLINK) -o $@ ldif2ldbm-bdb2.o $(OBJS2) ../libbackends.a $(LIBS)
112 ldif2id2entry: ldif2id2entry.o ../libbackends.a $(OBJS2) $(SLAPD_LIBDEPEND)
113 $(LTLINK) -o $@ ldif2id2entry.o $(OBJS2) ../libbackends.a $(LIBS)
115 ldif2id2entry-bdb2: ldif2id2entry-bdb2.o ../libbackends.a \
116 $(OBJS2) $(SLAPD_LIBDEPEND)
117 $(LTLINK) -o $@ ldif2id2entry-bdb2.o $(OBJS2) ../libbackends.a $(LIBS)
119 ldif2id2children: ldif2id2children.o ../libbackends.a \
120 $(OBJS2) $(SLAPD_LIBDEPEND)
121 $(LTLINK) -o $@ ldif2id2children.o $(OBJS2) ../libbackends.a $(LIBS)
123 ldif2id2children-bdb2: ldif2id2children-bdb2.o ../libbackends.a \
124 $(OBJS2) $(SLAPD_LIBDEPEND)
125 $(LTLINK) -o $@ ldif2id2children-bdb2.o $(OBJS2) ../libbackends.a $(LIBS)
127 ldbmcat: ldbmcat.o $(SLAPD_LIBDEPEND)
128 $(LTLINK) -o $@ ldbmcat.o $(LIBS)
130 ldif: ldif.o $(SLAPD_LIBDEPEND)
131 $(LTLINK) -o $@ ldif.o $(LIBS)
133 centipede: centipede.o $(SLAPD_LIBDEPEND)
134 $(LTLINK) -o $@ centipede.o $(LIBS)
136 sizecount: sizecount.o ../phonetic.o ../ch_malloc.o $(SLAPD_LIBDEPEND)
137 $(LTLINK) -o $@ sizecount.o ../phonetic.o ../ch_malloc.o $(LIBS)
139 ldbmtest: ldbmtest.o ../libbackends.a $(OBJS2) $(SLAPD_LIBDEPEND)
140 $(LTLINK) -o ldbmtest ldbmtest.o $(OBJS2) ../libbackends.a $(LIBS)
143 $(RM) $(PROGRAMS) $(PROGRAMS2) $(XPROGRAMS) $(XSRCS) edb2-vers.c \
147 @DEPEND=no ; DEPEND_LDBM= ; DEPEND_BDB2= ; DEPEND_ISODE= ; \
148 if [ "$(BUILD_LDBM)" = "yes" ]; then \
149 DEPEND_LDBM="$(SRCS)"; \
152 if [ "$(BUILD_BDB2)" = "yes" ]; then \
153 DEPEND_BDB2="$(SRCS2)"; \
156 if [ "$(HAVE_ISODE)" = "yes" ]; then \
157 DEPEND_ISODE="$(ISODEINCLUDEFLAG) chlog2replog.c $(EDB2LDIFSRCS)"; \
160 if [ "$$DEPEND" = "yes" ]; then \
161 $(MKDEP) $(DEFS) $(DEFINES) $$DEPEND_ISODE \
162 $$DEPEND_LDBM $$DEPEND_BDB2; \
164 echo "slapd-tools: no dependencies to make"; \
167 install-local: install-ldbm install-bdb2 install-isode FORCE
170 @-$(MKDIR) $(sbindir)
171 @if [ "$(BUILD_LDBM)" = "yes" ]; then \
172 $(LTINSTALL) $(INSTALLFLAGS) -m 755 ldif2ldbm $(sbindir) ; \
173 $(LTINSTALL) $(INSTALLFLAGS) -m 755 ldif2index $(sbindir) ; \
174 $(LTINSTALL) $(INSTALLFLAGS) -m 755 ldif2id2entry $(sbindir) ; \
175 $(LTINSTALL) $(INSTALLFLAGS) -m 755 ldif2id2children $(sbindir) ; \
176 $(LTINSTALL) $(INSTALLFLAGS) -m 755 ldbmcat $(sbindir) ; \
177 $(LTINSTALL) $(INSTALLFLAGS) -m 755 ldif $(sbindir) ; \
178 $(LTINSTALL) $(INSTALLFLAGS) -m 755 centipede $(sbindir) ; \
179 $(LTINSTALL) $(INSTALLFLAGS) -m 755 ldbmtest $(sbindir) ; \
185 @-$(MKDIR) $(sbindir)
186 @if [ "$(BUILD_BDB2)" = "yes" ]; then \
187 $(LTINSTALL) $(INSTALLFLAGS) -m 755 ldif2ldbm-bdb2 $(sbindir) ; \
188 $(LTINSTALL) $(INSTALLFLAGS) -m 755 ldif2index-bdb2 $(sbindir) ; \
189 $(LTINSTALL) $(INSTALLFLAGS) -m 755 ldif2id2entry-bdb2 $(sbindir) ; \
190 $(LTINSTALL) $(INSTALLFLAGS) -m 755 ldif2id2children-bdb2 $(sbindir) ; \
196 @-$(MKDIR) $(sbindir)
197 @if [ "$(HAVE_ISODE)" = "yes" ]; then \
198 $(LTINSTALL) $(INSTALLFLAGS) -m 755 edb2ldif $(sbindir); \
199 $(LTINSTALL) $(INSTALLFLAGS) -m 755 chlog2replog $(sbindir); \