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