~ubuntu-branches/ubuntu/maverick/checkpolicy/maverick

« back to all changes in this revision

Viewing changes to debian/common/targets.mk

  • Committer: Bazaar Package Importer
  • Author(s): Russell Coker
  • Date: 2008-07-12 00:16:59 UTC
  • mfrom: (1.1.10 upstream) (2.1.3 lenny)
  • Revision ID: james.westby@ubuntu.com-20080712001659-vh8tlttve9vi3cc8
Tags: 2.0.16-1
* Non-maintainer upload.
* New upstream version needed for latest policy.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
############################ -*- Mode: Makefile -*- ###########################
 
2
## targets.mk ---
 
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
 
9
## Update Count     : 95
 
10
## Status           : Unknown, Use with caution!
 
11
## HISTORY          :
 
12
## Description      : The top level targets mandated by policy, as well as
 
13
##                    their dependencies.
 
14
##
 
15
## arch-tag: a81086a7-00f7-4355-ac56-8f38396935f4
 
16
##
 
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.
 
21
##
 
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.
 
26
##
 
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
 
30
##
 
31
###############################################################################
 
32
 
 
33
#######################################################################
 
34
#######################################################################
 
35
###############             Miscellaneous               ###############
 
36
#######################################################################
 
37
#######################################################################
 
38
source diff:
 
39
        @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
 
40
 
 
41
testroot:
 
42
        @test $$(id -u) = 0 || (echo need root priviledges; exit 1)
 
43
 
 
44
checkpo:
 
45
        $(CHECKPO)
 
46
 
 
47
# arch-buildpackage likes to call this
 
48
prebuild:
 
49
 
 
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.
 
53
 
 
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.
 
59
 
 
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
###########################################################################
 
66
 
 
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
###########################################################################
 
75
 
 
76
 
 
77
#######################################################################
 
78
#######################################################################
 
79
###############             Configuration               ###############
 
80
#######################################################################
 
81
#######################################################################
 
82
 
 
83
# Work here
 
84
CONFIG-common:: testdir
 
85
        $(REASON)
 
86
        $(checkdir)
 
87
 
 
88
stamp-arch-conf:  CONFIG-common
 
89
        $(REASON)
 
90
        $(checkdir)
 
91
        @echo done > $@
 
92
stamp-indep-conf: CONFIG-common
 
93
        $(REASON)
 
94
        $(checkdir)
 
95
        @echo done > $@
 
96
STAMPS_TO_CLEAN += stamp-arch-conf stamp-indep-conf
 
97
 
 
98
# Work here
 
99
CONFIG-arch::  stamp-arch-conf
 
100
        $(REASON)
 
101
        $(checkdir)
 
102
CONFIG-indep:: stamp-indep-conf
 
103
        $(REASON)
 
104
        $(checkdir)
 
105
 
 
106
stamp-configure-arch:  CONFIG-arch
 
107
        $(REASON)
 
108
        @echo done > $@
 
109
stamp-configure-indep: CONFIG-indep
 
110
        $(REASON)
 
111
        @echo done > $@
 
112
STAMPS_TO_CLEAN += stamp-configure-arch stamp-configure-indep
 
113
 
 
114
# Work here
 
115
$(patsubst %,CONFIG/%,$(DEB_ARCH_PACKAGES))  :: CONFIG/% : stamp-configure-arch
 
116
        $(REASON)
 
117
        $(checkdir)
 
118
$(patsubst %,CONFIG/%,$(DEB_INDEP_PACKAGES)) :: CONFIG/% : stamp-configure-indep
 
119
        $(REASON)
 
120
        $(checkdir)
 
121
 
 
122
configure-arch-stamp: stamp-configure-arch  $(patsubst %,CONFIG/%,$(DEB_ARCH_PACKAGES))
 
123
        $(REASON)
 
124
        @echo done > $@
 
125
configure-indep-stamp: stamp-configure-indep $(patsubst %,CONFIG/%,$(DEB_INDEP_PACKAGES))
 
