1
############################ -*- Mode: Makefile -*- ###########################
3
## Author : Manoj Srivastava ( srivasta@glaurung.green-gryphon.com )
4
## Created On : Sat Nov 15 01:10:05 2003
5
## Created On Node : glaurung.green-gryphon.com
6
## Last Modified By : Manoj Srivastava
7
## Last Modified On : Tue Oct 9 01:50:58 2007
8
## Last Machine Used: anzu.internal.golden-gryphon.com
10
## Status : Unknown, Use with caution!
12
## Description : The top level targets mandated by policy, as well as
13
## their dependencies.
15
## arch-tag: a81086a7-00f7-4355-ac56-8f38396935f4
17
## This program is free software; you can redistribute it and/or modify
18
## it under the terms of the GNU General Public License as published by
19
## the Free Software Foundation; either version 2 of the License, or
20
## (at your option) any later version.
22
## This program is distributed in the hope that it will be useful,
23
## but WITHOUT ANY WARRANTY; without even the implied warranty of
24
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25
## GNU General Public License for more details.
27
## You should have received a copy of the GNU General Public License
28
## along with this program; if not, write to the Free Software
29
## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
31
###############################################################################
33
#######################################################################
34
#######################################################################
35
############### Miscellaneous ###############
36
#######################################################################
37
#######################################################################
39
@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
42
@test $$(id -u) = 0 || (echo need root priviledges; exit 1)
47
# arch-buildpackage likes to call this
50
# OK. We have two sets of rules here, one for arch dependent packages,
51
# and one for arch independent packages. We have already calculated a
52
# list of each of these packages.
54
# In each set, we may need to do things in five steps: configure,
55
# build, install, package, and clean. Now, there can be a common
56
# actions to be taken for all the packages, all arch dependent
57
# packages, all all independent packages, and each package
58
# individually at each stage.
60
###########################################################################
61
# The current code does a number of things: It ensures that the highest #
62
# dependency at any stage (usually the -Common target) depends on the #
63
# stamp-STAGE of the previous stage; so no work on a succeeding stage can #
64
# start before the previous stage is all done. #
65
###########################################################################
67
###########################################################################
68
# Next, all targets that have work performed in them do not have stamp #
69
# files on their own, and thus are not depended on directly by other #
70
# targets. Instead, they depend on and are depended up by intermediate #
71
# targets in which no work is done except to create stamp files. Other #
72
# targets just depend on the stamp files; so the build system does not do #
73
# work twice -- targets, which are up to date, are not executed again. #
74
###########################################################################
77
#######################################################################
78
#######################################################################
79
############### Configuration ###############
80
#######################################################################
81
#######################################################################
84
CONFIG-common:: testdir
88
stamp-arch-conf: CONFIG-common
92
stamp-indep-conf: CONFIG-common
96
STAMPS_TO_CLEAN += stamp-arch-conf stamp-indep-conf
99
CONFIG-arch:: stamp-arch-conf
102
CONFIG-indep:: stamp-indep-conf
106
stamp-configure-arch: CONFIG-arch
109
stamp-configure-indep: CONFIG-indep
112
STAMPS_TO_CLEAN += stamp-configure-arch stamp-configure-indep
115
$(patsubst %,CONFIG/%,$(DEB_ARCH_PACKAGES)) :: CONFIG/% : stamp-configure-arch
118
$(patsubst %,CONFIG/%,$(DEB_INDEP_PACKAGES)) :: CONFIG/% : stamp-configure-indep
122
configure-arch-stamp: stamp-configure-arch $(patsubst %,CONFIG/%,$(DEB_ARCH_PACKAGES))
125
configure-indep-stamp: stamp-configure-indep $(patsubst %,CONFIG/%,$(DEB_INDEP_PACKAGES))
128
STAMPS_TO_CLEAN += configure-arch-stamp configure-indep-stamp
131
configure-arch: configure-arch-stamp
133
configure-indep: configure-indep-stamp
136
stamp-configure: configure-arch configure-indep
141
configure: stamp-configure
144
STAMPS_TO_CLEAN += stamp-configure
145
#######################################################################
146
#######################################################################
147
############### Build ###############
148
#######################################################################
149
#######################################################################
151
BUILD-common:: testdir stamp-configure
155
stamp-arch-build: BUILD-common
159
stamp-indep-build: BUILD-common
163
STAMPS_TO_CLEAN += stamp-arch-build stamp-indep-build
166
BUILD-arch:: stamp-arch-build
169
BUILD-indep:: stamp-indep-build
173
stamp-build-arch: BUILD-arch
176
stamp-build-indep: BUILD-indep
179
STAMPS_TO_CLEAN += stamp-build-arch stamp-build-indep
182
$(patsubst %,BUILD/%,$(DEB_ARCH_PACKAGES)) :: BUILD/% : stamp-build-arch
185
$(patsubst %,BUILD/%,$(DEB_INDEP_PACKAGES)) :: BUILD/% : stamp-build-indep
189
build-arch-stamp: stamp-build-arch $(patsubst %,BUILD/%,$(DEB_ARCH_PACKAGES))
192
build-indep-stamp: stamp-build-indep $(patsubst %,BUILD/%,$(DEB_INDEP_PACKAGES))
195
STAMPS_TO_CLEAN += build-arch-stamp build-indep-stamp
198
build-arch: build-arch-stamp
200
build-indep: build-indep-stamp
203
stamp-build: build-arch build-indep
211
STAMPS_TO_CLEAN += stamp-build
214
POST-BUILD-arch-stamp:: build-arch-stamp
217
STAMPS_TO_CLEAN += POST-BUILD-arch-stamp
219
POST-BUILD-indep-stamp:: build-indep-stamp
222
STAMPS_TO_CLEAN += POST-BUILD-indep-stamp
223
#######################################################################
224
#######################################################################
225
############### Install ###############
226
#######################################################################
227
#######################################################################
229
INST-common:: testdir stamp-build POST-BUILD-arch-stamp POST-BUILD-indep-stamp
233
stamp-arch-inst: INST-common
237
stamp-indep-inst: INST-common
241
STAMPS_TO_CLEAN += stamp-arch-inst stamp-indep-inst
244
INST-arch:: stamp-arch-inst
247
INST-indep:: stamp-indep-inst
251
stamp-install-arch: INST-arch
254
stamp-install-indep: INST-indep
257
STAMPS_TO_CLEAN += stamp-install-arch stamp-install-indep
260
$(patsubst %,INST/%,$(DEB_ARCH_PACKAGES)) :: INST/% : testroot stamp-install-arch
263
$(patsubst %,INST/%,$(DEB_INDEP_PACKAGES)) :: INST/% : testroot stamp-install-indep
267
install-arch-stamp: stamp-install-arch $(patsubst %,INST/%,$(DEB_ARCH_PACKAGES))
271
install-indep-stamp: stamp-install-indep $(patsubst %,INST/%,$(DEB_INDEP_PACKAGES))
275
STAMPS_TO_CLEAN += install-arch-stamp install-indep-stamp
278
install-arch: install-arch-stamp
280
install-indep: install-indep-stamp
283
stamp-install: install-indep install-arch
288
install: stamp-install
291
STAMPS_TO_CLEAN += stamp-install
292
#######################################################################
293
#######################################################################
294
############### Package ###############
295
#######################################################################
296
#######################################################################
298
BIN-common:: testdir testroot stamp-install
302
stamp-arch-bin: testdir testroot BIN-common
306
stamp-indep-bin: testdir testroot BIN-common
310
STAMPS_TO_CLEAN += stamp-arch-bin stamp-indep-bin
313
BIN-arch:: testroot stamp-arch-bin
316
BIN-indep:: testroot stamp-indep-bin
320
stamp-binary-arch: BIN-arch
323
stamp-binary-indep: BIN-indep
326
STAMPS_TO_CLEAN += stamp-binary-arch stamp-binary-indep
329
$(patsubst %,BIN/%,$(DEB_ARCH_PACKAGES)) :: BIN/% : testroot stamp-binary-arch
332
$(patsubst %,BIN/%,$(DEB_INDEP_PACKAGES)) :: BIN/% : testroot stamp-binary-indep
336
binary-arch-stamp: stamp-binary-arch $(patsubst %,BIN/%,$(DEB_ARCH_PACKAGES))
340
binary-indep-stamp: stamp-binary-indep $(patsubst %,BIN/%,$(DEB_INDEP_PACKAGES))
344
STAMPS_TO_CLEAN += binary-arch-stamp binary-indep-stamp
347
binary-arch: binary-arch-stamp
349
binary-indep: binary-indep-stamp
352
stamp-binary: binary-indep binary-arch
359
@echo arch package = $(DEB_ARCH_PACKAGES)
360
@echo indep packages = $(DEB_INDEP_PACKAGES)
362
STAMPS_TO_CLEAN += stamp-binary
363
#######################################################################
364
#######################################################################
365
############### Clean ###############
366
#######################################################################
367
#######################################################################
374
CLN-arch:: CLN-common
377
CLN-indep:: CLN-common
381
$(patsubst %,CLEAN/%,$(DEB_ARCH_PACKAGES)) :: CLEAN/% : CLN-arch
384
$(patsubst %,CLEAN/%,$(DEB_INDEP_PACKAGES)) :: CLEAN/% : CLN-indep
388
clean-arch: CLN-arch $(patsubst %,CLEAN/%,$(DEB_ARCH_PACKAGES))
390
clean-indep: CLN-indep $(patsubst %,CLEAN/%,$(DEB_INDEP_PACKAGES))
393
stamp-clean: clean-indep clean-arch
396
-test -f Makefile && $(MAKE) distclean
397
-rm -f $(FILES_TO_CLEAN) $(STAMPS_TO_CLEAN)
398
-rm -rf $(DIRS_TO_CLEAN)
400
`find . ! -regex '.*/\.git/.*' ! -regex '.*/\{arch\}/.*' \
401
! -regex '.*/CVS/.*' ! -regex '.*/\.arch-ids/.*' \
402
! -regex '.*/\.svn/.*' \
403
\( -name '*.orig' -o -name '*.rej' -o -name '*~' -o \
404
-name '*.bak' -o -name '#*#' -o -name '.*.orig' -o \
405
-name '.*.rej' -o -name '.SUMS' \) \
412
#######################################################################
413
#######################################################################
414
############### ###############
415
#######################################################################
416
#######################################################################
418
.PHONY: CONFIG-common CONFIG-indep CONFIG-arch configure-arch configure-indep configure \
419
BUILD-common BUILD-indep BUILD-arch build-arch build-indep build \
420
INST-common INST-indep INST-arch install-arch install-indep install \
421
BIN-common BIN-indep BIN-arch binary-arch binary-indep binary \
422
CLN-common CLN-indep CLN-arch clean-arch clean-indep clean \
423
$(patsubst %,CONFIG/%,$(DEB_INDEP_PACKAGES)) $(patsubst %,CONFIG/%,$(DEB_ARCH_PACKAGES)) \
424
$(patsubst %,BUILD/%, $(DEB_INDEP_PACKAGES)) $(patsubst %,BUILD/%, $(DEB_ARCH_PACKAGES)) \
425
$(patsubst %,INST/%, $(DEB_INDEP_PACKAGES)) $(patsubst %,INST/%, $(DEB_ARCH_PACKAGES)) \
426
$(patsubst %,BIN/%, $(DEB_INDEP_PACKAGES)) $(patsubst %,BIN/%, $(DEB_ARCH_PACKAGES)) \
427
$(patsubst %,CLEAN/%, $(DEB_INDEP_PACKAGES)) $(patsubst %,CLEAN/%, $(DEB_ARCH_PACKAGES)) \
428
implode explode prebuild checkpo