1# Copyright (C) 2004, 2007, 2009 Internet Systems Consortium, Inc. ("ISC") 2# Copyright (C) 2001, 2002 Internet Software Consortium. 3# 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. 7# 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. 15 16# Id: rules.in,v 1.15 2009/01/22 23:49:23 tbox Exp 17 18### 19### Common Makefile rules for BIND 9. 20### 21 22### 23### Paths 24### 25### Note: paths that vary by Makefile MUST NOT be listed 26### here, or they won't get expanded correctly. 27 28prefix = @prefix@ 29exec_prefix = @exec_prefix@ 30bindir = @bindir@ 31sbindir = @sbindir@ 32includedir = @includedir@ 33libdir = @libdir@ 34sysconfdir = @sysconfdir@ 35localstatedir = @localstatedir@ 36mandir = @mandir@ 37datarootdir = @datarootdir@ 38 39DESTDIR = 40MAKEDEFS= 'DESTDIR=${DESTDIR}' 41 42@SET_MAKE@ 43 44top_builddir = @BIND9_TOP_BUILDDIR@ 45abs_top_srcdir = @abs_top_srcdir@ 46 47### 48### All 49### 50### Makefile may define: 51### TARGETS 52 53all: subdirs ${TARGETS} 54 55### 56### Subdirectories 57### 58### Makefile may define: 59### SUBDIRS 60 61ALL_SUBDIRS = ${SUBDIRS} nulldir 62 63# 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. 67# 68subdirs: 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} all) || exit 1; \ 73 fi; \ 74 done 75 76install clean distclean docclean manclean:: 77 @for i in ${ALL_SUBDIRS}; do \ 78 if [ "$$i" != "nulldir" -a -d $$i ]; then \ 79 echo "making $@ in `pwd`/$$i"; \ 80 (cd $$i; ${MAKE} ${MAKEDEFS} $@) || exit 1; \ 81 fi \ 82 done 83 84### 85### C Programs 86### 87### Makefile must define 88### CC 89### Makefile may define 90### CFLAGS 91### CINCLUDES 92### CDEFINES 93### CWARNINGS 94### User may define externally 95### EXT_CFLAGS 96 97CC = @CC@ 98CFLAGS = @CFLAGS@ 99STD_CINCLUDES = @STD_CINCLUDES@ 100STD_CDEFINES = @STD_CDEFINES@ 101STD_CWARNINGS = @STD_CWARNINGS@ 102 103.SUFFIXES: 104.SUFFIXES: .c .@O@ 105 106ALWAYS_INCLUDES = -I${top_builddir} -I${abs_top_srcdir}/@PORT_INCLUDE@ 107ALWAYS_DEFINES = @ALWAYS_DEFINES@ 108ALWAYS_WARNINGS = 109 110ALL_CPPFLAGS = \ 111 ${ALWAYS_INCLUDES} ${CINCLUDES} ${STD_CINCLUDES} \ 112 ${ALWAYS_DEFINES} ${CDEFINES} ${STD_CDEFINES} 113 114ALL_CFLAGS = ${EXT_CFLAGS} ${CFLAGS} \ 115 ${ALL_CPPFLAGS} \ 116 ${ALWAYS_WARNINGS} ${STD_CWARNINGS} ${CWARNINGS} 117 118.c.@O@: 119 ${LIBTOOL_MODE_COMPILE} ${CC} ${ALL_CFLAGS} -c $< 120 121SHELL = @SHELL@ 122LIBTOOL = @LIBTOOL@ 123LIBTOOL_MODE_COMPILE = ${LIBTOOL} @LIBTOOL_MODE_COMPILE@ 124LIBTOOL_MODE_INSTALL = ${LIBTOOL} @LIBTOOL_MODE_INSTALL@ 125LIBTOOL_MODE_LINK = ${LIBTOOL} @LIBTOOL_MODE_LINK@ 126PURIFY = @PURIFY@ 127 128MKDEP = ${SHELL} ${top_builddir}/make/mkdep 129 130cleandir: distclean 131 132clean distclean:: 133 rm -f *.@O@ *.lo *.la core *.core .depend 134 rm -rf .libs 135 136distclean:: 137 rm -f Makefile 138 139depend: 140 @for i in ${ALL_SUBDIRS}; do \ 141 if [ "$$i" != "nulldir" -a -d $$i ]; then \ 142 echo "making depend in `pwd`/$$i"; \ 143 (cd $$i; ${MAKE} ${MAKEDEFS} $@) || exit 1; \ 144 fi \ 145 done 146 @if [ X"${SRCS}" != X -a X"${PSRCS}" != X ] ; then \ 147 echo ${MKDEP} ${ALL_CPPFLAGS} ${SRCS}; \ 148 ${MKDEP} ${ALL_CPPFLAGS} ${SRCS}; \ 149 echo ${MKDEP} -ap ${ALL_CPPFLAGS} ${PSRCS}; \ 150 ${MKDEP} -ap ${ALL_CPPFLAGS} ${PSRCS}; \ 151 ${DEPENDEXTRA} \ 152 elif [ X"${SRCS}" != X ] ; then \ 153 echo ${MKDEP} ${ALL_CPPFLAGS} ${SRCS}; \ 154 ${MKDEP} ${ALL_CPPFLAGS} ${SRCS}; \ 155 ${DEPENDEXTRA} \ 156 elif [ X"${PSRCS}" != X ] ; then \ 157 echo ${MKDEP} ${ALL_CPPFLAGS} ${PSRCS}; \ 158 ${MKDEP} -p ${ALL_CPPFLAGS} ${PSRCS}; \ 159 ${DEPENDEXTRA} \ 160 fi 161 162FORCE: 163 164### 165### Libraries 166### 167 168AR = @AR@ 169ARFLAGS = @ARFLAGS@ 170RANLIB = @RANLIB@ 171 172### 173### Installation 174### 175 176INSTALL = @INSTALL@ 177INSTALL_PROGRAM = @INSTALL_PROGRAM@ 178INSTALL_DATA = @INSTALL_DATA@ 179