126
        $(REASON)
 
127
        @echo done > $@
 
128
STAMPS_TO_CLEAN += configure-arch-stamp configure-indep-stamp
 
129
 
 
130
# required
 
131
configure-arch:  configure-arch-stamp
 
132
        $(REASON)
 
133
configure-indep: configure-indep-stamp
 
134
        $(REASON)
 
135
 
 
136
stamp-configure: configure-arch configure-indep
 
137
        $(REASON)
 
138
        @echo done > $@
 
139
 
 
140
# required
 
141
configure: stamp-configure
 
142
        $(REASON)
 
143
 
 
144
STAMPS_TO_CLEAN += stamp-configure
 
145
#######################################################################
 
146
#######################################################################
 
147
###############                 Build                   ###############
 
148
#######################################################################
 
149
#######################################################################
 
150
# Work here
 
151
BUILD-common:: testdir stamp-configure
 
152
        $(REASON)
 
153
        $(checkdir)
 
154
 
 
155
stamp-arch-build:  BUILD-common
 
156
        $(REASON)
 
157
        $(checkdir)
 
158
        @echo done > $@
 
159
stamp-indep-build: BUILD-common
 
160
        $(REASON)
 
161
        $(checkdir)
 
162
        @echo done > $@
 
163
STAMPS_TO_CLEAN += stamp-arch-build stamp-indep-build
 
164
 
 
165
# sync. Work here
 
166
BUILD-arch::  stamp-arch-build
 
167
        $(REASON)
 
168
        $(checkdir)
 
169
BUILD-indep:: stamp-indep-build
 
170
        $(REASON)
 
171
        $(checkdir)
 
172
 
 
173
stamp-build-arch: BUILD-arch
 
174
        $(REASON)
 
175
        @echo done > $@
 
176
stamp-build-indep: BUILD-indep
 
177
        $(REASON)
 
178
        @echo done > $@
 
179
STAMPS_TO_CLEAN += stamp-build-arch stamp-build-indep
 
180
 
 
181
# Work here
 
182
$(patsubst %,BUILD/%,$(DEB_ARCH_PACKAGES))  :: BUILD/% : stamp-build-arch
 
183
        $(REASON)
 
184
        $(checkdir)
 
185
$(patsubst %,BUILD/%,$(DEB_INDEP_PACKAGES)) :: BUILD/% : stamp-build-indep
 
186
        $(REASON)
 
187
        $(checkdir)
 
188
 
 
189
build-arch-stamp: stamp-build-arch $(patsubst %,BUILD/%,$(DEB_ARCH_PACKAGES))
 
190
        $(REASON)
 
191
        @echo done > $@
 
192
build-indep-stamp: stamp-build-indep $(patsubst %,BUILD/%,$(DEB_INDEP_PACKAGES))
 
193
        $(REASON)
 
194
        @echo done > $@
 
195
STAMPS_TO_CLEAN += build-arch-stamp build-indep-stamp
 
196
 
 
197
# required
 
198
build-arch: build-arch-stamp
 
199
        $(REASON)
 
200
build-indep: build-indep-stamp
 
201
        $(REASON)
 
202
 
 
203
stamp-build: build-arch build-indep
 
204
        $(REASON)
 
205
        @echo done > $@
 
206
 
 
207
# required
 
208
build: stamp-build
 
209
        $(REASON)
 
210
 
 
211
STAMPS_TO_CLEAN += stamp-build
 
212
 
 
213
# Work here
 
214
POST-BUILD-arch-stamp:: build-arch-stamp
 
215
        $(REASON)
 
216
        @echo done > $@
 
217
STAMPS_TO_CLEAN += POST-BUILD-arch-stamp
 
218
 
 
219
POST-BUILD-indep-stamp:: build-indep-stamp
 
220
        $(REASON)
 
221
        @echo done > $@
 
222
STAMPS_TO_CLEAN += POST-BUILD-indep-stamp
 
223
#######################################################################
 
224
#######################################################################
 
225
###############                Install                  ###############
 
