top.mk 6.65 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-2021 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
STRIP_OPTS = -s
63

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
109
# compiler options for versioned library symbol support
OL_VERSIONED_SYMBOLS = @OL_VERSIONED_SYMBOLS@

110
111
LTSTATIC = @LTSTATIC@

112
LTLINK   = $(LIBTOOL) --mode=link \
113
	$(CC) $(LTSTATIC) $(LT_CFLAGS) $(LDFLAGS) $(LTFLAGS)
Howard Chu's avatar
Howard Chu committed
114
115

LTCOMPILE_LIB = $(LIBTOOL) $(LTONLY_LIB) --mode=compile \
116
	$(CC) $(LT_CFLAGS) $(LT_CPPFLAGS) $(LIB_DEFS) -c
Howard Chu's avatar
Howard Chu committed
117
118

LTLINK_LIB = $(LIBTOOL) $(LTONLY_LIB) --mode=link \
119
	$(CC) $(LT_CFLAGS) $(LDFLAGS) $(LTFLAGS_LIB) $(SYMBOL_VERSION_FLAGS)
Howard Chu's avatar
Howard Chu committed
120
121

LTCOMPILE_MOD = $(LIBTOOL) $(LTONLY_MOD) --mode=compile \
122
	$(CC) $(LT_CFLAGS) $(LT_CPPFLAGS) $(MOD_DEFS) -c
Howard Chu's avatar
Howard Chu committed
123
124

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

127
LTINSTALL = $(LIBTOOL) --mode=install $(INSTALL) 
Kurt Zeilenga's avatar
Kurt Zeilenga committed
128
LTFINISH = $(LIBTOOL) --mode=finish
Kurt Zeilenga's avatar
Kurt Zeilenga committed
129

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

150
151
152
153
154
155
# For manual pages
# MANCOMPRESS=@MANCOMPRESS@
# MANCOMPRESSSUFFIX=@MANCOMPRESSSUFFIX@
MANCOMPRESS=$(CAT)
MANCOMPRESSSUFFIX=

Kurt Zeilenga's avatar
Kurt Zeilenga committed
156
157
SOELIM=soelim

158
159
INCLUDEDIR= $(top_srcdir)/include
LDAP_INCPATH= -I$(LDAP_INCDIR) -I$(INCLUDEDIR)
Kurt Zeilenga's avatar
Kurt Zeilenga committed
160
LDAP_LIBDIR= $(top_builddir)/libraries
Kurt Zeilenga's avatar
Kurt Zeilenga committed
161

162
163
CLIENT_LIBS = @CLIENT_LIBS@

164
165
LUTIL_LIBS = @LUTIL_LIBS@
LTHREAD_LIBS = @LTHREAD_LIBS@
166

Howard Chu's avatar
Howard Chu committed
167
SLAPD_NDB_LIBS = @SLAPD_NDB_LIBS@
168
WT_LIBS = @WT_LIBS@
169

Ondřej Kuzník's avatar
Ondřej Kuzník committed
170
171
LEVENT_LIBS = @LEVENT_LIBS@

Kurt Zeilenga's avatar
Kurt Zeilenga committed
172
173
174
LDAP_LIBLBER_LA = $(LDAP_LIBDIR)/liblber/liblber.la
LDAP_LIBLDAP_LA = $(LDAP_LIBDIR)/libldap/libldap.la

175
LDAP_LIBREWRITE_A = $(LDAP_LIBDIR)/librewrite/librewrite.a
Kurt Zeilenga's avatar
Kurt Zeilenga committed
176
177
178
LDAP_LIBLUNICODE_A = $(LDAP_LIBDIR)/liblunicode/liblunicode.a
LDAP_LIBLUTIL_A = $(LDAP_LIBDIR)/liblutil/liblutil.a

179
180
LDAP_L = $(LDAP_LIBLUTIL_A) \
	$(LDAP_LIBLDAP_LA) $(LDAP_LIBLBER_LA)
181
SLAPD_L = $(LDAP_LIBLUNICODE_A) $(LDAP_LIBREWRITE_A) \
182
	$(LDAP_LIBLUTIL_A) $(LDAP_LIBLDAP_LA) $(LDAP_LIBLBER_LA)
