top.mk 6.46 KB
Newer Older
Kurt Zeilenga's avatar
Kurt Zeilenga committed
1
# $OpenLDAP$
Kurt Zeilenga's avatar
Kurt Zeilenga committed
2
3
## This work is part of OpenLDAP Software <http://www.openldap.org/>.
##
Kurt Zeilenga's avatar
Kurt Zeilenga committed
4
## Copyright 1998-2006 The OpenLDAP Foundation.
5
6
## All rights reserved.
##
7
8
## Redistribution and use in source and binary forms, with or without
## modification, are permitted only as authorized by the OpenLDAP
Kurt Zeilenga's avatar
Kurt Zeilenga committed
9
## Public License.
Kurt Zeilenga's avatar
Kurt Zeilenga committed
10
##
Kurt Zeilenga's avatar
Kurt Zeilenga committed
11
12
13
14
15
16
17
## A copy of this license is available in the file LICENSE in the
## top-level directory of the distribution or, alternatively, at
##---------------------------------------------------------------------------
#
# Top-level Makefile template
#

18
19
PACKAGE= @PACKAGE@
VERSION= @VERSION@
20
RELEASEDATE= @OPENLDAP_RELEASE_DATE@
Kurt Zeilenga's avatar
Kurt Zeilenga committed
21

22
@SET_MAKE@
Kurt Zeilenga's avatar
Kurt Zeilenga committed
23
24
SHELL = /bin/sh

25
26
top_builddir = @top_builddir@

Kurt Zeilenga's avatar
Kurt Zeilenga committed
27
28
29
30
31
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
32
ldap_subdir = @ldap_subdir@
33

34
35
36
37
38
39
40
41
42
43
44
45
bindir = @bindir@
datadir = @datadir@$(ldap_subdir)
includedir = @includedir@
infodir = @infodir@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
moduledir = @libexecdir@$(ldap_subdir)
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@$(ldap_subdir)
46
schemadir = $(sysconfdir)/schema
Kurt Zeilenga's avatar
Kurt Zeilenga committed
47

Howard Chu's avatar
Howard Chu committed
48
PLAT = @PLAT@
49
50
51
EXEEXT = @EXEEXT@
OBJEXT = @OBJEXT@

Howard Chu's avatar
Howard Chu committed
52
53
BUILD_LIBS_DYNAMIC = @BUILD_LIBS_DYNAMIC@

54
55
56
57
58
59
SHTOOL = $(top_srcdir)/build/shtool

INSTALL = $(SHTOOL) install -c
INSTALL_PROGRAM = $(INSTALL)
INSTALL_DATA = $(INSTALL) -m 644
INSTALL_SCRIPT = $(INSTALL)
Kurt Zeilenga's avatar
Kurt Zeilenga committed
60

61
62
STRIP = -s

Kurt Zeilenga's avatar
Kurt Zeilenga committed
63
64
LINT = lint
5LINT = 5lint
65
66
67
68
69
70

MKDEP = $(top_srcdir)/build/mkdep $(MKDEPFLAG) \
	-d "$(srcdir)" -c "$(MKDEP_CC)" -m "$(MKDEP_CFLAGS)"
MKDEP_CC	= @OL_MKDEP@
MKDEP_CFLAGS = @OL_MKDEP_FLAGS@

71
MKVERSION = $(top_srcdir)/build/mkversion -v "$(VERSION)"
72

Kurt Zeilenga's avatar
Kurt Zeilenga committed
73
LIBTOOL = @LIBTOOL@
Kurt Zeilenga's avatar
Kurt Zeilenga committed
74
LIBRELEASE = @OPENLDAP_LIBRELEASE@
75
LIBVERSION = @OPENLDAP_LIBVERSION@
Kurt Zeilenga's avatar
Kurt Zeilenga committed
76
LTVERSION = -release $(LIBRELEASE) -version-info $(LIBVERSION)
Howard Chu's avatar
Howard Chu committed
77
78

