Sync usage with man page.
[netbsd-mini2440.git] / external / bsd / bind / dist / make / rules.in
blob6edf120c01f9c0b285d153048f2c32c41db8ce69
1 # Copyright (C) 2004-2009  Internet Systems Consortium, Inc. ("ISC")
2 # Copyright (C) 1998-2003  Internet Software Consortium.
4 # Permission to use, copy, modify, and/or distribute this software for any
5 # purpose with or without fee is hereby granted, provided that the above
6 # copyright notice and this permission notice appear in all copies.
8 # THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
9 # REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10 # AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
11 # INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12 # LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
13 # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14 # PERFORMANCE OF THIS SOFTWARE.
16 # Id: rules.in,v 1.68 2009/09/01 18:40:25 jinmei Exp
18 ###
19 ### Common Makefile rules for BIND 9.
20 ###
22 ###
23 ### Paths
24 ###
25 ### Note: paths that vary by Makefile MUST NOT be listed
26 ### here, or they won't get expanded correctly.
28 prefix =        @prefix@
29 exec_prefix =   @exec_prefix@
30 bindir =        @bindir@
31 sbindir =       @sbindir@
32 includedir =    @includedir@
33 libdir =        @libdir@
34 sysconfdir =    @sysconfdir@
35 localstatedir = @localstatedir@
36 mandir =        @mandir@
37 datarootdir =   @datarootdir@
38 export_libdir = @export_libdir@
39 export_includedir = @export_includedir@
41 DESTDIR =
43 @SET_MAKE@
45 top_builddir =  @BIND9_TOP_BUILDDIR@
47 ###
48 ### All
49 ###
50 ### Makefile may define:
51 ###     TARGETS
53 all: subdirs ${TARGETS}
55 ###
56 ### Subdirectories
57 ###
58 ### Makefile may define:
59 ###     SUBDIRS
61 ALL_SUBDIRS = ${SUBDIRS} nulldir
64 # We use a single-colon rule so that additional dependencies of
65 # subdirectories can be specified after the inclusion of this file.
66 # The "depend" target is treated the same way.
68 subdirs:
69         @for i in ${ALL_SUBDIRS}; do \
70                 if [ "$$i" != "nulldir" -a -d $$i ]; then \
71                         echo "making all in `pwd`/$$i"; \
72                         (cd $$i; ${MAKE} ${MAKEDEFS} DESTDIR="${DESTDIR}" all) || exit 1; \
73                 fi; \
74         done
76 install:: all
78 install clean distclean maintainer-clean doc docclean man manclean::
79         @for i in ${ALL_SUBDIRS}; do \
80                 if [ "$$i" != "nulldir" -a -d $$i ]; then \
81                         echo "making $@ in `pwd`/$$i"; \
82                         (cd $$i; ${MAKE} ${MAKEDEFS} DESTDIR="${DESTDIR}" $@) || exit 1; \
83                 fi; \
84         done
86 ###
87 ### C Programs
88 ###
89 ### Makefile must define
90 ###     CC
91 ### Makefile may define
92 ###     CFLAGS
93 ###     LDFLAGS
94 ###     CINCLUDES
95 ###     CDEFINES
96 ###     CWARNINGS
97 ### User may define externally
98 ###     EXT_CFLAGS
100 CC =            @CC@
101 CFLAGS =        @CFLAGS@
102 LDFLAGS =       @LDFLAGS@
103 STD_CINCLUDES = @STD_CINCLUDES@
104 STD_CDEFINES =  @STD_CDEFINES@
105 STD_CWARNINGS = @STD_CWARNINGS@
107 BUILD_CC = @BUILD_CC@
108 BUILD_CFLAGS = @BUILD_CFLAGS@
109 BUILD_CPPFLAGS = @BUILD_CPPFLAGS@
110 BUILD_LDFLAGS = @BUILD_LDFLAGS@
111 BUILD_LIBS = @BUILD_LIBS@
113 .SUFFIXES:
114 .SUFFIXES: .c .@O@
116 ALWAYS_INCLUDES = -I${top_builddir}
117 ALWAYS_DEFINES = @ALWAYS_DEFINES@
118 ALWAYS_WARNINGS =
120 ALL_CPPFLAGS = \
121         ${ALWAYS_INCLUDES} ${CINCLUDES} ${STD_CINCLUDES} \
122         ${ALWAYS_DEFINES} ${CDEFINES} ${STD_CDEFINES}
124 ALL_CFLAGS = ${EXT_CFLAGS} ${ALL_CPPFLAGS} ${CFLAGS} \
125         ${ALWAYS_WARNINGS} ${STD_CWARNINGS} ${CWARNINGS}
127 @BIND9_CO_RULE@
128         ${LIBTOOL_MODE_COMPILE} ${CC} ${ALL_CFLAGS} -c $<
130 SHELL = @SHELL@
131 LIBTOOL = @LIBTOOL@
132 LIBTOOL_MODE_COMPILE = ${LIBTOOL} @LIBTOOL_MODE_COMPILE@
133 LIBTOOL_MODE_INSTALL = ${LIBTOOL} @LIBTOOL_MODE_INSTALL@
134 LIBTOOL_MODE_LINK = ${LIBTOOL} @LIBTOOL_MODE_LINK@
135 PURIFY = @PURIFY@
137 MKDEP = ${SHELL} ${top_builddir}/make/mkdep
140 ### This is a template compound command to build an executable binary with
141 ### an internal symbol table.
142 ### This process is tricky.  We first link all objects including a tentative
143 ### empty symbol table, then get a tentative list of symbols from the resulting
144 ### binary ($@tmp0).  Next, we re-link all objects, but this time with the
145 ### symbol table just created ($tmp@1).  The set of symbols should be the same,
146 ### but the corresponding addresses would be changed due to the difference on
147 ### the size of symbol tables.  So we create the symbol table and re-create the
148 ### objects once again.  Finally, we check the symbol table embedded in the
149 ### final binaryis consistent with the binary itself; otherwise the process is
150 ### terminated.
152 ### To minimize the overhead of creating symbol tables, the autoconf switch
153 ### --enable-symtable takes an argument so that the symbol table can be created
154 ### on a per application basis: unless the argument is set to "all", the symbol
155 ### table is created only when a shell (environment) variable "MAKE_SYMTABLE" is
156 ### set to a non-null value in the rule to build the executable binary.
158 ### Each Makefile.in that uses this macro is expected to define "LIBS" and
159 ### "NOSYMLIBS"; the former includes libisc with an empty symbol table, and
160 ### the latter includes libisc without the definition of a symbol table.
161 ### The rule to make the executable binary will look like this
162 ### binary@EXEEXT@: ${OBJS}
163 ###     #export MAKE_SYMTABLE="yes"; \  <- enable if symtable is always needed
164 ###     export BASEOBJS="${OBJS}"; \
165 ###     ${FINALBUILDCMD}
167 ### Normally, ${LIBS} includes all necessary libraries to build the binary;
168 ### there are some exceptions however, where the rule lists some of the
169 ### necessary libraries explicitly in addition to (or instead of) ${LIBS},
170 ### like this:
171 ### binary@EXEEXT@: ${OBJS}
172 ###     cc -o $@ ${OBJS} ${OTHERLIB1} ${OTHERLIB2} ${lIBS}
173 ### in order to modify such a rule to use this compound command, a separate
174 ### variable "LIBS0" should be deinfed for the explicitly listed libraries,
175 ### while making sure ${LIBS} still includes libisc.  So the above rule would
176 ### be modified as follows:
177 ### binary@EXEEXT@: ${OBJS}
178 ###     export BASEOBJS="${OBJS}"; \
179 ###     export LIBS0="${OTHERLIB1} ${OTHERLIB2}"; \
180 ###     ${FINALBUILDCMD}
181 ### See bin/check/Makefile.in for a complete example of the use of LIBS0.
183 FINALBUILDCMD = if [ X"${MKSYMTBL_PROGRAM}" = X -o X"$${MAKE_SYMTABLE:-${ALWAYS_MAKE_SYMTABLE}}" = X ] ; then \
184                 ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} \
185                 -o $@ $${BASEOBJS} $${LIBS0} ${LIBS}; \
186         else \
187                 rm -f $@tmp0; \
188                 ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} \
189                 -o $@tmp0 $${BASEOBJS} $${LIBS0} ${LIBS} || exit 1; \
190                 rm -f $@-symtbl.c $@-symtbl.@O@; \
191                 ${MKSYMTBL_PROGRAM} ${top_srcdir}/util/mksymtbl.pl \
192                 -o $@-symtbl.c $@tmp0 || exit 1; \
193                 $(MAKE) $@-symtbl.@O@ || exit 1; \
194                 rm -f $@tmp1; \
195                 ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} \
196                 -o $@tmp1 $${BASEOBJS} $@-symtbl.@O@ $${LIBS0} ${NOSYMLIBS} || exit 1; \
197                 rm -f $@-symtbl.c $@-symtbl.@O@; \
198                 ${MKSYMTBL_PROGRAM} ${top_srcdir}/util/mksymtbl.pl \
199                 -o $@-symtbl.c $@tmp1 || exit 1; \
200                 $(MAKE) $@-symtbl.@O@ || exit 1; \
201                 ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} \
202                 -o $@tmp2 $${BASEOBJS} $@-symtbl.@O@ $${LIBS0} ${NOSYMLIBS}; \
203                 ${MKSYMTBL_PROGRAM} ${top_srcdir}/util/mksymtbl.pl \
204                 -o $@-symtbl2.c $@tmp2; \
205                 diff $@-symtbl.c $@-symtbl2.c || exit 1;\
206                 mv $@tmp2 $@; \
207                 rm -f $@tmp0 $@tmp1 $@tmp2 $@-symtbl2.c; \
208         fi
210 cleandir: distclean
211 superclean: maintainer-clean
213 clean distclean maintainer-clean::
214         rm -f *.@O@ *.o *.lo *.la core *.core *-symtbl.c *tmp0 *tmp1 *tmp2
215         rm -rf .depend .libs
217 distclean maintainer-clean::
218         rm -f Makefile
220 depend:
221         @for i in ${ALL_SUBDIRS}; do \
222                 if [ "$$i" != "nulldir" -a -d $$i ]; then \
223                         echo "making depend in `pwd`/$$i"; \
224                         (cd $$i; ${MAKE} ${MAKEDEFS} DESTDIR="${DESTDIR}" $@) || exit 1; \
225                 fi; \
226         done
227         @if [ X"${VPATH}" != X ] ; then \
228                 if [ X"${SRCS}" != X -a X"${PSRCS}" != X ] ; then \
229                         echo ${MKDEP} -vpath ${VPATH} ${ALL_CPPFLAGS} ${ALL_CFLAGS} ${SRCS}; \
230                         ${MKDEP} -vpath ${VPATH} ${ALL_CPPFLAGS} ${ALL_CFLAGS} ${SRCS}; \
231                         echo ${MKDEP} -vpath ${VPATH} -ap ${ALL_CPPFLAGS} ${ALL_CFLAGS} ${PSRCS}; \
232                         ${MKDEP} -vpath ${VPATH} -ap ${ALL_CPPFLAGS} ${ALL_CFLAGS} ${PSRCS}; \
233                         ${DEPENDEXTRA} \
234                 elif [ X"${SRCS}" != X ] ; then \
235                         echo ${MKDEP} -vpath ${VPATH} ${ALL_CPPFLAGS} ${ALL_CFLAGS} ${SRCS}; \
236                         ${MKDEP} -vpath ${VPATH} ${ALL_CPPFLAGS} ${ALL_CFLAGS} ${SRCS}; \
237                         ${DEPENDEXTRA} \
238                 elif [ X"${PSRCS}" != X ] ; then \
239                         echo ${MKDEP} -vpath ${VPATH} ${ALL_CPPFLAGS} ${ALL_CFLAGS} ${PSRCS}; \
240                         ${MKDEP} -vpath ${VPATH} -p ${ALL_CPPFLAGS} ${ALL_CFLAGS} ${PSRCS}; \
241                         ${DEPENDEXTRA} \
242                 fi \
243         else \
244                 if [ X"${SRCS}" != X -a X"${PSRCS}" != X ] ; then \
245                         echo ${MKDEP} ${ALL_CPPFLAGS} ${ALL_CFLAGS} ${SRCS}; \
246                         ${MKDEP} ${ALL_CPPFLAGS} ${ALL_CFLAGS} ${SRCS}; \
247                         echo ${MKDEP} -ap ${ALL_CPPFLAGS} ${ALL_CFLAGS} ${PSRCS}; \
248                         ${MKDEP} -ap ${ALL_CPPFLAGS} ${ALL_CFLAGS} ${PSRCS}; \
249                         ${DEPENDEXTRA} \
250                 elif [ X"${SRCS}" != X ] ; then \
251                         echo ${MKDEP} ${ALL_CPPFLAGS} ${ALL_CFLAGS} ${SRCS}; \
252                         ${MKDEP} ${ALL_CPPFLAGS} ${ALL_CFLAGS} ${SRCS}; \
253                         ${DEPENDEXTRA} \
254                 elif [ X"${PSRCS}" != X ] ; then \
255                         echo ${MKDEP} ${ALL_CPPFLAGS} ${ALL_CFLAGS} ${PSRCS}; \
256                         ${MKDEP} -p ${ALL_CPPFLAGS} ${ALL_CFLAGS} ${PSRCS}; \
257                         ${DEPENDEXTRA} \
258                 fi \
259         fi
261 FORCE:
264 ### Libraries
267 AR =            @AR@
268 ARFLAGS =       @ARFLAGS@
269 RANLIB =        @RANLIB@
272 ### Installation
275 INSTALL =               @INSTALL@
276 INSTALL_PROGRAM =       @INSTALL_PROGRAM@
277 LINK_PROGRAM =          @LN_S@
278 INSTALL_SCRIPT =        @INSTALL_SCRIPT@
279 INSTALL_DATA =          @INSTALL_DATA@
282 ### Programs used when generating documentation.  It's ok for these
283 ### not to exist when not generating documentation.
286 XSLTPROC =              @XSLTPROC@ --novalid --xinclude --nonet
287 PERL =                  @PERL@
288 LATEX =                 @LATEX@
289 PDFLATEX =              @PDFLATEX@
290 W3M =                   @W3M@
293 ### Script language program used to create internal symbol tables
295 MKSYMTBL_PROGRAM =      @MKSYMTBL_PROGRAM@
298 ### Switch to create internal symbol table selectively
300 ALWAYS_MAKE_SYMTABLE =  @ALWAYS_MAKE_SYMTABLE@
303 ### DocBook -> HTML
304 ### DocBook -> man page
307 .SUFFIXES: .docbook .html .1 .2 .3 .4 .5 .6 .7 .8
309 .docbook.html:
310         ${XSLTPROC} -o $@ ${top_srcdir}/doc/xsl/isc-docbook-html.xsl $<
312 .docbook.1:
313         ${XSLTPROC} -o $@ ${top_srcdir}/doc/xsl/isc-manpage.xsl $<
315 .docbook.2:
316         ${XSLTPROC} -o $@ ${top_srcdir}/doc/xsl/isc-manpage.xsl $<
318 .docbook.3:
319         ${XSLTPROC} -o $@ ${top_srcdir}/doc/xsl/isc-manpage.xsl $<
321 .docbook.4:
322         ${XSLTPROC} -o $@ ${top_srcdir}/doc/xsl/isc-manpage.xsl $<
324 .docbook.5:
325         ${XSLTPROC} -o $@ ${top_srcdir}/doc/xsl/isc-manpage.xsl $<
327 .docbook.6:
328         ${XSLTPROC} -o $@ ${top_srcdir}/doc/xsl/isc-manpage.xsl $<
330 .docbook.7:
331         ${XSLTPROC} -o $@ ${top_srcdir}/doc/xsl/isc-manpage.xsl $<
333 .docbook.8:
334         ${XSLTPROC} -o $@ ${top_srcdir}/doc/xsl/isc-manpage.xsl $<