top.mk 6.49 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/>.
##
Quanah Gibson-Mount's avatar
Quanah Gibson-Mount committed
4
## Copyright 1998-2019 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
bindir = @bindir@
35
datarootdir = @datarootdir@
36
37
38
39
40
41
42
datadir = @datadir@$(ldap_subdir)
includedir = @includedir@
infodir = @infodir@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
43
moduledir = @libexecdir@$(ldap_subdir)
44
45
46
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@$(ldap_subdir)
47
schemadir = $(sysconfdir)/schema
Kurt Zeilenga's avatar
Kurt Zeilenga committed
48

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

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

55
56
57
58
59
60
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
61

62
63
STRIP = -s

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

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

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

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

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

# libtool --only flag for modules: depends on linkage of module
Howard Chu's avatar
Howard Chu committed
84
# The BUILD_MOD macro is defined in each backend Makefile.in file
85
86
87
LTONLY_yes = --tag=disable-shared
LTONLY_mod = --tag=disable-static
LTONLY_MOD = $(LTONLY_$(BUILD_MOD))
Howard Chu's avatar
Howard Chu committed
88
89

# platform-specific libtool flags
90
91
NT_LTFLAGS_LIB = -no-undefined -avoid-version -rpath $(libdir)
NT_LTFLAGS_MOD = -no-undefined -avoid-version -rpath $(moduledir)
Howard Chu's avatar
Howard Chu committed
92
UNIX_LTFLAGS_LIB = $(LTVERSION) -rpath $(libdir)
93
UNIX_LTFLAGS_MOD = $(LTVERSION) -rpath $(moduledir)
Howard Chu's avatar
Howard Chu committed
94
95
96
97
98
99
100
101
102
103
104

# 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
105
LINK_LIBS = $(MOD_LIBS) $(@PLAT@_LINK_LIBS)
Howard Chu's avatar
Howard Chu committed
106

107
108
LTSTATIC = @LTSTATIC@

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

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

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

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

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

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

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

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

Kurt Zeilenga's avatar
Kurt Zeilenga committed
153
154
SOELIM=soelim

155
156
INCLUDEDIR= $(top_srcdir)/include
LDAP_INCPATH= -I$(LDAP_INCDIR) -I$(INCLUDEDIR)
Kurt Zeilenga's avatar
Kurt Zeilenga committed
157
LDAP_LIBDIR= $(top_builddir)/libraries
Kurt Zeilenga's avatar
Kurt Zeilenga committed
158

159
160
CLIENT_LIBS = @CLIENT_LIBS@

161
162
LUTIL_LIBS = @LUTIL_LIBS@
LTHREAD_LIBS = @LTHREAD_LIBS@
163

Howard Chu's avatar
Howard Chu committed
164
SLAPD_NDB_LIBS = @SLAPD_NDB_LIBS@
165
WT_LIBS = @WT_LIBS@
166

Kurt Zeilenga's avatar
Kurt Zeilenga committed
167
168
169
170
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

171
LDAP_LIBREWRITE_A = $(LDAP_LIBDIR)/librewrite/librewrite.a
Kurt Zeilenga's avatar
Kurt Zeilenga committed
172
173
174
LDAP_LIBLUNICODE_A = $(LDAP_LIBDIR)/liblunicode/liblunicode.a
LDAP_LIBLUTIL_A = $(LDAP_LIBDIR)/liblutil/liblutil.a

175
176
LDAP_L = $(LDAP_LIBLUTIL_A) \
	$(LDAP_LIBLDAP_LA) $(LDAP_LIBLBER_LA)
177
SLAPD_L = $(LDAP_LIBLUNICODE_A) $(LDAP_LIBREWRITE_A) \
178
	$(LDAP_LIBLUTIL_A) $(LDAP_LIBLDAP_R_LA) $(LDAP_LIBLBER_LA)
Kurt Zeilenga's avatar
Kurt Zeilenga committed
179

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

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

197
198
MODULES_CPPFLAGS = @SLAPD_MODULES_CPPFLAGS@
MODULES_LDFLAGS = @SLAPD_MODULES_LDFLAGS@
Julio Sánchez Fernández's avatar
   
Julio Sánchez Fernández committed
199
MODULES_LIBS = @MODULES_LIBS@
200
SLAPD_PERL_LDFLAGS = @SLAPD_PERL_LDFLAGS@
Kurt Zeilenga's avatar
Kurt Zeilenga committed
201

202
203
204
205
SLAPD_SQL_LDFLAGS = @SLAPD_SQL_LDFLAGS@
SLAPD_SQL_INCLUDES = @SLAPD_SQL_INCLUDES@
SLAPD_SQL_LIBS = @SLAPD_SQL_LIBS@

206
SLAPD_LIBS = @SLAPD_LIBS@ @SLAPD_PERL_LDFLAGS@ @SLAPD_SQL_LDFLAGS@ @SLAPD_SQL_LIBS@ @SLAPD_SLP_LIBS@ @SLAPD_GMP_LIBS@ $(ICU_LIBS)
207

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

215
216
217
LT_CFLAGS = $(AC_CFLAGS)
LT_CPPFLAGS = $(DEFS)

218
219
220
221
222
223
224
225
226
227
228
229
230
231
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
232
233
234
235
236

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

242
243
veryclean: FORCE
	$(RM) Makefile
244
	$(RM) -r .libs
245

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

248
pathtest:
249
	$(SHTOOL) --version
250

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

##---------------------------------------------------------------------------
255