Makefile.in 5.16 KB
Newer Older
Kurt Zeilenga's avatar
Kurt Zeilenga committed
1
# $OpenLDAP$
Kurt Zeilenga's avatar
Kurt Zeilenga committed
2
3
## Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
## COPYING RESTRICTIONS APPLY, see COPYRIGHT file
Kurt Zeilenga's avatar
Kurt Zeilenga committed
4
#-----------------------------------------------------------------------------
Kurt Zeilenga's avatar
Kurt Zeilenga committed
5
# Portions Copyright (c) 1995 Regents of the University of Michigan.
Kurt Zeilenga's avatar
Kurt Zeilenga committed
6
7
8
9
10
11
12
13
14
15
16
17
18
# All rights reserved.
#
# Redistribution and use in source and binary forms are permitted
# provided that this notice is preserved and that due credit is given
# to the University of Michigan at Ann Arbor. The name of the University
# may not be used to endorse or promote products derived from this
# software without specific prior written permission. This software
# is provided ``as is'' without express or implied warranty.
#
#       Stand alone LDAP server tools makefile
#
#-----------------------------------------------------------------------------
BUILD_LDBM = @BUILD_LDBM@
19
BUILD_BDB2 = @BUILD_BDB2@
20
BUILD_QUIPU = @BUILD_QUIPU@
Kurt Zeilenga's avatar
Kurt Zeilenga committed
21
22
23
24

LDAP_INCDIR= ../../../include       
LDAP_LIBDIR= ../../../libraries

25
26
SLAP_DIR=../
SLAPD_MODULES = @SLAPD_MODULES_LIST@
27
XDEFS = $(MODULES_CPPFLAGS)
28
XLDFLAGS = $(MODULES_LDFLAGS) $(SLAPD_MODULES)
29

30
XLIBS = -lavl -lldif -lldbm -llutil -lldap_r -llber
31
XXLIBS = $(LDAPD_LIBS) $(SLAPD_LIBS) \
32
	$(LDBM_LIBS) $(SECURITY_LIBS) \
33
	$(LDIF_LIBS) $(LUTIL_LIBS)
34
XXXLIBS = $(LTHREAD_LIBS) $(MODULES_LIBS)
35

36
PROGRAMS=ldif slappasswd slapadd slapcat slapindex
37
38
39
LDBMPROGRAMS=centipede sizecount
BDB2PROGRAMS=
QUIPUPROGRAMS=chlog2replog edb2ldif
40

41
42
43
44
# CPPFLAGS will include the defines for dynamic libs in Mingw32.
NT_DYN_DEFS = -DLIBLBER_DECL=dllimport -DLIBLDAP_DECL=dllimport
CPPFLAGS = $(@PLAT@_@LIB_LINKAGE@_DEFS)

45
SRCS = ldif.c mimic.c slapcommon.c
46

47
48
XSRCS = edb2-vers.c

49
50
51
LDBMSRCS = centipede.c sizecount.c

BDB2SRCS =
Kurt Zeilenga's avatar
Kurt Zeilenga committed
52

53
54
QUIPUSRCS	= edb2ldif.c ldapsyntax.c chlog2replog.c
SLAPD_OBJS = ../config.o ../ch_malloc.o ../backend.o ../charray.o \
55
		../module.o ../aclparse.o ../filterentry.o \
Kurt Zeilenga's avatar
Kurt Zeilenga committed
56
		../schema.o ../schema_check.o ../schema_init.o ../schema_prep.o \
57
		../schemaparse.o ../ad.o ../at.o ../mr.o ../oc.o ../syntax.o \
Kurt Zeilenga's avatar
Kurt Zeilenga committed
58
59
		../acl.o ../phonetic.o ../attr.o ../value.o ../entry.o \
		../dn.o ../filter.o ../str2filter.o ../ava.o ../init.o \
60
		../controls.o ../kerberos.o ../passwd.o \
61
		../extended.o ../starttls.o
62

63
SLAPOBJS = $(SLAPD_OBJS) slapcommon.o mimic.o
Kurt Zeilenga's avatar
Kurt Zeilenga committed
64

65
66
67
EDB2LDIFSRCS    = edb2ldif.c ldapsyntax.c
EDB2LDIFOBJS    = edb2ldif.o ldapsyntax.o

68
69
70
UNIX_PRGS = build-ldbm build-bdb2 build-quipu

all-local: build-progs $(@PLAT@_PRGS)
71
72

build-progs: $(PROGRAMS)
Kurt Zeilenga's avatar
Kurt Zeilenga committed
73

Howard Chu's avatar
Howard Chu committed
74
75
76
build-ldbm: ldbm-tools-$(BUILD_LDBM)
ldbm-tools-no:
	@echo "run configure with --enable-ldbm to build LDBM tools"
Kurt Zeilenga's avatar
Kurt Zeilenga committed
77

78
79
ldbm-tools-yes ldbm-tools-mod: $(LDBMPROGRAMS)

Howard Chu's avatar
Howard Chu committed
80
81
82
build-bdb2: bdb2-tools-$(BUILD_BDB2)
bdb2-tools-no:
	@echo "run configure with --enable-bdb2 to build BDB2 tools"
83

84
bdb2-tools-yes bdb2-tools-mod: $(BDB2PROGRAMS)
85

86
87
88
build-quipu: quipu-tools-$(BUILD_QUIPU)
quipu-tools-no:
	@echo "run configure with --enable-quipu to build QUIPU tools"
Kurt Zeilenga's avatar
Kurt Zeilenga committed
89

90
quipu-tools-yes quipu-tools-mod: $(QUIPUPROGRAMS)
91