# libtool --only flag for libraries: platform specific
79
NT_LTONLY_LIB = # --only-$(BUILD_LIBS_DYNAMIC)
Howard Chu's avatar
Howard Chu committed
80
81
82
LTONLY_LIB = $(@PLAT@_LTONLY_LIB)

# libtool --only flag for modules: depends on linkage of module
Howard Chu's avatar
Howard Chu committed
83
# The BUILD_MOD macro is defined in each backend Makefile.in file
84
85
86
LTONLY_yes = --tag=disable-shared
LTONLY_mod = --tag=disable-static
LTONLY_MOD = $(LTONLY_$(BUILD_MOD))
Howard Chu's avatar
Howard Chu committed
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103

# platform-specific libtool flags
NT_LTFLAGS_LIB = -no-undefined -avoid-version -rpath $(libdir)
NT_LTFLAGS_MOD = -no-undefined -avoid-version -rpath $(moduledir)
UNIX_LTFLAGS_LIB = $(LTVERSION) -rpath $(libdir)
UNIX_LTFLAGS_MOD = $(LTVERSION) -rpath $(moduledir)

# libtool flags
LTFLAGS     = $(@PLAT@_LTFLAGS)
LTFLAGS_LIB = $(@PLAT@_LTFLAGS_LIB)
LTFLAGS_MOD = $(@PLAT@_LTFLAGS_MOD)

# LIB_DEFS defined in liblber and libldap Makefile.in files.
# MOD_DEFS defined in backend Makefile.in files.

# platform-specific LINK_LIBS defined in various Makefile.in files.
# LINK_LIBS referenced in library and module link commands.
Howard Chu's avatar
Howard Chu committed
104
LINK_LIBS = $(MOD_LIBS) $(@PLAT@_LINK_LIBS)
Howard Chu's avatar
Howard Chu committed
105

106
107
LTSTATIC = @LTSTATIC@

108
LTLINK   = $(LIBTOOL) --mode=link \
109
	$(CC) $(LTSTATIC) $(LT_CFLAGS) $(LDFLAGS) $(LTFLAGS)
Howard Chu's avatar
Howard Chu committed
110
111

LTCOMPILE_LIB = $(LIBTOOL) $(LTONLY_LIB) --mode=compile \
112
	$(CC) $(LT_CFLAGS) $(LT_CPPFLAGS) $(LIB_DEFS) -c
Howard Chu's avatar
Howard Chu committed
113
114

LTLINK_LIB = $(LIBTOOL) $(LTONLY_LIB) --mode=link \
115
	$(CC) $(LT_CFLAGS) $(LDFLAGS) $(LTFLAGS_LIB)
Howard Chu's avatar
Howard Chu committed
116
117

LTCOMPILE_MOD = $(LIBTOOL) $(LTONLY_MOD) --mode=compile \
118
	$(CC) $(LT_CFLAGS) $(LT_CPPFLAGS) $(MOD_DEFS) -c
Howard Chu's avatar
Howard Chu committed
119
120

LTLINK_MOD = $(LIBTOOL) $(LTONLY_MOD) --mode=link \
121
	$(CC) $(LT_CFLAGS) $(LDFLAGS) $(LTFLAGS_MOD)
Howard Chu's avatar
Howard Chu committed
122

123
LTINSTALL = $(LIBTOOL) --mode=install $(INSTALL) 
Kurt Zeilenga's avatar
Kurt Zeilenga committed
124
LTFINISH = $(LIBTOOL) --mode=finish
Kurt Zeilenga's avatar
Kurt Zeilenga committed
125