226
#######################################################################
 
227
#######################################################################
 
228
# Work here
 
229
INST-common:: testdir stamp-build POST-BUILD-arch-stamp POST-BUILD-indep-stamp
 
230
        $(checkdir)
 
231
        $(REASON)
 
232
 
 
233
stamp-arch-inst: INST-common
 
234
        $(REASON)
 
235
        $(checkdir)
 
236
        @echo done > $@
 
237
stamp-indep-inst: INST-common
 
238
        $(REASON)
 
239
        $(checkdir)
 
240
        @echo done > $@
 
241
STAMPS_TO_CLEAN += stamp-arch-inst stamp-indep-inst
 
242
 
 
243
# sync. Work here
 
244
INST-arch::  stamp-arch-inst
 
245
        $(REASON)
 
246
        $(checkdir)
 
247
INST-indep:: stamp-indep-inst
 
248
        $(REASON)
 
249
        $(checkdir)
 
250
 
 
251
stamp-install-arch:  INST-arch
 
252
        $(REASON)
 
253
        @echo done > $@
 
254
stamp-install-indep: INST-indep
 
255
        $(REASON)
 
256
        @echo done > $@
 
257
STAMPS_TO_CLEAN += stamp-install-arch stamp-install-indep
 
258
 
 
259
# Work here
 
260
$(patsubst %,INST/%,$(DEB_ARCH_PACKAGES))  :: INST/% : testroot stamp-install-arch
 
261
        $(REASON)
 
262
        $(checkdir)
 
263
$(patsubst %,INST/%,$(DEB_INDEP_PACKAGES)) :: INST/% : testroot stamp-install-indep
 
264
        $(REASON)
 
265
        $(checkdir)
 
266
 
 
267
install-arch-stamp: stamp-install-arch   $(patsubst %,INST/%,$(DEB_ARCH_PACKAGES))
 
268
        $(REASON)
 
269
        $(checkdir)
 
270
        @echo done > $@
 
271
install-indep-stamp: stamp-install-indep $(patsubst %,INST/%,$(DEB_INDEP_PACKAGES))
 
272
        $(REASON)
 
273
        $(checkdir)
 
274
        @echo done > $@
 
275
STAMPS_TO_CLEAN += install-arch-stamp install-indep-stamp
 
276
 
 
277
#required
 
278
install-arch: install-arch-stamp
 
279
        $(REASON)
 
280
install-indep: install-indep-stamp
 
281
        $(REASON)
 
282
 
 
283
stamp-install: install-indep install-arch
 
284
        $(REASON)
 
285
        @echo done > $@
 
286
 
 
287
#required
 
288
install: stamp-install
 
289
        $(REASON)
 
290
 
 
291
STAMPS_TO_CLEAN += stamp-install
 
292
#######################################################################
 
293
#######################################################################
 
294
###############                Package                  ###############
 
295
#######################################################################
 
296
#######################################################################
 
297
# Work here
 
298
BIN-common:: testdir testroot  stamp-install
 
299
        $(REASON)
 
300
        $(checkdir)
 
301
 
 
302
stamp-arch-bin:  testdir testroot BIN-common
 
303
        $(REASON)
 
304
        $(checkdir)
 
305
        @echo done > $@
 
306
stamp-indep-bin: testdir testroot BIN-common
 
307
        $(REASON)
 
308
        $(checkdir)
 
309
        @echo done > $@
 
310
STAMPS_TO_CLEAN += stamp-arch-bin stamp-indep-bin
 
311
 
 
312
# sync Work here
 
313
BIN-arch::  testroot stamp-arch-bin
 
314
        $(REASON)
 
315
        $(checkdir)
 
316
BIN-indep:: testroot stamp-indep-bin
 
317
        $(REASON)
 
318
        $(checkdir)
 
319
 
 
320
stamp-binary-arch:  BIN-arch
 
321
        $(REASON)
 
322
        @echo done > $@
 
323
stamp-binary-indep: BIN-indep
 
324
        $(REASON)
 
