]> git.sur5r.net Git - openldap/blob - servers/slapd/tools/Makefile.in
PROTOTYPE: New connection management infrastructure designed to
[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_ISODE = @HAVE_ISODE@
16 BUILD_LDBM = @BUILD_LDBM@
17 BUILD_BDB2 = @BUILD_BDB2@
18
19 LDAP_INCDIR= ../../../include       
20 LDAP_LIBDIR= ../../../libraries
21
22 XLIBS = -lavl -lldif -lldbm -lldap_r -llber -llutil
23 XXLIBS = $(LDAPD_LIBS) $(SLAPD_LIBS) \
24         $(PERL_LDFLAGS) $(LDBM_LIBS) $(KRB_LIBS) $(LUTIL_LIBS)
25 XXXLIBS = $(LTHREAD_LIBS)
26
27 PROGRAMS=ldif2index ldif2ldbm ldbmcat ldif2id2entry ldif2id2children \
28         centipede ldbmtest ldif
29
30 PROGRAMS2=ldif2index-bdb2 ldif2ldbm-bdb2 \
31         ldif2id2entry-bdb2 ldif2id2children-bdb2
32
33 SRCS = centipede.c ldbmcat.c ldbmtest.c sizecount.c \
34         ldif.c ldif2id2children.c ldif2id2entry.c ldif2index.c ldif2ldbm.c \
35         mimic.c
36
37 SRCS2 = ldif2id2children-bdb2.c ldif2id2entry-bdb2.c \
38         ldif2index-bdb2.c ldif2ldbm-bdb2.c
39
40 XSRCS = edb2-vers.c
41
42 EDB2LDIFSRCS    = edb2ldif.c ldapsyntax.c
43 EDB2LDIFOBJS    = edb2ldif.o ldapsyntax.o
44
45 OBJS2   = mimic.o \
46                 ../config.o ../ch_malloc.o ../backend.o ../charray.o \
47                 ../aclparse.o ../schema.o ../filterentry.o \
48                 ../acl.o ../phonetic.o ../attr.o ../value.o ../entry.o \
49                 ../dn.o ../filter.o ../str2filter.o ../ava.o ../init.o \
50                 ../schemaparse.o
51
52 all-local: build-ldbm build-bdb2 build-edb2ldif build-chlog2replog
53
54 build-ldbm: FORCE
55         @if [ "$(BUILD_LDBM)" = "yes" ]; then \
56                 $(MAKE) $(MFLAGS) ldbm-tools; \
57     else \
58                 echo "run configure with --with-ldbm to build LDBM tools"; \
59     fi
60
61 build-bdb2: FORCE
62         @if [ "$(BUILD_BDB2)" = "yes" ]; then \
63                 $(MAKE) $(MFLAGS) bdb2-tools; \
64     else \
65                 echo "run configure with --enable-bdb2 to build BDB2 tools"; \
66     fi
67
68 ldbm-tools: $(PROGRAMS)
69
70 bdb2-tools: $(PROGRAMS2)
71
72 build-edb2ldif: FORCE
73         @if [ "$(HAVE_ISODE)" = "yes" ]; then \
74                 $(MAKE) $(MFLAGS) edb2ldif; \
75     else \
76                 echo "run configure with --with-isode to build edb2ldif"; \
77     fi
78
79 edb2ldif:       edb2-vers.o
80         $(CC) $(LDFLAGS) -o $@ $(EDB2LDIFOBJS) edb2-vers.o $(LIBS)
81
82 edb2-vers.c: $(EDB2LDIFOBJS)
83         $(RM) $@
84         (u=$${USER-root} v=`$(CAT) $(VERSIONFILE)` d=`$(PWD)` h=`$(HOSTNAME)` \
85         t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \
86         -e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \
87         -e "s|%VERSION%|$${v}|" \
88         < Vers-edb2.c > $@)
89
90 build-chlog2replog: FORCE
91         @if [ "$(HAVE_ISODE)" = "yes" ]; then \
92                 $(MAKE) $(MFLAGS) chlog2replog; \
93         else \
94                 echo "run configure with --with-isode to build chlog2replog"; \
95         fi
96
97 chlog2replog: chlog2replog.o ../lock.o ../ch_malloc.o $(SLAPD_LIBDEPEND) 
98         $(LTLINK) -o $@ chlog2replog.o ../lock.o ../ch_malloc.o $(LIBS)
99
100 ldif2index:     ldif2index.o ../libbackends.a $(OBJS2) $(SLAPD_LIBDEPEND) 
101         $(LTLINK) -o $@ ldif2index.o $(OBJS2) ../libbackends.a $(LIBS)
102
103 ldif2index-bdb2:        ldif2index-bdb2.o ../libbackends.a \
104                 $(OBJS2) $(SLAPD_LIBDEPEND) 
105         $(LTLINK) -o $@ ldif2index-bdb2.o $(OBJS2) ../libbackends.a $(LIBS)
106
107 ldif2ldbm:      ldif2ldbm.o ../libbackends.a $(OBJS2) $(SLAPD_LIBDEPEND) 
108         $(LTLINK) -o $@ ldif2ldbm.o $(OBJS2) ../libbackends.a $(LIBS)
109
110 ldif2ldbm-bdb2: ldif2ldbm-bdb2.o ../libbackends.a $(OBJS2) $(SLAPD_LIBDEPEND) 
111         $(LTLINK) -o $@ ldif2ldbm-bdb2.o $(OBJS2) ../libbackends.a $(LIBS)
112
113 ldif2id2entry:  ldif2id2entry.o ../libbackends.a $(OBJS2) $(SLAPD_LIBDEPEND) 
114         $(LTLINK) -o $@ ldif2id2entry.o $(OBJS2) ../libbackends.a $(LIBS)
115
116 ldif2id2entry-bdb2:     ldif2id2entry-bdb2.o ../libbackends.a \
117                 $(OBJS2) $(SLAPD_LIBDEPEND) 
118         $(LTLINK) -o $@ ldif2id2entry-bdb2.o $(OBJS2) ../libbackends.a $(LIBS)
119
120 ldif2id2children:       ldif2id2children.o ../libbackends.a \
121                 $(OBJS2) $(SLAPD_LIBDEPEND) 
122         $(LTLINK) -o $@ ldif2id2children.o $(OBJS2) ../libbackends.a $(LIBS)
123
124 ldif2id2children-bdb2:  ldif2id2children-bdb2.o ../libbackends.a \
125                 $(OBJS2) $(SLAPD_LIBDEPEND) 
126         $(LTLINK) -o $@ ldif2id2children-bdb2.o $(OBJS2) ../libbackends.a $(LIBS)
127
128 ldbmcat:        ldbmcat.o $(SLAPD_LIBDEPEND) 
129         $(LTLINK) -o $@ ldbmcat.o $(LIBS)
130
131 ldif:           ldif.o $(SLAPD_LIBDEPEND) 
132         $(LTLINK) -o $@ ldif.o $(LIBS)
133
134 centipede:      centipede.o $(SLAPD_LIBDEPEND) 
135         $(LTLINK) -o $@ centipede.o $(LIBS)
136
137 sizecount:      sizecount.o ../phonetic.o ../ch_malloc.o $(SLAPD_LIBDEPEND) 
138         $(LTLINK) -o $@ sizecount.o ../phonetic.o ../ch_malloc.o $(LIBS)
139
140 ldbmtest:       ldbmtest.o ../libbackends.a $(OBJS2) $(SLAPD_LIBDEPEND) 
141         $(LTLINK) -o ldbmtest ldbmtest.o $(OBJS2) ../libbackends.a $(LIBS)
142
143 clean-local: FORCE
144         $(RM) $(PROGRAMS) $(PROGRAMS2) $(XPROGRAMS) $(XSRCS) edb2-vers.c \
145                 *.o core .libs/*
146
147 depend-local: FORCE
148         @DEPEND=no ; DEPEND_LDBM= ; DEPEND_BDB2= ; DEPEND_ISODE= ; \
149         if [ "$(BUILD_LDBM)" = "yes" ]; then \
150         DEPEND_LDBM="$(SRCS)"; \
151                 DEPEND=yes ; \
152     fi; \
153         if [ "$(BUILD_BDB2)" = "yes" ]; then \
154         DEPEND_BDB2="$(SRCS2)"; \
155                 DEPEND=yes ; \
156     fi; \
157         if [ "$(HAVE_ISODE)" = "yes" ]; then \
158         DEPEND_ISODE="$(ISODEINCLUDEFLAG) chlog2replog.c $(EDB2LDIFSRCS)"; \
159                 DEPEND=yes ; \
160     fi; \
161         if [ "$$DEPEND" = "yes" ]; then \
162         $(MKDEP) $(DEFS) $(DEFINES) $$DEPEND_ISODE \
163                         $$DEPEND_LDBM $$DEPEND_BDB2; \
164         else \
165                 echo "slapd-tools: no dependencies to make"; \
166         fi
167
168 install-local: install-ldbm install-bdb2 install-isode FORCE
169
170 install-ldbm: FORCE
171         @-$(MKDIR) $(sbindir) 
172         @if [ "$(BUILD_LDBM)" = "yes" ]; then \
173                 $(LTINSTALL) $(INSTALLFLAGS) -m 755 ldif2ldbm $(sbindir)        ; \
174                 $(LTINSTALL) $(INSTALLFLAGS) -m 755 ldif2index $(sbindir)       ; \
175                 $(LTINSTALL) $(INSTALLFLAGS) -m 755 ldif2id2entry $(sbindir)    ; \
176                 $(LTINSTALL) $(INSTALLFLAGS) -m 755 ldif2id2children $(sbindir) ; \
177                 $(LTINSTALL) $(INSTALLFLAGS) -m 755 ldbmcat $(sbindir)  ; \
178                 $(LTINSTALL) $(INSTALLFLAGS) -m 755 ldif $(sbindir)     ; \
179                 $(LTINSTALL) $(INSTALLFLAGS) -m 755 centipede $(sbindir)        ; \
180                 $(LTINSTALL) $(INSTALLFLAGS) -m 755 ldbmtest $(sbindir) ; \
181         else \
182                 exit 0 ; \
183         fi
184
185 install-bdb2: FORCE
186         @-$(MKDIR) $(sbindir) 
187         @if [ "$(BUILD_BDB2)" = "yes" ]; then \
188                 $(LTINSTALL) $(INSTALLFLAGS) -m 755 ldif2ldbm-bdb2 $(sbindir)   ; \
189                 $(LTINSTALL) $(INSTALLFLAGS) -m 755 ldif2index-bdb2 $(sbindir)  ; \
190                 $(LTINSTALL) $(INSTALLFLAGS) -m 755 ldif2id2entry-bdb2 $(sbindir)       ; \
191                 $(LTINSTALL) $(INSTALLFLAGS) -m 755 ldif2id2children-bdb2 $(sbindir) ; \
192         else \
193                 exit 0 ; \
194         fi
195
196 install-isode: FORCE
197         @-$(MKDIR) $(sbindir)
198         @if [ "$(HAVE_ISODE)" = "yes" ]; then \
199                 $(LTINSTALL) $(INSTALLFLAGS) -m 755 edb2ldif $(sbindir); \
200                 $(LTINSTALL) $(INSTALLFLAGS) -m 755 chlog2replog $(sbindir); \
201         else \
202                 exit 0 ; \
203         fi
204