126
# Misc UNIX commands used in build environment
127
AR = @AR@
Kurt Zeilenga's avatar
Kurt Zeilenga committed
128
129
130
BASENAME = basename
CAT = cat
CHMOD = chmod
131
DATE = date
132
ECHO = $(SHTOOL) echo
Kurt Zeilenga's avatar
Kurt Zeilenga committed
133
HOSTNAME = $(SHTOOL) echo -e "%h%d"
134
135
136
LN = $(SHTOOL) mkln
LN_H = $(LN)
LN_S = $(LN) -s
137
MAKEINFO = @MAKEINFO@
Kurt Zeilenga's avatar
Kurt Zeilenga committed
138
MKDIR = $(SHTOOL) mkdir -p
139
MV = $(SHTOOL) move
140
141
142
143
PWD = pwd
RANLIB = @RANLIB@
RM = rm -f
SED = sed
Kurt Zeilenga's avatar
Kurt Zeilenga committed
144
SUBST = $(SHTOOL) subst
Kurt Zeilenga's avatar
Kurt Zeilenga committed
145

146
147
148
149
150
151
# For manual pages
# MANCOMPRESS=@MANCOMPRESS@
# MANCOMPRESSSUFFIX=@MANCOMPRESSSUFFIX@
MANCOMPRESS=$(CAT)
MANCOMPRESSSUFFIX=

152
153
INCLUDEDIR= $(top_srcdir)/include
LDAP_INCPATH= -I$(LDAP_INCDIR) -I$(INCLUDEDIR)
Kurt Zeilenga's avatar
Kurt Zeilenga committed
154
LDAP_LIBDIR= $(top_builddir)/libraries
Kurt Zeilenga's avatar
Kurt Zeilenga committed
155

156
157
LUTIL_LIBS = @LUTIL_LIBS@
LTHREAD_LIBS = @LTHREAD_LIBS@
158

159
BDB_LIBS = @BDB_LIBS@
Kurt Zeilenga's avatar
Kurt Zeilenga committed
160
LDBM_LIBS = $(BDB_LIBS)
161

Kurt Zeilenga's avatar
Kurt Zeilenga committed
162
163
164
165
LDAP_LIBLBER_LA = $(LDAP_LIBDIR)/liblber/liblber.la
LDAP_LIBLDAP_LA = $(LDAP_LIBDIR)/libldap/libldap.la
LDAP_LIBLDAP_R_LA = $(LDAP_LIBDIR)/libldap_r/libldap_r.la

166
LDAP_LIBREWRITE_A = $(LDAP_LIBDIR)/librewrite/librewrite.a
Kurt Zeilenga's avatar
Kurt Zeilenga committed
167
168
169
LDAP_LIBLUNICODE_A = $(LDAP_LIBDIR)/liblunicode/liblunicode.a
LDAP_LIBLUTIL_A = $(LDAP_LIBDIR)/liblutil/liblutil.a

170
LDAP_L = $(LDAP_LIBLUTIL_A) \
Kurt Zeilenga's avatar
Kurt Zeilenga committed
171
	$(LDAP_LIBLDAP_LA) $(LDAP_LIBLBER_LA)
172
SLURPD_L = $(LDAP_LIBLUTIL_A) \
Kurt Zeilenga's avatar
Kurt Zeilenga committed
173
	$(LDAP_LIBLDAP_R_LA) $(LDAP_LIBLBER_LA)
174
SLAPD_L = $(LDAP_LIBLUNICODE_A) $(LDAP_LIBREWRITE_A) \
Kurt Zeilenga's avatar
Kurt Zeilenga committed
175
	$(SLURPD_L)
Kurt Zeilenga's avatar
Kurt Zeilenga committed
176

177
WRAP_LIBS = @WRAP_LIBS@
Kurt Zeilenga's avatar
Kurt Zeilenga committed
178
179
180
# AutoConfig generated 
AC_CC	= @CC@
AC_CFLAGS = @CFLAGS@
181
AC_DEFS = @CPPFLAGS@ # @DEFS@
182
183
AC_LDFLAGS = @LDFLAGS@
AC_LIBS = @LIBS@
Kurt Zeilenga's avatar
Kurt Zeilenga committed
184

