2 ## This work is part of OpenLDAP Software <http://www.openldap.org/>.
4 ## Copyright 1998-2017 The OpenLDAP Foundation.
5 ## All rights reserved.
7 ## Redistribution and use in source and binary forms, with or without
8 ## modification, are permitted only as authorized by the OpenLDAP
11 ## A copy of this license is available in the file LICENSE in the
12 ## top-level directory of the distribution or, alternatively, at
13 ##---------------------------------------------------------------------------
15 # Top-level Makefile template
20 RELEASEDATE= @OPENLDAP_RELEASE_DATE@
25 top_builddir = @top_builddir@
28 top_srcdir = @top_srcdir@
31 exec_prefix = @exec_prefix@
32 ldap_subdir = @ldap_subdir@
35 datarootdir = @datarootdir@
36 datadir = @datadir@$(ldap_subdir)
37 includedir = @includedir@
40 libexecdir = @libexecdir@
41 localstatedir = @localstatedir@
43 moduledir = @libexecdir@$(ldap_subdir)
45 sharedstatedir = @sharedstatedir@
46 sysconfdir = @sysconfdir@$(ldap_subdir)
47 schemadir = $(sysconfdir)/schema
53 BUILD_LIBS_DYNAMIC = @BUILD_LIBS_DYNAMIC@
55 SHTOOL = $(top_srcdir)/build/shtool
57 INSTALL = $(SHTOOL) install -c
58 INSTALL_PROGRAM = $(INSTALL)
59 INSTALL_DATA = $(INSTALL) -m 644
60 INSTALL_SCRIPT = $(INSTALL)
67 MKDEP = $(top_srcdir)/build/mkdep $(MKDEPFLAG) \
68 -d "$(srcdir)" -c "$(MKDEP_CC)" -m "$(MKDEP_CFLAGS)"
70 MKDEP_CFLAGS = @OL_MKDEP_FLAGS@
72 MKVERSION = $(top_srcdir)/build/mkversion -v "$(VERSION)"
75 LIBRELEASE = @OPENLDAP_LIBRELEASE@
76 LIBVERSION = @OPENLDAP_LIBVERSION@
77 LTVERSION = -release $(LIBRELEASE) -version-info $(LIBVERSION)
79 # libtool --only flag for libraries: platform specific
80 NT_LTONLY_LIB = # --only-$(BUILD_LIBS_DYNAMIC)
81 LTONLY_LIB = $(@PLAT@_LTONLY_LIB)
83 # libtool --only flag for modules: depends on linkage of module
84 # The BUILD_MOD macro is defined in each backend Makefile.in file
85 LTONLY_yes = --tag=disable-shared
86 LTONLY_mod = --tag=disable-static
87 LTONLY_MOD = $(LTONLY_$(BUILD_MOD))
89 # platform-specific libtool flags
90 NT_LTFLAGS_LIB = -no-undefined -avoid-version -rpath $(libdir)
91 NT_LTFLAGS_MOD = -no-undefined -avoid-version -rpath $(moduledir)
92 UNIX_LTFLAGS_LIB = $(LTVERSION) -rpath $(libdir)
93 UNIX_LTFLAGS_MOD = $(LTVERSION) -rpath $(moduledir)
96 LTFLAGS = $(@PLAT@_LTFLAGS)
97 LTFLAGS_LIB = $(@PLAT@_LTFLAGS_LIB)
98 LTFLAGS_MOD = $(@PLAT@_LTFLAGS_MOD)
100 # LIB_DEFS defined in liblber and libldap Makefile.in files.
101 # MOD_DEFS defined in backend Makefile.in files.
103 # platform-specific LINK_LIBS defined in various Makefile.in files.
104 # LINK_LIBS referenced in library and module link commands.
105 LINK_LIBS = $(MOD_LIBS) $(@PLAT@_LINK_LIBS)
107 LTSTATIC = @LTSTATIC@
109 LTLINK = $(LIBTOOL) --mode=link \
110 $(CC) $(LTSTATIC) $(LT_CFLAGS) $(LDFLAGS) $(LTFLAGS)
112 LTCOMPILE_LIB = $(LIBTOOL) $(LTONLY_LIB) --mode=compile \
113 $(CC) $(LT_CFLAGS) $(LT_CPPFLAGS) $(LIB_DEFS) -c
115 LTLINK_LIB = $(LIBTOOL) $(LTONLY_LIB) --mode=link \
116 $(CC) $(LT_CFLAGS) $(LDFLAGS) $(LTFLAGS_LIB)
118 LTCOMPILE_MOD = $(LIBTOOL) $(LTONLY_MOD) --mode=compile \
119 $(CC) $(LT_CFLAGS) $(LT_CPPFLAGS) $(MOD_DEFS) -c
121 LTLINK_MOD = $(LIBTOOL) $(LTONLY_MOD) --mode=link \
122 $(CC) $(LT_CFLAGS) $(LDFLAGS) $(LTFLAGS_MOD)
124 LTINSTALL = $(LIBTOOL) --mode=install $(INSTALL)
125 LTFINISH = $(LIBTOOL) --mode=finish
127 # Misc UNIX commands used in build environment
133 ECHO = $(SHTOOL) echo
134 HOSTNAME = $(SHTOOL) echo -e "%h%d"
138 MAKEINFO = @MAKEINFO@
139 MKDIR = $(SHTOOL) mkdir -p
145 SUBST = $(SHTOOL) subst
148 # MANCOMPRESS=@MANCOMPRESS@
149 # MANCOMPRESSSUFFIX=@MANCOMPRESSSUFFIX@
155 INCLUDEDIR= $(top_srcdir)/include
156 LDAP_INCPATH= -I$(LDAP_INCDIR) -I$(INCLUDEDIR)
157 LDAP_LIBDIR= $(top_builddir)/libraries
159 LUTIL_LIBS = @LUTIL_LIBS@
160 LTHREAD_LIBS = @LTHREAD_LIBS@
162 BDB_LIBS = @BDB_LIBS@
163 SLAPD_NDB_LIBS = @SLAPD_NDB_LIBS@
166 LDAP_LIBLBER_LA = $(LDAP_LIBDIR)/liblber/liblber.la
167 LDAP_LIBLDAP_LA = $(LDAP_LIBDIR)/libldap/libldap.la
168 LDAP_LIBLDAP_R_LA = $(LDAP_LIBDIR)/libldap_r/libldap_r.la
170 LDAP_LIBREWRITE_A = $(LDAP_LIBDIR)/librewrite/librewrite.a
171 LDAP_LIBLUNICODE_A = $(LDAP_LIBDIR)/liblunicode/liblunicode.a
172 LDAP_LIBLUTIL_A = $(LDAP_LIBDIR)/liblutil/liblutil.a
174 LDAP_L = $(LDAP_LIBLUTIL_A) \
175 $(LDAP_LIBLDAP_LA) $(LDAP_LIBLBER_LA)
176 SLAPD_L = $(LDAP_LIBLUNICODE_A) $(LDAP_LIBREWRITE_A) \
177 $(LDAP_LIBLUTIL_A) $(LDAP_LIBLDAP_R_LA) $(LDAP_LIBLBER_LA)
179 WRAP_LIBS = @WRAP_LIBS@
180 # AutoConfig generated
183 AC_DEFS = @CPPFLAGS@ # @DEFS@
184 AC_LDFLAGS = @LDFLAGS@
187 KRB4_LIBS = @KRB4_LIBS@
188 KRB5_LIBS = @KRB5_LIBS@
189 KRB_LIBS = @KRB4_LIBS@ @KRB5_LIBS@
190 SASL_LIBS = @SASL_LIBS@
191 TLS_LIBS = @TLS_LIBS@
192 AUTH_LIBS = @AUTH_LIBS@
193 SECURITY_LIBS = $(SASL_LIBS) $(KRB_LIBS) $(TLS_LIBS) $(AUTH_LIBS)
194 ICU_LIBS = @ICU_LIBS@
196 MODULES_CPPFLAGS = @SLAPD_MODULES_CPPFLAGS@
197 MODULES_LDFLAGS = @SLAPD_MODULES_LDFLAGS@
198 MODULES_LIBS = @MODULES_LIBS@
199 SLAPD_PERL_LDFLAGS = @SLAPD_PERL_LDFLAGS@
201 SLAPD_SQL_LDFLAGS = @SLAPD_SQL_LDFLAGS@
202 SLAPD_SQL_INCLUDES = @SLAPD_SQL_INCLUDES@
203 SLAPD_SQL_LIBS = @SLAPD_SQL_LIBS@
205 SLAPD_LIBS = @SLAPD_LIBS@ @SLAPD_PERL_LDFLAGS@ @SLAPD_SQL_LDFLAGS@ @SLAPD_SQL_LIBS@ @SLAPD_SLP_LIBS@ @SLAPD_GMP_LIBS@ $(ICU_LIBS)
209 DEFS = $(LDAP_INCPATH) $(XINCPATH) $(XDEFS) $(AC_DEFS) $(DEFINES)
210 CFLAGS = $(AC_CFLAGS) $(DEFS)
211 LDFLAGS = $(LDAP_LIBPATH) $(AC_LDFLAGS) $(XLDFLAGS)
212 LIBS = $(XLIBS) $(XXLIBS) $(AC_LIBS) $(XXXLIBS)
214 LT_CFLAGS = $(AC_CFLAGS)
215 LT_CPPFLAGS = $(DEFS)
217 all: all-common all-local FORCE
218 install: install-common install-local FORCE
219 clean: clean-common clean-local FORCE
220 veryclean: veryclean-common veryclean-local FORCE
221 depend: depend-common depend-local FORCE
227 veryclean-common: clean-common FORCE
236 veryclean-local: clean-local FORCE
245 Makefile: Makefile.in $(top_srcdir)/build/top.mk
250 # empty rule for forcing rules
253 ##---------------------------------------------------------------------------