]> git.sur5r.net Git - openldap/blob - servers/slapd/tools/Makefile.in
Specifies the symbols that slapd must export, for Mingw32 support
[openldap] / servers / slapd / tools / Makefile.in
1 # $OpenLDAP$
2 #-----------------------------------------------------------------------------
3 # Copyright (c) 1995 Regents of the University of Michigan.
4 # All rights reserved.
5 #
6 # Redistribution and use in source and binary forms are permitted
7 # provided that this notice is preserved and that due credit is given
8 # to the University of Michigan at Ann Arbor. The name of the University
9 # may not be used to endorse or promote products derived from this
10 # software without specific prior written permission. This software
11 # is provided ``as is'' without express or implied warranty.
12 #
13 #       Stand alone LDAP server tools makefile
14 #
15 #-----------------------------------------------------------------------------
16 BUILD_LDBM = @BUILD_LDBM@
17 BUILD_BDB2 = @BUILD_BDB2@
18 BUILD_QUIPU = @BUILD_QUIPU@
19
20 LDAP_INCDIR= ../../../include       
21 LDAP_LIBDIR= ../../../libraries
22
23 SLAP_DIR=../
24 SLAPD_MODULES = @SLAPD_MODULES_LIST@
25 XDEFS = $(MODULES_CPPFLAGS)
26 XLDFLAGS = $(MODULES_LDFLAGS) $(SLAPD_MODULES)
27
28 XLIBS = -lavl -lldif -lldbm -llutil -lldap_r -llber
29 XXLIBS = $(LDAPD_LIBS) $(SLAPD_LIBS) \
30         $(PERL_LDFLAGS) $(LDBM_LIBS) $(SECURITY_LIBS) \
31         $(LDIF_LIBS) $(LUTIL_LIBS)
32 XXXLIBS = $(LTHREAD_LIBS) $(MODULES_LIBS)
33
34 PROGRAMS=ldif slapadd slapcat slapindex
35 LDBMPROGRAMS=centipede sizecount
36 BDB2PROGRAMS=
37 QUIPUPROGRAMS=chlog2replog edb2ldif
38
39 # CPPFLAGS will include the defines for dynamic libs in Mingw32.
40 NT_DYN_DEFS = -DLIBLBER_DECL=dllimport -DLIBLDAP_DECL=dllimport
41 CPPFLAGS = $(@PLAT@_@LIB_LINKAGE@_DEFS)
42
43 SRCS = ldif.c mimic.c slapcommon.c
44
45 XSRCS = edb2-vers.c
46
47 LDBMSRCS = centipede.c sizecount.c
48
49 BDB2SRCS =
50
51 QUIPUSRCS       = edb2ldif.c ldapsyntax.c chlog2replog.c
52 SLAPD_OBJS = ../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 SLAPOBJS = $(SLAPD_OBJS) slapcommon.o mimic.o 
58
59 EDB2LDIFSRCS    = edb2ldif.c ldapsyntax.c
60 EDB2LDIFOBJS    = edb2ldif.o ldapsyntax.o
61
62 UNIX_PRGS = build-ldbm build-bdb2 build-quipu
63
64 all-local: build-progs $(@PLAT@_PRGS)
65
66 build-progs: $(PROGRAMS)
67
68 build-ldbm: ldbm-tools-$(BUILD_LDBM)
69 ldbm-tools-no:
70         @echo "run configure with --enable-ldbm to build LDBM tools"
71
72 ldbm-tools-yes ldbm-tools-mod: $(LDBMPROGRAMS)
73
74 build-bdb2: bdb2-tools-$(BUILD_BDB2)
75 bdb2-tools-no:
76         @echo "run configure with --enable-bdb2 to build BDB2 tools"
77
78 bdb2-tools-yes bdb2-tools-mod: $(BDB2PROGRAMS)
79
80 build-quipu: quipu-tools-$(BUILD_QUIPU)
81 quipu-tools-no:
82         @echo "run configure with --enable-quipu to build QUIPU tools"
83
84 quipu-tools-yes quipu-tools-mod: $(QUIPUPROGRAMS)
85
86 #
87 # SLAP Tools
88 #
89 slapadd:        slapadd.o ../libbackends.a $(SLAPOBJS) $(SLAPD_LIBDEPEND) 
90         $(LTLINK) -o $@ slapadd.o $(SLAPOBJS) ../libbackends.a $(LIBS)
91
92 slapcat:        slapcat.o ../libbackends.a $(SLAPOBJS) $(SLAPD_LIBDEPEND) 
93         $(LTLINK) -o $@ slapcat.o $(SLAPOBJS) ../libbackends.a $(LIBS)
94
95 slapindex:      slapindex.o ../libbackends.a $(SLAPOBJS) $(SLAPD_LIBDEPEND) 
96         $(LTLINK) -o $@ slapindex.o $(SLAPOBJS) ../libbackends.a $(LIBS)
97
98 ldif:           ldif.o $(SLAPD_LIBDEPEND) 
99         $(LTLINK) -o $@ ldif.o $(LIBS)
100
101 #
102 # LDBM Specific Tools
103 #
104 centipede:      centipede.o $(SLAPD_LIBDEPEND) 
105         $(LTLINK) -o $@ centipede.o $(LIBS)
106
107 sizecount:      sizecount.o ../phonetic.o ../ch_malloc.o $(SLAPD_LIBDEPEND) 
108         $(LTLINK) -o $@ sizecount.o ../phonetic.o ../ch_malloc.o $(LIBS)
109
110 #
111 # BDBM Specific Tools
112 #
113
114 #
115 # QUIPU Specific Tools
116 #
117 edb2ldif:       edb2-vers.o
118         $(CC) $(LDFLAGS) -o $@ $(EDB2LDIFOBJS) edb2-vers.o $(LIBS)
119
120 edb2-vers.c: $(EDB2LDIFOBJS)
121         @-$(RM) $@
122         $(MKVERSION) ebd2ldif > $@
123
124 chlog2replog: chlog2replog.o ../lock.o ../ch_malloc.o $(SLAPD_LIBDEPEND) 
125         $(LTLINK) -o $@ chlog2replog.o ../lock.o ../ch_malloc.o $(LIBS)
126
127 clean-local: FORCE
128         $(RM) $(PROGRAMS) $(LDBMPROGRAMS) $(BDB2PROGRAMS) $(QUIPUPROGRAMS) \
129                 $(XPROGRAMS) $(XSRCS) *.o core .libs/* *.exe
130
131 depend-local: FORCE
132         DEPEND_LDBM= ; DEPEND_BDB2= ; DEPEND_QUIPU= ; \
133         if [ "$(BUILD_LDBM)" != "no" ]; then \
134                 DEPEND_LDBM="$(LDBMSRCS)"; \
135         fi; \
136         if [ "$(BUILD_BDB2)" != "no" ]; then \
137                 DEPEND_BDB2="$(BDBMSRCS)"; \
138         fi; \
139         if [ "$(BUILD_QUIPU)" != "no" ]; then \
140                 DEPEND_QUIPU="$(QUIPUINCLUDEFLAG) $(QUIPUSRCS)"; \
141         fi; \
142         $(MKDEP) $(DEFS) $(DEFINES) $(SRCS) $$DEPEND_QUIPU \
143                         $$DEPEND_LDBM $$DEPEND_BDB2
144
145 install-local: install-ldbm-$(BUILD_LDBM) install-bdb2-$(BUILD_BDB2) \
146          install-quipu-$(BUILD_QUIPU)
147
148 install-ldbm-no install-bdb2-no install-quipu-no:
149
150 install-ldbm-yes install-ldbm-mod: FORCE
151         -$(MKDIR) $(DESTDIR)$(sbindir) 
152         @for bin in $(PROGRAMS); do \
153                 $(LTINSTALL) $(INSTALLFLAGS) -m 755 $$bin$(EXEEXT) \
154                                                     $(DESTDIR)$(sbindir); \
155         done
156
157 install-bdb2-yes install-bdb2-mod: FORCE
158         @-$(MKDIR) $(DESTDIR)$(sbindir) 
159
160 install-quipu-yes: FORCE
161         @-$(MKDIR) $(DESTDIR)$(sbindir)
162         for bin in edb2ldif chlog2replog; do \
163                 $(LTINSTALL) $(INSTALLFLAGS) -m 755 $$bin $(DESTDIR)$(sbindir); \
164         done