Ondřej Kuzník's avatar
Ondřej Kuzník committed
183
184
LLOADD_L = $(LDAP_LIBLUTIL_A) $(LDAP_LIBLDAP_LA) \
	$(LDAP_LIBLBER_LA)
Kurt Zeilenga's avatar
Kurt Zeilenga committed
185

186
WRAP_LIBS = @WRAP_LIBS@
Kurt Zeilenga's avatar
Kurt Zeilenga committed
187
188
189
# AutoConfig generated 
AC_CC	= @CC@
AC_CFLAGS = @CFLAGS@
190
AC_DEFS = @CPPFLAGS@ # @DEFS@
191
192
AC_LDFLAGS = @LDFLAGS@
AC_LIBS = @LIBS@
Kurt Zeilenga's avatar
Kurt Zeilenga committed
193

194
SASL_LIBS = @SASL_LIBS@
Julio Sánchez Fernández's avatar
   
Julio Sánchez Fernández committed
195
TLS_LIBS = @TLS_LIBS@
196
AUTH_LIBS = @AUTH_LIBS@
197
ARGON2_LIBS = @ARGON2_LIBS@
198
SECURITY_LIBS = $(SASL_LIBS) $(TLS_LIBS) $(AUTH_LIBS)
199
SYSTEMD_LIBS = @SYSTEMD_LIBS@
200

201
202
MODULES_CPPFLAGS = @SLAPD_MODULES_CPPFLAGS@
MODULES_LDFLAGS = @SLAPD_MODULES_LDFLAGS@
Julio Sánchez Fernández's avatar
   
Julio Sánchez Fernández committed
203
MODULES_LIBS = @MODULES_LIBS@
204
SLAPD_PERL_LDFLAGS = @SLAPD_PERL_LDFLAGS@
Kurt Zeilenga's avatar
Kurt Zeilenga committed
205

206
207
208
209
SLAPD_SQL_LDFLAGS = @SLAPD_SQL_LDFLAGS@
SLAPD_SQL_INCLUDES = @SLAPD_SQL_INCLUDES@
SLAPD_SQL_LIBS = @SLAPD_SQL_LIBS@

210
SLAPD_LIBS = @SLAPD_LIBS@ @SLAPD_PERL_LDFLAGS@ @SLAPD_SQL_LDFLAGS@ @SLAPD_SQL_LIBS@ @SLAPD_SLP_LIBS@ @SLAPD_GMP_LIBS@ $(SYSTEMD_LIBS)
Ondřej Kuzník's avatar
Ondřej Kuzník committed
211
LLOADD_LIBS = @BALANCER_LIBS@ $(LEVENT_LIBS)
212

Kurt Zeilenga's avatar
Kurt Zeilenga committed
213
214
# Our Defaults
CC = $(AC_CC)
215
DEFS = $(LDAP_INCPATH) $(XINCPATH) $(XDEFS) $(AC_DEFS) $(DEFINES)
Kurt Zeilenga's avatar
Kurt Zeilenga committed
216
CFLAGS = $(AC_CFLAGS) $(DEFS)
217
218
LDFLAGS = $(LDAP_LIBPATH) $(AC_LDFLAGS) $(XLDFLAGS)
LIBS = $(XLIBS) $(XXLIBS) $(AC_LIBS) $(XXXLIBS)
Kurt Zeilenga's avatar
Kurt Zeilenga committed
219

220
221
222
LT_CFLAGS = $(AC_CFLAGS)
LT_CPPFLAGS = $(DEFS)

223
224
225
226
227
228
229
230
231
232
233
234
235
236
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
237
238
239
240
241

# empty local rules
all-local:
install-local:
clean-local:
242
veryclean-local:	clean-local FORCE
Kurt Zeilenga's avatar
Kurt Zeilenga committed
243
244
245
246
depend-local:
lint-local:
lint5-local:

247
248
veryclean: FORCE
	$(RM) Makefile
249
	$(RM) -r .libs
250

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

253
pathtest:
254
	$(SHTOOL) --version
255

Kurt Zeilenga's avatar
Kurt Zeilenga committed
256
257
258
259
# empty rule for forcing rules
FORCE:

##---------------------------------------------------------------------------
260