rules.in 3.6 KB
Newer Older
Bob Halley's avatar
Bob Halley committed
1
# Copyright (C) 1998, 1999, 2000  Internet Software Consortium.
Bob Halley's avatar
Bob Halley committed
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# 
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
# 
# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
# ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
# CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
# DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
# PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
# SOFTWARE.

Bob Halley's avatar
Bob Halley committed
16
17
18
19
###
### Common Makefile rules for BIND 9.
###

Bob Halley's avatar
Bob Halley committed
20
21
22
###
### Paths
###
Bob Halley's avatar
Bob Halley committed
23
24
### Note: paths that vary by Makefile MUST NOT be listed
### here, or they won't get expanded correctly.
Bob Halley's avatar
Bob Halley committed
25
26
27
28
29
30
31

prefix =	@prefix@
exec_prefix =	@exec_prefix@
bindir =	@bindir@
sbindir =	@sbindir@
includedir =	@includedir@
libdir =	@libdir@
32
33
sysconfdir =	@sysconfdir@
localstatedir =	@localstatedir@
Bob Halley's avatar
Bob Halley committed
34

Bob Halley's avatar
Bob Halley committed
35
36
DESTDIR =

Bob Halley's avatar
Bob Halley committed
37
38
@SET_MAKE@

39
40
top_builddir =	@BIND9_TOP_BUILDDIR@

Bob Halley's avatar
Bob Halley committed
41
42
43
###
### All
###
Bob Halley's avatar
Bob Halley committed
44
### Makefile may define:
Bob Halley's avatar
Bob Halley committed
45
46
###	TARGETS

47
all: subdirs ${TARGETS}
Bob Halley's avatar
Bob Halley committed
48
49
50
51

###
### Subdirectories
###
Bob Halley's avatar
Bob Halley committed
52
53
### Makefile may define:
###	SUBDIRS
Bob Halley's avatar
Bob Halley committed
54
55
56

ALL_SUBDIRS = ${SUBDIRS} nulldir

57
58
59
60
61
#
# We use a single-colon rule so that additional dependencies of
# subdirectories can be specified after the inclusion of this file.
# The "depend" target is treated the same way.
# 
62
63
64
65
66
67
68
subdirs:
	@for i in ${ALL_SUBDIRS}; do \
		if [ "$$i" != "nulldir" -a -d $$i ]; then \
			echo "making all in `pwd`/$$i"; \
			(cd $$i; ${MAKE} ${MAKEDEFS} all); \
		fi \
	done
Bob Halley's avatar
Bob Halley committed
69

70
install clean distclean::
Bob Halley's avatar
Bob Halley committed
71
72
	@for i in ${ALL_SUBDIRS}; do \
		if [ "$$i" != "nulldir" -a -d $$i ]; then \
73
			echo "making $@ in `pwd`/$$i"; \
Bob Halley's avatar
Bob Halley committed
74
75
76
77
78
79
80
81
82
83
84
85
86
87
			(cd $$i; ${MAKE} ${MAKEDEFS} $@); \
		fi \
	done

###
### C Programs
###
### Makefile must define
###	CC
### Makefile may define
###	CFLAGS
###	CINCLUDES
###	CDEFINES
###	CWARNINGS
88
89
### User may define externally
###     EXT_CFLAGS
Bob Halley's avatar
Bob Halley committed
90

Bob Halley's avatar
Bob Halley committed
91
92
93
94
95
CC = 		@CC@
CFLAGS =	@CFLAGS@
STD_CINCLUDES =	@STD_CINCLUDES@
STD_CDEFINES =	@STD_CDEFINES@
STD_CWARNINGS =	@STD_CWARNINGS@
Bob Halley's avatar
Bob Halley committed
96
97

.SUFFIXES:
98
.SUFFIXES: .c .@O@
Bob Halley's avatar
Bob Halley committed
99

100
ALWAYS_INCLUDES = -I${top_builddir}
Bob Halley's avatar
Bob Halley committed
101
102
103
ALWAYS_DEFINES = -D_REENTRANT
ALWAYS_WARNINGS =

Bob Halley's avatar
Bob Halley committed
104
ALL_CPPFLAGS = \
David Lawrence's avatar
David Lawrence committed
105
106
	${ALWAYS_INCLUDES} ${CINCLUDES} ${STD_CINCLUDES} \
	${ALWAYS_DEFINES} ${CDEFINES} ${STD_CDEFINES}
Bob Halley's avatar
Bob Halley committed
107

108
ALL_CFLAGS = ${EXT_CFLAGS} ${CFLAGS} \
Bob Halley's avatar
Bob Halley committed
109
	${ALL_CPPFLAGS} \
Bob Halley's avatar
Bob Halley committed
110
111
	${ALWAYS_WARNINGS} ${STD_CWARNINGS} ${CWARNINGS}

David Lawrence's avatar
David Lawrence committed
112
.c.@O@:
113
	${LIBTOOL} ${CC} ${ALL_CFLAGS} -c $<
Bob Halley's avatar
Bob Halley committed
114

Bob Halley's avatar
Bob Halley committed
115
116
117
SHELL = @SHELL@
LIBTOOL = @LIBTOOL@

Bob Halley's avatar
Bob Halley committed
118
119
MKDEP = ${SHELL} ${top_builddir}/make/mkdep

Bob Halley's avatar
Bob Halley committed
120
clean distclean::
David Lawrence's avatar
David Lawrence committed
121
	rm -f *.@O@ *.lo *.la core *.core
Bob Halley's avatar
Bob Halley committed
122
	rm -rf .libs
Bob Halley's avatar
Bob Halley committed
123
124
125

distclean::
	rm -f Makefile
Bob Halley's avatar
Bob Halley committed
126

127
128
129
130
131
132
133
depend:
	@for i in ${ALL_SUBDIRS}; do \
		if [ "$$i" != "nulldir" -a -d $$i ]; then \
			echo "making depend in `pwd`/$$i"; \
			(cd $$i; ${MAKE} ${MAKEDEFS} $@); \
		fi \
	done
Bob Halley's avatar
Bob Halley committed
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
	@if [ X"${SRCS}" != X -a X"${PSRCS}" != X ] ; then \
		echo ${MKDEP} ${ALL_CPPFLAGS} ${SRCS}; \
		${MKDEP} ${ALL_CPPFLAGS} ${SRCS}; \
		echo ${MKDEP} -ap ${ALL_CPPFLAGS} ${PSRCS}; \
		${MKDEP} -ap ${ALL_CPPFLAGS} ${PSRCS}; \
	elif [ X"${SRCS}" != X ] ; then \
		echo ${MKDEP} ${ALL_CPPFLAGS} ${SRCS}; \
		${MKDEP} ${ALL_CPPFLAGS} ${SRCS}; \
	elif [ X"${PSRCS}" != X ] ; then \
		echo ${MKDEP} ${ALL_CPPFLAGS} ${PSRCS}; \
		${MKDEP} -p ${ALL_CPPFLAGS} ${PSRCS}; \
	fi

FORCE:

Bob Halley's avatar
Bob Halley committed
149
150
151
152
###
### Libraries
###

David Lawrence's avatar
David Lawrence committed
153
154
AR =		@AR@
ARFLAGS =	@ARFLAGS@
Bob Halley's avatar
Bob Halley committed
155
156
157
158
159
160
161
162
163
RANLIB =	@RANLIB@

###
### Installation
###

INSTALL =		@INSTALL@
INSTALL_PROGRAM =	@INSTALL_PROGRAM@
INSTALL_DATA =		@INSTALL_DATA@