]> git.sur5r.net Git - openldap/blob - servers/slapd/tools/Makefile.in
Import KRB_LIBS fix from -devel.
[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
18 LDAP_INCDIR= ../../../include       
19 LDAP_LIBDIR= ../../../libraries
20
21 PROGRAMS=ldif2index ldif2ldbm ldbmcat ldif2id2entry \
22         ldif2id2children centipede ldbmtest ldif
23
24 SRCS = centipede.c ldbmcat.c ldbmtest.c sizecount.c \
25         ldif.c ldif2id2children.c ldif2id2entry.c ldif2index.c ldif2ldbm.c
26
27 XSRCS = edb2-vers.c
28
29 EDB2LDIFSRCS    = edb2ldif.c ldapsyntax.c
30 EDB2LDIFOBJS    = edb2ldif.o ldapsyntax.o
31
32 OBJS2   = ../config.o ../ch_malloc.o ../backend.o ../charray.o \
33                 ../aclparse.o ../schema.o ../result.o ../filterentry.o \
34                 ../acl.o ../phonetic.o ../attr.o ../value.o ../entry.o \
35                 ../dn.o ../filter.o ../str2filter.o ../ava.o ../init.o \
36                 ../schemaparse.o
37
38 all-local: build-ldbm build-edb2ldif build-chlog2replog
39
40 build-ldbm: FORCE
41         @if [ "$(BUILD_LDBM)" = "yes" ]; then \
42                 $(MAKE) $(MFLAGS) ldbm-tools; \
43     else \
44                 echo "run configure with --with-ldbm to build LDBM tools"; \
45     fi
46
47 ldbm-tools: $(PROGRAMS)
48
49 XLIBS = @SLAPD_LIBS@ -lavl -lldbm @LDBM_LIBS@ -llthread @LTHREAD_LIBS@ \
50         $(KRB_LIBS) -llutil @LUTIL_LIBS@
51
52 build-edb2ldif: FORCE
53         @if [ "$(HAVE_ISODE)" = "yes" ]; then \
54                 $(MAKE) $(MFLAGS) edb2ldif; \
55     else \
56                 echo "run configure with --with-isode to build edb2ldif"; \
57     fi
58
59 edb2ldif:       edb2-vers.o
60         $(CC) $(LDFLAGS) -o $@ $(EDB2LDIFOBJS) edb2-vers.o $(LIBS)
61
62 edb2-vers.c: $(EDB2LDIFOBJS)
63         $(RM) $@
64         (u=$${USER-root} v=`$(CAT) $(VERSIONFILE)` d=`$(PWD)` h=`$(HOSTNAME)` \
65         t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \
66         -e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \
67         -e "s|%VERSION%|$${v}|" \
68         < Vers-edb2.c > $@)
69
70 build-chlog2replog: FORCE
71         @if [ "$(HAVE_ISODE)" = "yes" ]; then \
72                 $(MAKE) $(MFLAGS) chlog2replog; \
73         else \
74                 echo "run configure with --with-isode to build chlog2replog"; \
75         fi
76
77 chlog2replog: chlog2replog.o ../lock.o ../ch_malloc.o
78         $(LTLINK) -o $@ chlog2replog.o ../lock.o ../ch_malloc.o $(LIBS)
79
80 ldif2index:     ldif2index.o ../libbackends.a $(OBJS2)
81         $(LTLINK) -o $@ ldif2index.o $(OBJS2) ../libbackends.a $(LIBS)
82
83 ldif2ldbm:      ldif2ldbm.o ../libbackends.a $(OBJS2)
84         $(LTLINK) -o $@ ldif2ldbm.o $(OBJS2) ../libbackends.a $(LIBS)
85
86 ldif2id2entry:  ldif2id2entry.o ../libbackends.a $(OBJS2)
87         $(LTLINK) -o $@ ldif2id2entry.o $(OBJS2) ../libbackends.a $(LIBS)
88
89 ldif2id2children:       ldif2id2children.o ../libbackends.a $(OBJS2)
90         $(LTLINK) -o $@ ldif2id2children.o $(OBJS2) ../libbackends.a $(LIBS)
91
92 ldbmcat:        ldbmcat.o
93         $(LTLINK) -o $@ ldbmcat.o $(LIBS)
94
95 ldif:           ldif.o
96         $(LTLINK) -o $@ ldif.o $(LIBS) $(LIBS2)
97
98 centipede:      centipede.o 
99         $(LTLINK) -o $@ centipede.o $(LIBS) $(KRBLIBFLAG) $(KRBLIBS)
100
101 sizecount:      sizecount.o ../phonetic.o ../ch_malloc.o
102         $(LTLINK) -o $@ sizecount.o ../phonetic.o ../ch_malloc.o \
103                 $(LIBS) $(KRBLIBFLAG) $(KRBLIBS)
104
105 ldbmtest:       ldbmtest.o ../libbackends.a $(OBJS2)
106         $(LTLINK) -o ldbmtest ldbmtest.o $(OBJS2) ../libbackends.a $(LIBS)
107
108 clean-local: FORCE
109         $(RM) $(PROGRAMS) $(XPROGRAMS) $(XSRCS) edb2-vers.c \
110                 *.o core .libs/*
111
112 depend-local: FORCE
113         @DEPEND=no ; DEPEND_LDBM= ; DEPEND_ISODE= ; \
114         if [ "$(BUILD_LDBM)" = "yes" ]; then \
115         DEPEND_LDBM="$(SRCS)"; \
116                 DEPEND=yes ; \
117     fi; \
118         if [ "$(HAVE_ISODE)" = "yes" ]; then \
119         DEPEND_ISODE="$(ISODEINCLUDEFLAG) chlog2replog.c $(EDB2LDIFSRCS)"; \
120                 DEPEND=yes ; \
121     fi; \
122         if [ "$$DEPEND" = "yes" ]; then \
123         $(MKDEP) $(DEFS) $(DEFINES) $$DEPEND_ISODE $$DEPEND_LDBM; \
124         else \
125                 exit 0; \
126         fi
127
128 install-local: install-ldbm install-isode FORCE
129
130 install-ldbm: FORCE
131         @-$(MKDIR) -p $(sbindir) 
132         @if [ "$(BUILD_LDBM)" = "yes" ]; then \
133                 $(LTINSTALL) $(INSTALLFLAGS) -m 755 ldif2ldbm $(sbindir)        ; \
134                 $(LTINSTALL) $(INSTALLFLAGS) -m 755 ldif2index $(sbindir)       ; \
135                 $(LTINSTALL) $(INSTALLFLAGS) -m 755 ldif2id2entry $(sbindir)    ; \
136                 $(LTINSTALL) $(INSTALLFLAGS) -m 755 ldif2id2children $(sbindir) ; \
137                 $(LTINSTALL) $(INSTALLFLAGS) -m 755 ldbmcat $(sbindir)  ; \
138                 $(LTINSTALL) $(INSTALLFLAGS) -m 755 ldif $(sbindir)     ; \
139                 $(LTINSTALL) $(INSTALLFLAGS) -m 755 centipede $(sbindir)        ; \
140                 $(LTINSTALL) $(INSTALLFLAGS) -m 755 ldbmtest $(sbindir) ; \
141         else \
142                 exit 0 ; \
143         fi
144
145 install-isode: FORCE
146         @-$(MKDIR) -p $(sbindir)
147         @if [ "$(HAVE_ISODE)" = "yes" ]; then \
148                 $(LTINSTALL) $(INSTALLFLAGS) -m 755 edb2ldif $(sbindir); \
149                 $(LTINSTALL) $(INSTALLFLAGS) -m 755 chlog2replog $(sbindir); \
150         else \
151                 exit 0 ; \
152         fi
153