185
186
187
KRB4_LIBS = @KRB4_LIBS@
KRB5_LIBS = @KRB5_LIBS@
KRB_LIBS = @KRB4_LIBS@ @KRB5_LIBS@
188
SASL_LIBS = @SASL_LIBS@
Julio Sánchez Fernández's avatar
   
Julio Sánchez Fernández committed
189
TLS_LIBS = @TLS_LIBS@
190
191
AUTH_LIBS = @AUTH_LIBS@
SECURITY_LIBS = $(SASL_LIBS) $(KRB_LIBS) $(TLS_LIBS) $(AUTH_LIBS)
192
ICU_LIBS = @ICU_LIBS@
193

194
195
MODULES_CPPFLAGS = @SLAPD_MODULES_CPPFLAGS@
MODULES_LDFLAGS = @SLAPD_MODULES_LDFLAGS@
Julio Sánchez Fernández's avatar
   
Julio Sánchez Fernández committed
196
MODULES_LIBS = @MODULES_LIBS@
197
SLAPD_PERL_LDFLAGS = @SLAPD_PERL_LDFLAGS@
Kurt Zeilenga's avatar
Kurt Zeilenga committed
198

199
200
201
202
SLAPD_SQL_LDFLAGS = @SLAPD_SQL_LDFLAGS@
SLAPD_SQL_INCLUDES = @SLAPD_SQL_INCLUDES@
SLAPD_SQL_LIBS = @SLAPD_SQL_LIBS@

203
SLAPD_LIBS = @SLAPD_LIBS@ @SLAPD_PERL_LDFLAGS@ @SLAPD_SQL_LDFLAGS@ @SLAPD_SQL_LIBS@ @SLAPD_SLP_LIBS@ @SLAPD_GMP_LIBS@ $(ICU_LIBS)
204
205
SLURPD_LIBS = @SLURPD_LIBS@

Kurt Zeilenga's avatar
Kurt Zeilenga committed
206
207
# Our Defaults
CC = $(AC_CC)
208
DEFS = $(LDAP_INCPATH) $(XINCPATH) $(XDEFS) $(AC_DEFS) $(DEFINES)
Kurt Zeilenga's avatar
Kurt Zeilenga committed
209
CFLAGS = $(AC_CFLAGS) $(DEFS)
210
211
LDFLAGS = $(LDAP_LIBPATH) $(AC_LDFLAGS) $(XLDFLAGS)
LIBS = $(XLIBS) $(XXLIBS) $(AC_LIBS) $(XXXLIBS)
Kurt Zeilenga's avatar
Kurt Zeilenga committed
212

213
214
215
LT_CFLAGS = $(AC_CFLAGS)
LT_CPPFLAGS = $(DEFS)

216
217
218
219
220
221
222
223
224
225
226
227
228
229
all:		all-common all-local FORCE
install:	install-common install-local FORCE
clean:		clean-common clean-local FORCE
veryclean:	veryclean-common veryclean-local FORCE
depend:		depend-common depend-local FORCE

# empty common rules
all-common:
install-common:
clean-common:
veryclean-common:	clean-common FORCE
depend-common:
lint-common:
lint5-common:
Kurt Zeilenga's avatar
Kurt Zeilenga committed
230
231
232
233
234

# empty local rules
all-local:
install-local:
clean-local:
235
veryclean-local:	clean-local FORCE
Kurt Zeilenga's avatar
Kurt Zeilenga committed
236
237
238
239
depend-local:
lint-local:
lint5-local:

240
241
veryclean: FORCE
	$(RM) Makefile
242
	$(RM) -r .libs
243

Kurt Zeilenga's avatar
Kurt Zeilenga committed
244
245
Makefile: Makefile.in $(top_srcdir)/build/top.mk

246
pathtest:
247
	$(SHTOOL) --version
248

Kurt Zeilenga's avatar
Kurt Zeilenga committed
249
250
251
252
# empty rule for forcing rules
FORCE:

##---------------------------------------------------------------------------
253