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