]> git.sur5r.net Git - openldap/blob - servers/slapd/tools/Makefile.in
Final round of module changes
[openldap] / servers / slapd / tools / Makefile.in
1 #-----------------------------------------------------------------------------
2 # Copyright (c) 1995 Regents of the University of Michigan.
3 # All rights reserved.
4 #
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.
11 #
12 #       Stand alone LDAP server tools makefile
13 #
14 #-----------------------------------------------------------------------------
15 HAVE_QUIPU = @BUILD_QUIPU@
16 BUILD_LDBM = @BUILD_LDBM@
17 BUILD_BDB2 = @BUILD_BDB2@
18
19 LDAP_INCDIR= ../../../include       
20 LDAP_LIBDIR= ../../../libraries
21
22 SLAP_DIR=../
23 SLAPD_MODULES = @SLAPD_MODULES_LIST@
24 XDEFS = $(MODULES_CPPFLAGS)
25 XLDFLAGS = $(MODULES_LDFLAGS) $(SLAPD_MODULES)
26
27 XLIBS = -lavl -lldif -lldbm -lldap_r -llber -llutil
28 XXLIBS = $(LDAPD_LIBS) $(SLAPD_LIBS) \
29         $(PERL_LDFLAGS) $(LDBM_LIBS) $(SECURITY_LIBS) \
30         $(LDIF_LIBS) $(LUTIL_LIBS)
31 XXXLIBS = $(LTHREAD_LIBS) $(MODULES_LIBS)
32
33 PROGRAMS=ldif2index ldif2ldbm ldbmcat ldif2id2entry ldif2id2children \
34         centipede ldbmtest ldif
35
36 PROGRAMS2=ldif2index-bdb2 ldif2ldbm-bdb2 \
37         ldif2id2entry-bdb2 ldif2id2children-bdb2
38
39 SRCS = centipede.c ldbmcat.c ldbmtest.c sizecount.c \
40         ldif.c ldif2id2children.c ldif2id2entry.c ldif2index.c ldif2ldbm.c \
41         mimic.c ldif2common.c
42
43 SRCS2 = ldif2id2children-bdb2.c ldif2id2entry-bdb2.c \
44         ldif2index-bdb2.c ldif2ldbm-bdb2.c
45
46 XSRCS = edb2-vers.c
47
48 EDB2LDIFSRCS    = edb2ldif.c ldapsyntax.c
49 EDB2LDIFOBJS    = edb2ldif.o ldapsyntax.o
50
51 OBJS1   = mimic.o \
52                 ../config.o ../ch_malloc.o ../backend.o ../charray.o \
53                 ../module.o ../aclparse.o ../schema.o ../filterentry.o \
54                 ../acl.o ../phonetic.o ../attr.o ../value.o ../entry.o \
55                 ../dn.o ../filter.o ../str2filter.o ../ava.o ../init.o \
56                 ../controls.o ../schemaparse.o
57 OBJS2   = $(OBJS1) ldif2common.o
58
59 all-local: build-ldbm build-bdb2 build-edb2ldif build-chlog2replog
60
61 build-ldbm: ldbm-tools-$(BUILD_LDBM)
62 ldbm-tools-no:
63         @echo "run configure with --enable-ldbm to build LDBM tools"
64
65 build-bdb2: bdb2-tools-$(BUILD_BDB2)
66 bdb2-tools-no:
67         @echo "run configure with --enable-bdb2 to build BDB2 tools"
68
69 ldbm-tools-yes ldbm-tools-mod: $(PROGRAMS)
70
71 bdb2-tools-yes bdb2-tools-mod: $(PROGRAMS2)
72
73 build-edb2ldif: edb-$(HAVE_QUIPU)
74 edb-no:
75         @echo "run configure with --enable-quipu to build edb2ldif"
76 edb-yes: edb2ldif
77
78 edb2ldif:       edb2-vers.o
79         $(CC) $(LDFLAGS) -o $@ $(EDB2LDIFOBJS) edb2-vers.o $(LIBS)
80
81 edb2-vers.c: $(EDB2LDIFOBJS)
82         @-$(RM) $@
83         $(MKVERSION) ebd2ldif > $@
84
85 build-chlog2replog: chlog-$(HAVE_QUIPU)
86 chlog-no:
87         @echo "run configure with --enable-quipu to build chlog2replog"
88 chlog-yes: chlog2replog
89
90 chlog2replog: chlog2replog.o ../lock.o ../ch_malloc.o $(SLAPD_LIBDEPEND) 
91         $(LTLINK) -o $@ chlog2replog.o ../lock.o ../ch_malloc.o $(LIBS)
92
93 ldif2index:     ldif2index.o ../libbackends.a $(OBJS2) $(SLAPD_LIBDEPEND) 
94         $(LTLINK) -o $@ ldif2index.o $(OBJS2) ../libbackends.a $(LIBS)
95
96 ldif2index-bdb2:        ldif2index-bdb2.o ../libbackends.a \
97                 $(OBJS2) $(SLAPD_LIBDEPEND) 
98         $(LTLINK) -o $@ ldif2index-bdb2.o $(OBJS2) ../libbackends.a $(LIBS)
99
100 ldif2ldbm:      ldif2ldbm.o ../libbackends.a $(OBJS2) $(SLAPD_LIBDEPEND) 
101         $(LTLINK) -o $@ ldif2ldbm.o $(OBJS2) ../libbackends.a $(LIBS)
102
103 ldif2ldbm-bdb2: ldif2ldbm-bdb2.o ../libbackends.a $(OBJS2) $(SLAPD_LIBDEPEND) 
104         $(LTLINK) -o $@ ldif2ldbm-bdb2.o $(OBJS2) ../libbackends.a $(LIBS)
105
106 ldif2id2entry:  ldif2id2entry.o ../libbackends.a $(OBJS2) $(SLAPD_LIBDEPEND) 
107         $(LTLINK) -o $@ ldif2id2entry.o $(OBJS2) ../libbackends.a $(LIBS)
108
109 ldif2id2entry-bdb2:     ldif2id2entry-bdb2.o ../libbackends.a \
110                 $(OBJS2) $(SLAPD_LIBDEPEND) 
111         $(LTLINK) -o $@ ldif2id2entry-bdb2.o $(OBJS2) ../libbackends.a $(LIBS)
112
113 ldif2id2children:       ldif2id2children.o ../libbackends.a \
114                 $(OBJS2) $(SLAPD_LIBDEPEND) 
115         $(LTLINK) -o $@ ldif2id2children.o $(OBJS2) ../libbackends.a $(LIBS)
116
117 ldif2id2children-bdb2:  ldif2id2children-bdb2.o ../libbackends.a \
118                 $(OBJS2) $(SLAPD_LIBDEPEND) 
119         $(LTLINK) -o $@ ldif2id2children-bdb2.o $(OBJS2) ../libbackends.a $(LIBS)
120
121 ldbmcat:        ldbmcat.o $(SLAPD_LIBDEPEND) 
122         $(LTLINK) -o $@ ldbmcat.o $(LIBS)
123
124 ldif:           ldif.o $(SLAPD_LIBDEPEND) 
125         $(LTLINK) -o $@ ldif.o $(LIBS)
126
127 centipede:      centipede.o $(SLAPD_LIBDEPEND) 
128         $(LTLINK) -o $@ centipede.o $(LIBS)
129
130 sizecount:      sizecount.o ../phonetic.o ../ch_malloc.o $(SLAPD_LIBDEPEND) 
131         $(LTLINK) -o $@ sizecount.o ../phonetic.o ../ch_malloc.o $(LIBS)
132
133 ldbmtest:       ldbmtest.o ../libbackends.a $(OBJS1) $(SLAPD_LIBDEPEND) 
134         $(LTLINK) -o ldbmtest ldbmtest.o $(OBJS1) ../libbackends.a $(LIBS)
135
136 clean-local: FORCE
137         $(RM) $(PROGRAMS) $(PROGRAMS2) $(XPROGRAMS) $(XSRCS) edb2-vers.c \
138                 *.o core .libs/*
139
140 depend-local: FORCE
141         @DEPEND=no ; DEPEND_LDBM= ; DEPEND_BDB2= ; DEPEND_QUIPU= ; \
142         if [ "$(BUILD_LDBM)" != "no" ]; then \
143                 DEPEND_LDBM="$(SRCS)"; \
144                 DEPEND=yes ; \
145         fi; \
146         if [ "$(BUILD_BDB2)" != "no" ]; then \
147                 DEPEND_BDB2="$(SRCS2)"; \
148                 DEPEND=yes ; \
149         fi; \
150         if [ "$(HAVE_QUIPU)" != "no" ]; then \
151                 DEPEND_QUIPU="$(QUIPUINCLUDEFLAG) chlog2replog.c $(EDB2LDIFSRCS)"; \
152                 DEPEND=yes ; \
153         fi; \
154         if [ "$$DEPEND" = "yes" ]; then \
155         $(MKDEP) $(DEFS) $(DEFINES) $$DEPEND_QUIPU \
156                         $$DEPEND_LDBM $$DEPEND_BDB2; \
157         else \
158                 echo "slapd-tools: no dependencies to make"; \
159         fi
160
161 install-local: install-ldbm-$(BUILD_LDBM) install-bdb2-$(BUILD_BDB2) \
162          install-quipu-$(HAVE_QUIPU)
163
164 install-ldbm-no install-bdb2-no install-quipu-no:
165
166 install-ldbm-yes install-ldbm-mod: FORCE
167         @-$(MKDIR) $(sbindir) 
168         $(LTINSTALL) $(INSTALLFLAGS) -m 755 ldif2ldbm $(sbindir)        ; \
169         $(LTINSTALL) $(INSTALLFLAGS) -m 755 ldif2index $(sbindir)       ; \
170         $(LTINSTALL) $(INSTALLFLAGS) -m 755 ldif2id2entry $(sbindir)    ; \
171         $(LTINSTALL) $(INSTALLFLAGS) -m 755 ldif2id2children $(sbindir) ; \
172         $(LTINSTALL) $(INSTALLFLAGS) -m 755 ldbmcat $(sbindir)  ; \
173         $(LTINSTALL) $(INSTALLFLAGS) -m 755 ldif $(sbindir)     ; \
174         $(LTINSTALL) $(INSTALLFLAGS) -m 755 centipede $(sbindir)        ; \
175         $(LTINSTALL) $(INSTALLFLAGS) -m 755 ldbmtest $(sbindir)
176
177 install-bdb2-yes install-bdb2-mod: FORCE
178         @-$(MKDIR) $(sbindir) 
179         $(LTINSTALL) $(INSTALLFLAGS) -m 755 ldif2ldbm-bdb2 $(sbindir)   ; \
180         $(LTINSTALL) $(INSTALLFLAGS) -m 755 ldif2index-bdb2 $(sbindir)  ; \
181         $(LTINSTALL) $(INSTALLFLAGS) -m 755 ldif2id2entry-bdb2 $(sbindir) ; \
182         $(LTINSTALL) $(INSTALLFLAGS) -m 755 ldif2id2children-bdb2 $(sbindir)
183
184 install-quipu-yes: FORCE
185         @-$(MKDIR) $(sbindir)
186         $(LTINSTALL) $(INSTALLFLAGS) -m 755 edb2ldif $(sbindir); \
187         $(LTINSTALL) $(INSTALLFLAGS) -m 755 chlog2replog $(sbindir)
188