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 PROGRAMS=ldif2index ldif2ldbm ldbmcat ldif2id2entry \
19 ldif2id2children centipede ldbmtest ldif
21 SRCS = centipede.c ldbmcat.c ldbmtest.c sizecount.c \
22 ldif.c ldif2id2children.c ldif2id2entry.c ldif2index.c ldif2ldbm.c
24 EDB2LDIFSRCS = edb2ldif.c ldapsyntax.c
25 EDB2LDIFOBJS = edb2ldif.o ldapsyntax.o ../strdup.o
27 OBJS2 = ../config.o ../ch_malloc.o ../backend.o ../charray.o \
28 ../aclparse.o ../schema.o ../result.o ../filterentry.o \
29 ../acl.o ../phonetic.o ../attr.o ../value.o ../entry.o \
30 ../dn.o ../filter.o ../str2filter.o ../ava.o ../init.o \
31 ../schemaparse.o ../strdup.o
33 all-local: build-ldbm build-edb2ldif build-chlog2replog
36 @if [ "$(BUILD_LDBM)" = "yes" ]; then \
37 $(MAKE) $(MFLAGS) ldbm-tools; \
39 echo "run configure with --with-ldbm to build LDBM tools"; \
42 ldbm-tools: $(PROGRAMS)
44 XDEFS = @SLAPD_DEFS@ @LDBM_DEFS@ @LTHREAD_DEFS@
45 XLIBS = @SLAPD_LIBS@ -lavl -lldbm @LDBM_LIBS@ -llthread @LTHREAD_LIBS@ -llutil @LUTIL_LIBS@
48 @if [ "$(HAVE_ISODE)" = "yes" ]; then \
49 $(MAKE) $(MFLAGS) edb2ldif; \
51 echo "run configure with --with-isode to build edb2ldif"; \
55 $(CC) $(LDFLAGS) -o $@ $(EDB2LDIFOBJS) edb2-vers.o $(LIBS)
57 edb2-vers.c: $(EDB2LDIFOBJS)
59 (u=$${USER-root} v=`$(CAT) $(VERSIONFILE)` d=`$(PWD)` h=`$(HOSTNAME)` \
60 t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \
61 -e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \
62 -e "s|%VERSION%|$${v}|" \
65 build-chlog2replog: FORCE
66 @if [ "$(HAVE_ISODE)" = "yes" ]; then \
67 $(MAKE) $(MFLAGS) chlog2replog; \
69 echo "run configure with --with-isode to build chlog2replog"; \
72 chlog2replog: chlog2replog.o ../lock.o ../ch_malloc.o
73 $(CC) $(LDFLAGS) -o $@ chlog2replog.o ../lock.o ../ch_malloc.o $(LIBS)
75 ldif2index: ldif2index.o ../libbackends.a $(OBJS2)
76 $(CC) $(LDFLAGS) -o $@ ldif2index.o $(OBJS2) ../libbackends.a $(LIBS)
78 ldif2ldbm: ldif2ldbm.o ../libbackends.a $(OBJS2)
79 $(CC) $(LDFLAGS) -o $@ ldif2ldbm.o $(OBJS2) ../libbackends.a $(LIBS)
81 ldif2id2entry: ldif2id2entry.o ../libbackends.a $(OBJS2)
82 $(CC) $(LDFLAGS) -o $@ ldif2id2entry.o $(OBJS2) ../libbackends.a $(LIBS)
84 ldif2id2children: ldif2id2children.o ../libbackends.a $(OBJS2)
85 $(CC) $(LDFLAGS) -o $@ ldif2id2children.o $(OBJS2) ../libbackends.a $(LIBS)
88 $(CC) $(LDFLAGS) -o $@ ldbmcat.o $(LIBS)
91 $(CC) $(LDFLAGS) -o $@ ldif.o $(LIBS) $(LIBS2)
93 centipede: centipede.o
94 $(CC) -o $@ centipede.o $(LIBS) $(KRBLIBFLAG) $(KRBLIBS)
96 sizecount: sizecount.o ../phonetic.o ../ch_malloc.o
97 $(CC) $(LDFLAGS) -o $@ sizecount.o ../phonetic.o ../ch_malloc.o \
98 $(LIBS) $(KRBLIBFLAG) $(KRBLIBS)
100 ldbmtest: ldbmtest.o ../libbackends.a $(OBJS2)
101 $(CC) $(LDFLAGS) -o ldbmtest ldbmtest.o $(OBJS2) ../libbackends.a $(LIBS)
104 $(RM) $(PROGRAMS) $(XPROGRAMS) $(XSRCS) edb2-vers.c *.o a.out core
107 @DEPEND=no ; DEPEND_LDBM= ; DEPEND_ISODE= ;\
108 if [ "$(BUILD_LDBM)" = "yes" ]; then \
109 DEPEND_LDBM="$(SRCS)"; \
112 if [ "$(HAVE_ISODE)" = "yes" ]; then \
113 DEPEND_ISODE="$(ISODEINCLUDEFLAG) chlog2replog.c $(EDB2LDIFSRCS)"; \
116 if [ "$$DEPEND" = "yes" ]; then \
117 $(MKDEP) $(DEFS) $(DEFINES) $$DEPEND_ISODE $$DEPEND_LDBM \
122 install-local: install-ldbm install-isode FORCE
125 @-$(MKDIR) -p $(sbindir)
126 @if [ "$(BUILD_LDBM)" = "yes" ]; then \
127 $(INSTALL) $(INSTALLFLAGS) -m 755 ldif2ldbm $(sbindir) \
128 $(INSTALL) $(INSTALLFLAGS) -m 755 ldif2index $(sbindir) \
129 $(INSTALL) $(INSTALLFLAGS) -m 755 ldif2id2entry $(sbindir) \
130 $(INSTALL) $(INSTALLFLAGS) -m 755 ldif2id2children $(sbindir) \
131 $(INSTALL) $(INSTALLFLAGS) -m 755 ldbmcat $(sbindir) \
132 $(INSTALL) $(INSTALLFLAGS) -m 755 ldif $(sbindir) \
133 $(INSTALL) $(INSTALLFLAGS) -m 755 centipede $(sbindir) \
134 $(INSTALL) $(INSTALLFLAGS) -m 755 ldbmtest $(sbindir) \
140 @-$(MKDIR) -p $(sbindir)
141 @if [ "$(HAVE_ISODE)" = "yes" ]; then \
142 $(INSTALL) $(INSTALLFLAGS) -m 755 edb2ldif $(sbindir); \
143 $(INSTALL) $(INSTALLFLAGS) -m 755 chlog2replog $(sbindir); \
148 all-common: all-local FORCE
149 install-common: all-common install-local FORCE
150 depend-common: depend-local FORCE
151 clean-common: clean-local FORCE
152 veryclean-common: clean-common veryclean-local FORCE