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-edb2ldif build-chlog2replog $(PROGRAMS)
35 XDEFS = @SLAPD_DEFS@ @LDBM_DEFS@ @LTHREAD_DEFS@
36 XLIBS = @SLAPD_LIBS@ -lavl -lldbm @LDBM_LIBS@ -llthread @LTHREAD_LIBS@
39 @if [ "$(HAVE_ISODE)" = "yes" ]; then \
40 $(MAKE) $(MFLAGS) edb2ldif; \
42 echo "run configure with --with-isode to build edb2ldif"; \
46 $(CC) $(LDFLAGS) -o $@ $(EDB2LDIFOBJS) edb2-vers.o $(LIBS)
48 edb2-vers.c: $(EDB2LDIFOBJS)
50 (u=$${USER-root} v=`$(CAT) $(VERSIONFILE)` d=`$(PWD)` h=`$(HOSTNAME)` \
51 t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \
52 -e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \
53 -e "s|%VERSION%|$${v}|" \
56 build-chlog2replog: FORCE
57 @if [ "$(HAVE_ISODE)" = "yes" ]; then \
58 $(MAKE) $(MFLAGS) chlog2replog; \
60 echo "run configure with --with-isode to build chlog2replog"; \
63 chlog2replog: chlog2replog.o ../lock.o ../ch_malloc.o
64 $(CC) $(LDFLAGS) -o $@ chlog2replog.o ../lock.o ../ch_malloc.o $(LIBS)
66 ldif2index: ldif2index.o ../libbackends.a $(OBJS2)
67 $(CC) $(LDFLAGS) -o $@ ldif2index.o $(OBJS2) ../libbackends.a $(LIBS)
69 ldif2ldbm: ldif2ldbm.o ../libbackends.a $(OBJS2)
70 $(CC) $(LDFLAGS) -o $@ ldif2ldbm.o $(OBJS2) ../libbackends.a $(LIBS)
72 ldif2id2entry: ldif2id2entry.o ../libbackends.a $(OBJS2)
73 $(CC) $(LDFLAGS) -o $@ ldif2id2entry.o $(OBJS2) ../libbackends.a $(LIBS)
75 ldif2id2children: ldif2id2children.o ../libbackends.a $(OBJS2)
76 $(CC) $(LDFLAGS) -o $@ ldif2id2children.o $(OBJS2) ../libbackends.a $(LIBS)
79 $(CC) $(LDFLAGS) -o $@ ldbmcat.o $(LIBS)
82 $(CC) $(LDFLAGS) -o $@ ldif.o $(LIBS) $(LIBS2)
84 centipede: centipede.o
85 $(CC) -o $@ centipede.o $(LIBS) $(KRBLIBFLAG) $(KRBLIBS)
87 sizecount: sizecount.o ../phonetic.o ../ch_malloc.o
88 $(CC) $(LDFLAGS) -o $@ sizecount.o ../phonetic.o ../ch_malloc.o \
89 $(LIBS) $(KRBLIBFLAG) $(KRBLIBS)
91 ldbmtest: ldbmtest.o ../libbackends.a $(OBJS2)
92 $(CC) $(LDFLAGS) -o ldbmtest ldbmtest.o $(OBJS2) ../libbackends.a $(LIBS)
95 $(RM) $(PROGRAMS) $(XPROGRAMS) $(XSRCS) edb2-vers.c *.o a.out core
98 @if [ "$(HAVE_ISODE)" = "yes" ]; then \
99 DEPENDEXTRAS="$(ISODEINCLUDEFLAG) chlog2replog.c $(EDB2LDIFSRCS)"; \
101 $(MKDEP) $(DEFS) $(DEFINES) $$DEPENDEXTRAS $(SRCS)
103 install-local: install-isode FORCE
104 @-$(MKDIR) -p $(sbindir)
105 $(INSTALL) $(INSTALLFLAGS) -m 755 ldif2ldbm $(sbindir)
106 $(INSTALL) $(INSTALLFLAGS) -m 755 ldif2index $(sbindir)
107 $(INSTALL) $(INSTALLFLAGS) -m 755 ldif2id2entry $(sbindir)
108 $(INSTALL) $(INSTALLFLAGS) -m 755 ldif2id2children $(sbindir)
109 $(INSTALL) $(INSTALLFLAGS) -m 755 ldbmcat $(sbindir)
110 $(INSTALL) $(INSTALLFLAGS) -m 755 ldif $(sbindir)
111 $(INSTALL) $(INSTALLFLAGS) -m 755 centipede $(sbindir)
112 $(INSTALL) $(INSTALLFLAGS) -m 755 ldbmtest $(sbindir)
115 @-$(MKDIR) -p $(sbindir)
116 @if [ "$(HAVE_ISODE)" = "yes" ]; then \
117 $(INSTALL) $(INSTALLFLAGS) -m 755 edb2ldif $(sbindir); \
118 $(INSTALL) $(INSTALLFLAGS) -m 755 chlog2replog $(sbindir); \
123 all-common: all-local FORCE
124 install-common: all-common install-local FORCE
125 depend-common: depend-local FORCE
126 clean-common: clean-local FORCE
127 veryclean-common: clean-common veryclean-local FORCE