325
        @echo done > $@
 
326
STAMPS_TO_CLEAN += stamp-binary-arch stamp-binary-indep
 
327
 
 
328
# Work here
 
329
$(patsubst %,BIN/%,$(DEB_ARCH_PACKAGES))  :: BIN/% : testroot stamp-binary-arch
 
330
        $(REASON)
 
331
        $(checkdir)
 
332
$(patsubst %,BIN/%,$(DEB_INDEP_PACKAGES)) :: BIN/% : testroot stamp-binary-indep
 
333
        $(REASON)
 
334
        $(checkdir)
 
335
 
 
336
binary-arch-stamp: stamp-binary-arch   $(patsubst %,BIN/%,$(DEB_ARCH_PACKAGES))
 
337
        $(REASON)
 
338
        $(checkdir)
 
339
        @echo done > $@
 
340
binary-indep-stamp: stamp-binary-indep $(patsubst %,BIN/%,$(DEB_INDEP_PACKAGES))
 
341
        $(REASON)
 
342
        $(checkdir)
 
343
        @echo done > $@
 
344
STAMPS_TO_CLEAN += binary-arch-stamp binary-indep-stamp
 
345
 
 
346
# required
 
347
binary-arch: binary-arch-stamp
 
348
        $(REASON)
 
349
binary-indep: binary-indep-stamp
 
350
        $(REASON)
 
351
 
 
352
stamp-binary: binary-indep binary-arch
 
353
        $(REASON)
 
354
        @echo done > $@
 
355
 
 
356
# required
 
357
binary: stamp-binary
 
358
        $(REASON)
 
359
        @echo arch package   = $(DEB_ARCH_PACKAGES)
 
360
        @echo indep packages = $(DEB_INDEP_PACKAGES)
 
361
 
 
362
STAMPS_TO_CLEAN += stamp-binary
 
363
#######################################################################
 
364
#######################################################################
 
365
###############                 Clean                   ###############
 
366
#######################################################################
 
367
#######################################################################
 
368
# Work here
 
369
CLN-common:: testdir
 
370
        $(REASON)
 
371
        $(checkdir)
 
372
 
 
373
# sync Work here
 
374
CLN-arch::  CLN-common
 
375
        $(REASON)
 
376
        $(checkdir)
 
377
CLN-indep:: CLN-common
 
378
        $(REASON)
 
379
        $(checkdir)
 
380
# Work here
 
381
$(patsubst %,CLEAN/%,$(DEB_ARCH_PACKAGES))  :: CLEAN/% : CLN-arch
 
382
        $(REASON)
 
383
        $(checkdir)
 
384
$(patsubst %,CLEAN/%,$(DEB_INDEP_PACKAGES)) :: CLEAN/% : CLN-indep
 
385
        $(REASON)
 
386
        $(checkdir)
 
387
 
 
388
clean-arch: CLN-arch $(patsubst %,CLEAN/%,$(DEB_ARCH_PACKAGES))
 
389
        $(REASON)
 
390
clean-indep: CLN-indep $(patsubst %,CLEAN/%,$(DEB_INDEP_PACKAGES))
 
391
        $(REASON)
 
392
 
 
393
stamp-clean: clean-indep clean-arch
 
394
        $(REASON)
 
395
        $(checkdir)
 
396
        -test -f Makefile && $(MAKE) distclean
 
397
        -rm -f  $(FILES_TO_CLEAN) $(STAMPS_TO_CLEAN)
 
398
        -rm -rf $(DIRS_TO_CLEAN)
 
399
        -rm -f core TAGS                                                     \
 
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' \)                     \
 
406
                -print`
 
407
 
 
408
clean: stamp-clean
 
409
        $(REASON)
 
410
 
 
411
 
 
412
#######################################################################
 
413
#######################################################################
 
414
###############                                         ###############
 
415
#######################################################################
 
416
#######################################################################
 
417
 
 
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
 
429
 
 
430
#Local variables:
 
431
#mode: makefile
 
432
#End: