"Fossies" - the Fresh Open Source Software Archive

Member "bind-9.16.7/make/rules.in" (4 Sep 2020, 11609 Bytes) of package /linux/misc/dns/bind9/9.16.7/bind-9.16.7.tar.xz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 # Copyright (C) Internet Systems Consortium, Inc. ("ISC")
    2 #
    3 # This Source Code Form is subject to the terms of the Mozilla Public
    4 # License, v. 2.0. If a copy of the MPL was not distributed with this
    5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
    6 #
    7 # See the COPYRIGHT file distributed with this work for additional
    8 # information regarding copyright ownership.
    9 
   10 ###
   11 ### Common Makefile rules for BIND 9.
   12 ###
   13 
   14 ###
   15 ### Paths
   16 ###
   17 ### Note: paths that vary by Makefile MUST NOT be listed
   18 ### here, or they won't get expanded correctly.
   19 
   20 prefix =	@prefix@
   21 exec_prefix =	@exec_prefix@
   22 bindir =	@bindir@
   23 sbindir =	@sbindir@
   24 includedir =	@includedir@
   25 libdir =	@libdir@
   26 sysconfdir =	@sysconfdir@
   27 localstatedir =	@localstatedir@
   28 mandir =	@mandir@
   29 datarootdir =   @datarootdir@
   30 
   31 plugindir =	${libdir}/named
   32 
   33 DESTDIR =
   34 
   35 @SET_MAKE@
   36 
   37 top_builddir =	@BIND9_TOP_BUILDDIR@
   38 
   39 ###
   40 ### All
   41 ###
   42 ### Makefile may define:
   43 ###	PREREQS
   44 ###	TARGETS
   45 
   46 all: ${PREREQS} subdirs ${TARGETS} testdirs
   47 
   48 ###
   49 ### Subdirectories
   50 ###
   51 ### Makefile may define:
   52 ###	SUBDIRS
   53 ###	DEPDIRS
   54 
   55 ALL_SUBDIRS = ${SUBDIRS} nulldir
   56 ALL_TESTDIRS = ${TESTDIRS} nulldir
   57 
   58 #
   59 # We use a single-colon rule so that additional dependencies of
   60 # subdirectories can be specified after the inclusion of this file.
   61 # The "depend" and "testdirs" targets are treated the same way.
   62 #
   63 subdirs:
   64 	@for i in ${ALL_SUBDIRS}; do \
   65 		if [ "$$i" != "nulldir" -a -d $$i ]; then \
   66 			echo "making all in `pwd`/$$i"; \
   67 			(cd $$i; ${MAKE} ${MAKEDEFS} DESTDIR="${DESTDIR}" all) || exit 1; \
   68 		fi; \
   69 	done
   70 
   71 #
   72 # Tests are built after the targets instead of before
   73 #
   74 testdirs: subdirs ${TARGETS}
   75 	@for i in ${ALL_TESTDIRS}; do \
   76 		if [ "$$i" != "nulldir" -a -d $$i ]; then \
   77 			echo "making all in `pwd`/$$i"; \
   78 			(cd $$i; ${MAKE} ${MAKEDEFS} DESTDIR="${DESTDIR}" all) || exit 1; \
   79 		fi; \
   80 	done
   81 
   82 install:: all
   83 
   84 install uninstall clean distclean maintainer-clean doc docclean man manclean::
   85 	@for i in ${ALL_SUBDIRS} ${ALL_TESTDIRS}; do \
   86 		if [ "$$i" != "nulldir" -a -d $$i -a -f $$i/Makefile ]; then \
   87 			echo "making $@ in `pwd`/$$i"; \
   88 			(cd $$i; ${MAKE} ${MAKEDEFS} DESTDIR="${DESTDIR}" $@) || exit 1; \
   89 		fi; \
   90 	done
   91 
   92 ###
   93 ### C Programs
   94 ###
   95 ### Makefile must define
   96 ###	CC
   97 ### Makefile may define
   98 ###	CFLAGS
   99 ###	LDFLAGS
  100 ###	CINCLUDES
  101 ###	CDEFINES
  102 ###	CWARNINGS
  103 ### User may define externally
  104 ###     EXT_CFLAGS
  105 
  106 CC = 		@CC@
  107 CFLAGS =	@CFLAGS@
  108 LDFLAGS =	@LDFLAGS@
  109 STD_CINCLUDES =	@STD_CINCLUDES@
  110 STD_CDEFINES =	@STD_CDEFINES@
  111 STD_CWARNINGS =	@STD_CWARNINGS@
  112 
  113 BUILD_CC = @BUILD_CC@
  114 BUILD_CFLAGS = @BUILD_CFLAGS@
  115 BUILD_CPPFLAGS = @BUILD_CPPFLAGS@
  116 BUILD_LDFLAGS = @BUILD_LDFLAGS@
  117 BUILD_LIBS = @BUILD_LIBS@
  118 
  119 FSTRM_CFLAGS = @FSTRM_CFLAGS@
  120 FSTRM_LIBS = @FSTRM_LIBS@
  121 
  122 GSSAPI_LIBS = @DNS_CRYPTO_LIBS@
  123 
  124 JSON_C_CFLAGS = @JSON_C_CFLAGS@
  125 JSON_C_LIBS = @JSON_C_LIBS@
  126 
  127 LFS_CFLAGS = @LFS_CFLAGS@
  128 LFS_LDFLAGS = @LFS_LDFLAGS@
  129 LFS_LIBS = @LFS_LIBS@
  130 
  131 LIBUV_CFLAGS = @LIBUV_CFLAGS@
  132 LIBUV_LIBS = @LIBUV_LIBS@
  133 
  134 LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
  135 LIBXML2_LIBS = @LIBXML2_LIBS@
  136 
  137 LMDB_CFLAGS = @LMDB_CFLAGS@
  138 LMDB_LIBS = @LMDB_LIBS@
  139 
  140 MAXMINDDB_CFLAGS = @MAXMINDDB_CFLAGS@
  141 MAXMINDDB_LIBS = @MAXMINDDB_LIBS@
  142 
  143 OPENSSL_CFLAGS = @OPENSSL_CFLAGS@
  144 OPENSSL_LIBS = @OPENSSL_LIBS@
  145 
  146 PROTOBUF_C_CFLAGS = @PROTOBUF_C_CFLAGS@
  147 PROTOBUF_C_LIBS = @PROTOBUF_C_LIBS@
  148 
  149 ZLIB_CFLAGS = @ZLIB_CFLAGS@
  150 ZLIB_LIBS = @ZLIB_LIBS@
  151 
  152 NO_LIBTOOL_ISCLIBS = ${OPENSSL_LIBS} ${JSON_C_LIBS} ${LIBXML2_LIBS} ${ZLIB_LIBS} ${LIBUV_LIBS}
  153 NO_LIBTOOL_DNSLIBS = ${LMDB_LIBS} ${MAXMINDDB_LIBS} ${GSSAPI_LIBS} ${PROTOBUF_C_LIBS} ${FSTRM_LIBS}
  154 
  155 .SUFFIXES:
  156 .SUFFIXES: .c .@O@
  157 
  158 ALWAYS_INCLUDES = -include ${top_builddir}/config.h -I${top_builddir} -I${top_srcdir}
  159 ALWAYS_DEFINES = @ALWAYS_DEFINES@
  160 ALWAYS_WARNINGS =
  161 
  162 ALL_CPPFLAGS = \
  163 	${ALWAYS_INCLUDES} ${CINCLUDES} ${STD_CINCLUDES} \
  164 	${ALWAYS_DEFINES} ${CDEFINES} ${STD_CDEFINES}
  165 
  166 ALL_CFLAGS = ${EXT_CFLAGS} ${ALL_CPPFLAGS} ${CFLAGS} \
  167 	${ALWAYS_WARNINGS} ${STD_CWARNINGS} ${CWARNINGS}
  168 
  169 @BIND9_CO_RULE@
  170 	${LIBTOOL_MODE_COMPILE} ${CC} ${ALL_CFLAGS} -c $<
  171 
  172 SHELL = @SHELL@
  173 LIBTOOL = @LIBTOOL@
  174 LIBTOOL_MODE_COMPILE = ${LIBTOOL} @LIBTOOL_MODE_COMPILE@
  175 LIBTOOL_MODE_INSTALL = ${LIBTOOL} @LIBTOOL_MODE_INSTALL@
  176 LIBTOOL_MODE_LINK = ${LIBTOOL} @LIBTOOL_MODE_LINK@
  177 LIBTOOL_MODE_UNINSTALL = ${LIBTOOL} @LIBTOOL_MODE_UNINSTALL@
  178 PURIFY = @PURIFY@
  179 
  180 MKDEP = ${SHELL} ${top_builddir}/make/mkdep
  181 
  182 ###
  183 ### This is a template compound command to build an executable binary with
  184 ### an internal symbol table.
  185 ### This process is tricky.  We first link all objects including a tentative
  186 ### empty symbol table, then get a tentative list of symbols from the resulting
  187 ### binary ($@tmp0).  Next, we re-link all objects, but this time with the
  188 ### symbol table just created ($tmp@1).  The set of symbols should be the same,
  189 ### but the corresponding addresses would be changed due to the difference on
  190 ### the size of symbol tables.  So we create the symbol table and re-create the
  191 ### objects once again.  Finally, we check the symbol table embedded in the
  192 ### final binaryis consistent with the binary itself; otherwise the process is
  193 ### terminated.
  194 ###
  195 ### To minimize the overhead of creating symbol tables, the autoconf switch
  196 ### --enable-symtable takes an argument so that the symbol table can be created
  197 ### on a per application basis: unless the argument is set to "all", the symbol
  198 ### table is created only when a shell (environment) variable "MAKE_SYMTABLE" is
  199 ### set to a non-null value in the rule to build the executable binary.
  200 ###
  201 ### Each Makefile.in that uses this macro is expected to define "LIBS" and
  202 ### "NOSYMLIBS"; the former includes libisc with an empty symbol table, and
  203 ### the latter includes libisc without the definition of a symbol table.
  204 ### The rule to make the executable binary will look like this
  205 ### binary@EXEEXT@: ${OBJS}
  206 ###     #export MAKE_SYMTABLE="yes"; \  <- enable if symtable is always needed
  207 ###	export BASEOBJS="${OBJS}"; \
  208 ###	${FINALBUILDCMD}
  209 ###
  210 ### Normally, ${LIBS} includes all necessary libraries to build the binary;
  211 ### there are some exceptions however, where the rule lists some of the
  212 ### necessary libraries explicitly in addition to (or instead of) ${LIBS},
  213 ### like this:
  214 ### binary@EXEEXT@: ${OBJS}
  215 ###     cc -o $@ ${OBJS} ${OTHERLIB1} ${OTHERLIB2} ${LIBS}
  216 ### in order to modify such a rule to use this compound command, a separate
  217 ### variable "LIBS0" should be deinfed for the explicitly listed libraries,
  218 ### while making sure ${LIBS} still includes libisc.  So the above rule would
  219 ### be modified as follows:
  220 ### binary@EXEEXT@: ${OBJS}
  221 ###	export BASEOBJS="${OBJS}"; \
  222 ###	export LIBS0="${OTHERLIB1} ${OTHERLIB2}"; \
  223 ###     ${FINALBUILDCMD}
  224 ### See bin/check/Makefile.in for a complete example of the use of LIBS0.
  225 ###
  226 FINALBUILDCMD = if [ X"${MKSYMTBL_PROGRAM}" = X -o X"$${MAKE_SYMTABLE:-${ALWAYS_MAKE_SYMTABLE}}" = X ] ; then \
  227 		${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${ALL_CFLAGS} ${LDFLAGS} \
  228 		-o $@ $${BASEOBJS} $${LIBS0} ${LIBS}; \
  229 	else \
  230 		rm -f $@tmp0; \
  231 		${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${ALL_CFLAGS} ${LDFLAGS} \
  232 		-o $@tmp0 $${BASEOBJS} $${LIBS0} ${LIBS} || exit 1; \
  233 		rm -f $@-symtbl.c $@-symtbl.@O@; \
  234 		${MKSYMTBL_PROGRAM} ${top_srcdir}/util/mksymtbl.pl \
  235 		-o $@-symtbl.c $@tmp0 || exit 1; \
  236 		$(MAKE) $@-symtbl.@O@ || exit 1; \
  237 		rm -f $@tmp1; \
  238 		${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${ALL_CFLAGS} ${LDFLAGS} \
  239 		-o $@tmp1 $${BASEOBJS} $@-symtbl.@O@ $${LIBS0} ${NOSYMLIBS} || exit 1; \
  240 		rm -f $@-symtbl.c $@-symtbl.@O@; \
  241 		${MKSYMTBL_PROGRAM} ${top_srcdir}/util/mksymtbl.pl \
  242 		-o $@-symtbl.c $@tmp1 || exit 1; \
  243 		$(MAKE) $@-symtbl.@O@ || exit 1; \
  244 		${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${ALL_CFLAGS} ${LDFLAGS} \
  245 		-o $@tmp2 $${BASEOBJS} $@-symtbl.@O@ $${LIBS0} ${NOSYMLIBS}; \
  246 		${MKSYMTBL_PROGRAM} ${top_srcdir}/util/mksymtbl.pl \
  247 		-o $@-symtbl2.c $@tmp2; \
  248 		count=0; \
  249 		until diff $@-symtbl.c $@-symtbl2.c > /dev/null ; \
  250 		do \
  251 			count=`expr $$count + 1` ; \
  252 			test $$count = 42 && exit 1 ; \
  253 			rm -f $@-symtbl.c $@-symtbl.@O@; \
  254 			${MKSYMTBL_PROGRAM} ${top_srcdir}/util/mksymtbl.pl \
  255 			-o $@-symtbl.c $@tmp2 || exit 1; \
  256 			$(MAKE) $@-symtbl.@O@ || exit 1; \
  257 			${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${ALL_CFLAGS} \
  258 			${LDFLAGS} -o $@tmp2 $${BASEOBJS} $@-symtbl.@O@ \
  259 			$${LIBS0} ${NOSYMLIBS}; \
  260 			${MKSYMTBL_PROGRAM} ${top_srcdir}/util/mksymtbl.pl \
  261 			-o $@-symtbl2.c $@tmp2; \
  262 		done ; \
  263 		mv $@tmp2 $@; \
  264 		rm -f $@tmp0 $@tmp1 $@tmp2 $@-symtbl2.c; \
  265 	fi
  266 
  267 cleandir: distclean
  268 superclean: maintainer-clean
  269 
  270 clean distclean maintainer-clean::
  271 	rm -f *.@O@ *.o *.lo *.la core *.core *-symtbl.c *tmp0 *tmp1 *tmp2
  272 	rm -rf .depend .libs
  273 
  274 distclean maintainer-clean::
  275 	rm -f Makefile
  276 
  277 depend:
  278 	@for i in ${ALL_SUBDIRS} ${ALL_TESTDIRS}; do \
  279 		if [ "$$i" != "nulldir" -a -d $$i ]; then \
  280 			echo "making depend in `pwd`/$$i"; \
  281 			(cd $$i; ${MAKE} ${MAKEDEFS} DESTDIR="${DESTDIR}" $@) || exit 1; \
  282 		fi; \
  283 	done
  284 	@if [ X"${srcdir}" != X. ] ; then \
  285 		if [ X"${SRCS}" != X -a X"${PSRCS}" != X ] ; then \
  286 			echo ${MKDEP} -vpath ${srcdir} ${ALL_CPPFLAGS} ${ALL_CFLAGS} ${SRCS}; \
  287 			${MKDEP} -vpath ${srcdir} ${ALL_CPPFLAGS} ${ALL_CFLAGS} ${SRCS}; \
  288 			echo ${MKDEP} -vpath ${srcdir} -ap ${ALL_CPPFLAGS} ${ALL_CFLAGS} ${PSRCS}; \
  289 			${MKDEP} -vpath ${srcdir} -ap ${ALL_CPPFLAGS} ${ALL_CFLAGS} ${PSRCS}; \
  290 			${DEPENDEXTRA} \
  291 		elif [ X"${SRCS}" != X ] ; then \
  292 			echo ${MKDEP} -vpath ${srcdir} ${ALL_CPPFLAGS} ${ALL_CFLAGS} ${SRCS}; \
  293 			${MKDEP} -vpath ${srcdir} ${ALL_CPPFLAGS} ${ALL_CFLAGS} ${SRCS}; \
  294 			${DEPENDEXTRA} \
  295 		elif [ X"${PSRCS}" != X ] ; then \
  296 			echo ${MKDEP} -vpath ${srcdir} ${ALL_CPPFLAGS} ${ALL_CFLAGS} ${PSRCS}; \
  297 			${MKDEP} -vpath ${srcdir} -p ${ALL_CPPFLAGS} ${ALL_CFLAGS} ${PSRCS}; \
  298 			${DEPENDEXTRA} \
  299 		fi \
  300 	else \
  301 		if [ X"${SRCS}" != X -a X"${PSRCS}" != X ] ; then \
  302 			echo ${MKDEP} ${ALL_CPPFLAGS} ${ALL_CFLAGS} ${SRCS}; \
  303 			${MKDEP} ${ALL_CPPFLAGS} ${ALL_CFLAGS} ${SRCS}; \
  304 			echo ${MKDEP} -ap ${ALL_CPPFLAGS} ${ALL_CFLAGS} ${PSRCS}; \
  305 			${MKDEP} -ap ${ALL_CPPFLAGS} ${ALL_CFLAGS} ${PSRCS}; \
  306 			${DEPENDEXTRA} \
  307 		elif [ X"${SRCS}" != X ] ; then \
  308 			echo ${MKDEP} ${ALL_CPPFLAGS} ${ALL_CFLAGS} ${SRCS}; \
  309 			${MKDEP} ${ALL_CPPFLAGS} ${ALL_CFLAGS} ${SRCS}; \
  310 			${DEPENDEXTRA} \
  311 		elif [ X"${PSRCS}" != X ] ; then \
  312 			echo ${MKDEP} ${ALL_CPPFLAGS} ${ALL_CFLAGS} ${PSRCS}; \
  313 			${MKDEP} -p ${ALL_CPPFLAGS} ${ALL_CFLAGS} ${PSRCS}; \
  314 			${DEPENDEXTRA} \
  315 		fi \
  316 	fi
  317 
  318 FORCE:
  319 
  320 ###
  321 ### Libraries
  322 ###
  323 
  324 AR =		@AR@
  325 ARFLAGS =	@ARFLAGS@
  326 RANLIB =	@RANLIB@
  327 
  328 ###
  329 ### Installation
  330 ###
  331 
  332 INSTALL =		@INSTALL@
  333 INSTALL_PROGRAM =	@INSTALL_PROGRAM@
  334 LINK_PROGRAM =		@LN_S@
  335 INSTALL_SCRIPT =	@INSTALL_SCRIPT@
  336 INSTALL_DATA =		@INSTALL_DATA@
  337 INSTALL_LIBRARY =	@INSTALL_LIBRARY@
  338 
  339 PERL =			@PERL@
  340 
  341 ###
  342 ### Script language program used to create internal symbol tables
  343 ###
  344 MKSYMTBL_PROGRAM =	@MKSYMTBL_PROGRAM@
  345 
  346 ###
  347 ### Switch to create internal symbol table selectively
  348 ###
  349 ALWAYS_MAKE_SYMTABLE =	@ALWAYS_MAKE_SYMTABLE@
  350 
  351 ###
  352 ### DocBook -> HTML
  353 ### DocBook -> man page
  354 ###
  355 
  356 .SUFFIXES: .docbook .html .1 .2 .3 .4 .5 .6 .7 .8
  357 
  358 .docbook.html:
  359 	${XSLTPROC} -o $@ ${top_srcdir}/doc/xsl/isc-docbook-html.xsl $<
  360 
  361 .docbook.1:
  362 	${XSLTPROC} -o $@ ${top_srcdir}/doc/xsl/isc-manpage.xsl $<
  363 
  364 .docbook.2:
  365 	${XSLTPROC} -o $@ ${top_srcdir}/doc/xsl/isc-manpage.xsl $<
  366 
  367 .docbook.3:
  368 	${XSLTPROC} -o $@ ${top_srcdir}/doc/xsl/isc-manpage.xsl $<
  369 
  370 .docbook.4:
  371 	${XSLTPROC} -o $@ ${top_srcdir}/doc/xsl/isc-manpage.xsl $<
  372 
  373 .docbook.5:
  374 	${XSLTPROC} -o $@ ${top_srcdir}/doc/xsl/isc-manpage.xsl $<
  375 
  376 .docbook.6:
  377 	${XSLTPROC} -o $@ ${top_srcdir}/doc/xsl/isc-manpage.xsl $<
  378 
  379 .docbook.7:
  380 	${XSLTPROC} -o $@ ${top_srcdir}/doc/xsl/isc-manpage.xsl $<
  381 
  382 .docbook.8:
  383 	${XSLTPROC} -o $@ ${top_srcdir}/doc/xsl/isc-manpage.xsl $<
  384