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@
165 LDAP_LIBLBER_LA = $(LDAP_LIBDIR)/liblber/liblber.la
166 LDAP_LIBLDAP_LA = $(LDAP_LIBDIR)/libldap/libldap.la
167 LDAP_LIBLDAP_R_LA = $(LDAP_LIBDIR)/libldap_r/libldap_r.la
169 LDAP_LIBREWRITE_A = $(LDAP_LIBDIR)/librewrite/librewrite.a
170 LDAP_LIBLUNICODE_A = $(LDAP_LIBDIR)/liblunicode/liblunicode.a
171 LDAP_LIBLUTIL_A = $(LDAP_LIBDIR)/liblutil/liblutil.a
173 LDAP_L = $(LDAP_LIBLUTIL_A) \
174 $(LDAP_LIBLDAP_LA) $(LDAP_LIBLBER_LA)
175 SLAPD_L = $(LDAP_LIBLUNICODE_A) $(LDAP_LIBREWRITE_A) \
176 $(LDAP_LIBLUTIL_A) $(LDAP_LIBLDAP_R_LA) $(LDAP_LIBLBER_LA)
178 WRAP_LIBS = @WRAP_LIBS@
179 # AutoConfig generated
182 AC_DEFS = @CPPFLAGS@ # @DEFS@
183 AC_LDFLAGS = @LDFLAGS@
186 KRB4_LIBS = @KRB4_LIBS@
187 KRB5_LIBS = @KRB5_LIBS@
188 KRB_LIBS = @KRB4_LIBS@ @KRB5_LIBS@
189 SASL_LIBS = @SASL_LIBS@
190 TLS_LIBS = @TLS_LIBS@
191 AUTH_LIBS = @AUTH_LIBS@
192 SECURITY_LIBS = $(SASL_LIBS) $(KRB_LIBS) $(TLS_LIBS) $(AUTH_LIBS)
193 ICU_LIBS = @ICU_LIBS@
195 MODULES_CPPFLAGS = @SLAPD_MODULES_CPPFLAGS@
196 MODULES_LDFLAGS = @SLAPD_MODULES_LDFLAGS@
197 MODULES_LIBS = @MODULES_LIBS@
198 SLAPD_PERL_LDFLAGS = @SLAPD_PERL_LDFLAGS@
200 SLAPD_SQL_LDFLAGS = @SLAPD_SQL_LDFLAGS@
201 SLAPD_SQL_INCLUDES = @SLAPD_SQL_INCLUDES@
202 SLAPD_SQL_LIBS = @SLAPD_SQL_LIBS@
204 SLAPD_LIBS = @SLAPD_LIBS@ @SLAPD_PERL_LDFLAGS@ @SLAPD_SQL_LDFLAGS@ @SLAPD_SQL_LIBS@ @SLAPD_SLP_LIBS@ @SLAPD_GMP_LIBS@ $(ICU_LIBS)
208 DEFS = $(LDAP_INCPATH) $(XINCPATH) $(XDEFS) $(AC_DEFS) $(DEFINES)
209 CFLAGS = $(AC_CFLAGS) $(DEFS)
210 LDFLAGS = $(LDAP_LIBPATH) $(AC_LDFLAGS) $(XLDFLAGS)
211 LIBS = $(XLIBS) $(XXLIBS) $(AC_LIBS) $(XXXLIBS)
213 LT_CFLAGS = $(AC_CFLAGS)
214 LT_CPPFLAGS = $(DEFS)
216 all: all-common all-local FORCE
217 install: install-common install-local FORCE
218 clean: clean-common clean-local FORCE
219 veryclean: veryclean-common veryclean-local FORCE
220 depend: depend-common depend-local FORCE
226 veryclean-common: clean-common FORCE
235 veryclean-local: clean-local FORCE
244 Makefile: Makefile.in $(top_srcdir)/build/top.mk
249 # empty rule for forcing rules
252 ##---------------------------------------------------------------------------