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@
18 LDAP_INCDIR= ../../../include
19 LDAP_LIBDIR= ../../../libraries
21 XLIBS = -lavl -lldif -lldbm -lldap_r -llber -llutil
22 XXLIBS = $(LDAPD_LIBS) $(SLAPD_LIBS) \
23 $(PERL_LDFLAGS) $(LDBM_LIBS) $(KRB_LIBS) $(LUTIL_LIBS)
24 XXXLIBS = $(LTHREAD_LIBS)
26 PROGRAMS=ldif2index ldif2ldbm ldbmcat ldif2id2entry \
27 ldif2id2children centipede ldbmtest ldif
29 SRCS = centipede.c ldbmcat.c ldbmtest.c sizecount.c \
30 ldif.c ldif2id2children.c ldif2id2entry.c ldif2index.c ldif2ldbm.c
34 EDB2LDIFSRCS = edb2ldif.c ldapsyntax.c
35 EDB2LDIFOBJS = edb2ldif.o ldapsyntax.o
37 OBJS2 = ../config.o ../ch_malloc.o ../backend.o ../charray.o \
38 ../aclparse.o ../schema.o ../result.o ../filterentry.o \
39 ../acl.o ../phonetic.o ../attr.o ../value.o ../entry.o \
40 ../dn.o ../filter.o ../str2filter.o ../ava.o ../init.o \
43 all-local: build-ldbm build-edb2ldif build-chlog2replog
46 @if [ "$(BUILD_LDBM)" = "yes" ]; then \
47 $(MAKE) $(MFLAGS) ldbm-tools; \
49 echo "run configure with --with-ldbm to build LDBM tools"; \
52 ldbm-tools: $(PROGRAMS)
55 @if [ "$(HAVE_ISODE)" = "yes" ]; then \
56 $(MAKE) $(MFLAGS) edb2ldif; \
58 echo "run configure with --with-isode to build edb2ldif"; \
62 $(CC) $(LDFLAGS) -o $@ $(EDB2LDIFOBJS) edb2-vers.o $(LIBS)
64 edb2-vers.c: $(EDB2LDIFOBJS)
66 (u=$${USER-root} v=`$(CAT) $(VERSIONFILE)` d=`$(PWD)` h=`$(HOSTNAME)` \
67 t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \
68 -e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \
69 -e "s|%VERSION%|$${v}|" \
72 build-chlog2replog: FORCE
73 @if [ "$(HAVE_ISODE)" = "yes" ]; then \
74 $(MAKE) $(MFLAGS) chlog2replog; \
76 echo "run configure with --with-isode to build chlog2replog"; \
79 chlog2replog: chlog2replog.o ../lock.o ../ch_malloc.o
80 $(LTLINK) -o $@ chlog2replog.o ../lock.o ../ch_malloc.o $(LIBS)
82 ldif2index: ldif2index.o ../libbackends.a $(OBJS2)
83 $(LTLINK) -o $@ ldif2index.o $(OBJS2) ../libbackends.a $(LIBS)
85 ldif2ldbm: ldif2ldbm.o ../libbackends.a $(OBJS2)
86 $(LTLINK) -o $@ ldif2ldbm.o $(OBJS2) ../libbackends.a $(LIBS)
88 ldif2id2entry: ldif2id2entry.o ../libbackends.a $(OBJS2)
89 $(LTLINK) -o $@ ldif2id2entry.o $(OBJS2) ../libbackends.a $(LIBS)
91 ldif2id2children: ldif2id2children.o ../libbackends.a $(OBJS2)
92 $(LTLINK) -o $@ ldif2id2children.o $(OBJS2) ../libbackends.a $(LIBS)
95 $(LTLINK) -o $@ ldbmcat.o $(LIBS)
98 $(LTLINK) -o $@ ldif.o $(LIBS)
100 centipede: centipede.o
101 $(LTLINK) -o $@ centipede.o $(LIBS)
103 sizecount: sizecount.o ../phonetic.o ../ch_malloc.o
104 $(LTLINK) -o $@ sizecount.o ../phonetic.o ../ch_malloc.o $(LIBS)
106 ldbmtest: ldbmtest.o ../libbackends.a $(OBJS2)
107 $(LTLINK) -o ldbmtest ldbmtest.o $(OBJS2) ../libbackends.a $(LIBS)
110 $(RM) $(PROGRAMS) $(XPROGRAMS) $(XSRCS) edb2-vers.c \
114 @DEPEND=no ; DEPEND_LDBM= ; DEPEND_ISODE= ; \
115 if [ "$(BUILD_LDBM)" = "yes" ]; then \
116 DEPEND_LDBM="$(SRCS)"; \
119 if [ "$(HAVE_ISODE)" = "yes" ]; then \
120 DEPEND_ISODE="$(ISODEINCLUDEFLAG) chlog2replog.c $(EDB2LDIFSRCS)"; \
123 if [ "$$DEPEND" = "yes" ]; then \
124 $(MKDEP) $(DEFS) $(DEFINES) $$DEPEND_ISODE $$DEPEND_LDBM; \
126 echo "slapd-tools: no dependencies to make"; \
129 install-local: install-ldbm install-isode FORCE
132 @-$(MKDIR) $(sbindir)
133 @if [ "$(BUILD_LDBM)" = "yes" ]; then \
134 $(LTINSTALL) $(INSTALLFLAGS) -m 755 ldif2ldbm $(sbindir) ; \
135 $(LTINSTALL) $(INSTALLFLAGS) -m 755 ldif2index $(sbindir) ; \
136 $(LTINSTALL) $(INSTALLFLAGS) -m 755 ldif2id2entry $(sbindir) ; \
137 $(LTINSTALL) $(INSTALLFLAGS) -m 755 ldif2id2children $(sbindir) ; \
138 $(LTINSTALL) $(INSTALLFLAGS) -m 755 ldbmcat $(sbindir) ; \
139 $(LTINSTALL) $(INSTALLFLAGS) -m 755 ldif $(sbindir) ; \
140 $(LTINSTALL) $(INSTALLFLAGS) -m 755 centipede $(sbindir) ; \
141 $(LTINSTALL) $(INSTALLFLAGS) -m 755 ldbmtest $(sbindir) ; \
147 @-$(MKDIR) $(sbindir)
148 @if [ "$(HAVE_ISODE)" = "yes" ]; then \
149 $(LTINSTALL) $(INSTALLFLAGS) -m 755 edb2ldif $(sbindir); \
150 $(LTINSTALL) $(INSTALLFLAGS) -m 755 chlog2replog $(sbindir); \