92
93
94
95
96
#
# SLAP Tools
#
slapadd:	slapadd.o ../libbackends.a $(SLAPOBJS) $(SLAPD_LIBDEPEND) 
	$(LTLINK) -o $@ slapadd.o $(SLAPOBJS) ../libbackends.a $(LIBS)
Kurt Zeilenga's avatar
Kurt Zeilenga committed
97

98
99
slapcat:	slapcat.o ../libbackends.a $(SLAPOBJS) $(SLAPD_LIBDEPEND) 
	$(LTLINK) -o $@ slapcat.o $(SLAPOBJS) ../libbackends.a $(LIBS)
100

101
102
slapindex:	slapindex.o ../libbackends.a $(SLAPOBJS) $(SLAPD_LIBDEPEND) 
	$(LTLINK) -o $@ slapindex.o $(SLAPOBJS) ../libbackends.a $(LIBS)
Kurt Zeilenga's avatar
Kurt Zeilenga committed
103

104
ldif:		ldif.o $(SLAPD_LIBDEPEND) 
105
	$(LTLINK) -o $@ ldif.o $(LIBS)
Kurt Zeilenga's avatar
Kurt Zeilenga committed
106

107
108
109
slappasswd:		slappasswd.o $(SLAPD_LIBDEPEND) 
	$(LTLINK) -o $@ slappasswd.o $(LIBS)

110
111
112
#
# LDBM Specific Tools
#
113
centipede:	centipede.o $(SLAPD_LIBDEPEND) 
114
	$(LTLINK) -o $@ centipede.o $(LIBS)
Kurt Zeilenga's avatar
Kurt Zeilenga committed
115

116
sizecount:	sizecount.o ../phonetic.o ../ch_malloc.o $(SLAPD_LIBDEPEND) 
117
	$(LTLINK) -o $@ sizecount.o ../phonetic.o ../ch_malloc.o $(LIBS)
Kurt Zeilenga's avatar
Kurt Zeilenga committed
118

119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
#
# BDBM Specific Tools
#

#
# QUIPU Specific Tools
#
edb2ldif:	edb2-vers.o
	$(CC) $(LDFLAGS) -o $@ $(EDB2LDIFOBJS) edb2-vers.o $(LIBS)

edb2-vers.c: $(EDB2LDIFOBJS)
	@-$(RM) $@
	$(MKVERSION) ebd2ldif > $@

chlog2replog: chlog2replog.o ../lock.o ../ch_malloc.o $(SLAPD_LIBDEPEND) 
	$(LTLINK) -o $@ chlog2replog.o ../lock.o ../ch_malloc.o $(LIBS)
Kurt Zeilenga's avatar
Kurt Zeilenga committed
135
136

clean-local: FORCE
Kurt Zeilenga's avatar
Kurt Zeilenga committed
137
	$(RM) $(PROGRAMS) $(LDBMPROGRAMS) $(BDB2PROGRAMS) $(QUIPUPROGRAMS) \
138
		$(XPROGRAMS) $(XSRCS) *.o core .libs/* *.exe
Kurt Zeilenga's avatar
Kurt Zeilenga committed
139
140

depend-local: FORCE
141
	DEPEND_LDBM= ; DEPEND_BDB2= ; DEPEND_QUIPU= ; \
Howard Chu's avatar
Howard Chu committed
142
	if [ "$(BUILD_LDBM)" != "no" ]; then \
143
		DEPEND_LDBM="$(LDBMSRCS)"; \
144
	fi; \
Howard Chu's avatar
Howard Chu committed
145
	if [ "$(BUILD_BDB2)" != "no" ]; then \
146
		DEPEND_BDB2="$(BDBMSRCS)"; \
147
	fi; \
148
149
	if [ "$(BUILD_QUIPU)" != "no" ]; then \
		DEPEND_QUIPU="$(QUIPUINCLUDEFLAG) $(QUIPUSRCS)"; \
150
	fi; \
151
152
	$(MKDEP) $(DEFS) $(DEFINES) $(SRCS) $$DEPEND_QUIPU \
			$$DEPEND_LDBM $$DEPEND_BDB2
Kurt Zeilenga's avatar
Kurt Zeilenga committed
153

Howard Chu's avatar
Howard Chu committed
154
install-local: install-ldbm-$(BUILD_LDBM) install-bdb2-$(BUILD_BDB2) \
Kurt Zeilenga's avatar
Kurt Zeilenga committed
155
	 install-quipu-$(BUILD_QUIPU)
Kurt Zeilenga's avatar
Kurt Zeilenga committed
156

Howard Chu's avatar
Howard Chu committed
157
install-ldbm-no install-bdb2-no install-quipu-no:
Kurt Zeilenga's avatar
Kurt Zeilenga committed
158

Howard Chu's avatar
Howard Chu committed
159
install-ldbm-yes install-ldbm-mod: FORCE
160
	-$(MKDIR) $(DESTDIR)$(sbindir) 
161
162
163
	@for bin in $(PROGRAMS); do \
		$(LTINSTALL) $(INSTALLFLAGS) -m 755 $$bin$(EXEEXT) \
					    	    $(DESTDIR)$(sbindir); \
164
	done
Howard Chu's avatar
Howard Chu committed
165
166

install-bdb2-yes install-bdb2-mod: FORCE
167
	@-$(MKDIR) $(DESTDIR)$(sbindir) 
168

Howard Chu's avatar
Howard Chu committed
169
install-quipu-yes: FORCE
170
171
172
173
	@-$(MKDIR) $(DESTDIR)$(sbindir)
	for bin in edb2ldif chlog2replog; do \
		$(LTINSTALL) $(INSTALLFLAGS) -m 755 $$bin $(DESTDIR)$(sbindir); \
	done