~ubuntu-branches/ubuntu/feisty/apache2/feisty

« back to all changes in this revision

Viewing changes to debian/sys-build.mk

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Barth
  • Date: 2006-12-09 21:05:45 UTC
  • mfrom: (0.6.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20061209210545-h70s0xaqc2v8vqr2
Tags: 2.2.3-3.2
* Non-maintainer upload.
* 043_ajp_connection_reuse: Patch from upstream Bugzilla, fixing a critical
  issue with regard to connection reuse in mod_proxy_ajp.
  Closes: #396265

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/make -f
2
 
# Separate tarball/patch build system by Adam Heath <doogie@debian.org>
3
 
 
4
 
# The magic targets that you need to concern yourself with are:
5
 
#
6
 
# source.build:         Unpacks upstream tarballs, optionally applies patches
7
 
#                       to fix the upstream patches, then applies upstream
8
 
#                       patches.
9
 
# source.make:          Applies debian patches.
10
 
# source.clean:         Cleans the build directory, then unfixes the upstream
11
 
#                       patches.
12
 
# source.compile:       Will compile the source for you.  Please check
13
 
#                       debian/scripts/vars.
14
 
# source.cmd:           When calling this target, if you define a variable
15
 
#                       SOURCE_CMD, it will run that command in the build
16
 
#                       tree.
17
 
# make-diff:            Generates debian.diff in the current directory which
18
 
#                       contains all edits that are currently in the build
19
 
#                       tree.
20
 
#
21
 
# Nothing in this file should require any editting.  Please look at
22
 
# debian/scripts/vars for things to change for the local environment.
23
 
#
24
 
# debian/rules target           command
25
 
# ----------------------------------------------------------------
26
 
# clean:                        $(MAKE) -f debian/sys-build.mk source.clean
27
 
# build:                        $(MAKE) -f debian/sys-build.mk source.compile
28
 
#                                       for simple systems.
29
 
# build:                        $(MAKE) -f debian/sys-build.mk source.make
30
 
#                                       and, in the rules file, you can
31
 
#                                       build the targets you want.
32
 
SHELL=/bin/bash
33
 
ifndef NOISY
34
 
.SILENT:
35
 
endif
36
 
 
37
 
include debian/scripts/vars
38
 
# remove quotes
39
 
DIFF_EXCLUDE:=$(patsubst %,-x %,$(shell echo $(DIFF_EXCLUDE)))
40
 
 
41
 
ifdef TAR_DIR
42
 
BUILD_TREE=$(SOURCE_DIR)/$(TAR_DIR)
43
 
else
44
 
BUILD_TREE=$(SOURCE_DIR)
45
 
endif
46
 
 
47
 
SOURCE_CMD=:
48
 
 
49
 
ifdef CLEAN_IGNORE
50
 
        CLEAN_CMD=-
51
 
        CLEAN_SH=
52
 
else
53
 
        CLEAN_CMD=
54
 
        CLEAN_SH=
55
 
endif
56
 
ifndef CLEAN_TARGET
57
 
        CLEAN_TARGET=clean
58
 
endif
59
 
 
60
 
foo:
61
 
        echo $(DIFF_EXCLUDE)
62
 
 
63
 
make-diff:
64
 
        mv $(BUILD_TREE) bak
65
 
        $(MAKE) -f debian/sys-build.mk source.clean
66
 
        $(MAKE) -f debian/sys-build.mk source.make
67
 
        mv $(BUILD_TREE) $(BUILD_TREE).orig
68
 
        mv bak $(BUILD_TREE)
69
 
 
70
 
ifdef TAR_DIR
71
 
 ifdef CLEAN_TARGET_EXTERNAL
72
 
        $(CLEAN_CMD)$(MAKE) -f debian/rules $(CLEAN_TARGET_EXTERNAL)
73
 
 else
74
 
        $(CLEAN_CMD)$(MAKE) -C $(BUILD_TREE) $(CLEAN_TARGET)
75
 
 endif
76
 
        -(cd $(SOURCE_DIR);diff -ruN $(TAR_DIR).orig $(TAR_DIR) $(DIFF_EXCLUDE)) > debian.diff
77
 
else
78
 
 ifdef CLEAN_TARGET_EXTERNAL
79
 
        @echo CLEAN_TARGET_EXTERNAL=\"$(CLEAN_TARGET_EXTERNAL)\"
80
 
        $(CLEAN_CMD)$(MAKE) -f debian/rules $(CLEAN_TARGET_EXTERNAL)
81
 
 else
82
 
        $(CLEAN_CMD)for a in $(BUILD_TREE)/*;do $(MAKE) -C $$a $(CLEAN_TARGET);done
83
 
 endif
84
 
        -(diff -ruN $(BUILD_TREE).orig $(BUILD_TREE) $(DIFF_EXCLUDE)) > debian.diff
85
 
        if [ ! -s debian.diff ];then\
86
 
                rm debian.diff;\
87
 
        fi
88
 
endif
89
 
        rm -rf $(BUILD_TREE).orig
90
 
 
91
 
patchapply: $(STAMP_DIR)/patchapply
92
 
$(STAMP_DIR)/patchapply: $(STAMP_DIR)/source.build $(STAMP_DIR)
93
 
        $(SHELL) debian/scripts/patch.apply
94
 
        touch $@
95
 
        rm -f $(STAMP_DIR)/patchunapply
96
 
 
97
 
patchunapply: $(STAMP_DIR)/patchunapply
98
 
$(STAMP_DIR)/patchunapply: $(STAMP_DIR)/source.build $(STAMP_DIR)
99
 
        $(SHELL) debian/scripts/patch.unapply
100
 
        touch $@
101
 
        rm -f $(STAMP_DIR)/patchapply
102
 
 
103
 
.export: SOURCE_TREE
104
 
 
105
 
#
106
 
# The rules that really do the work all start with $(STAMPDIR)
107
 
# This little trick allows us to use stamp files to keep us from
108
 
# having to rerun long targets over and over.  It also puts
109
 
# all stamp files in one place, for easy cleaning.
110
 
#
111
 
# If a stampdir rule depends on something else, be sure it is
112
 
# another stampdir rule.  Depending on base rule won't work.
113
 
#
114
 
 
115
 
source.build: $(STAMP_DIR)/source.build
116
 
$(STAMP_DIR)/source.build: $(STAMP_DIR)/source.unpack $(STAMP_DIR)/source.patch $(STAMP_DIR)
117
 
        touch $@
118
 
 
119
 
source.make: $(STAMP_DIR)/source.make
120
 
$(STAMP_DIR)/source.make: $(STAMP_DIR)/source.build $(STAMP_DIR)/patchapply $(STAMP_DIR)
121
 
        touch $@
122
 
 
123
 
source.unpack: $(STAMP_DIR)/source.unpack
124
 
$(STAMP_DIR)/source.unpack: $(STAMP_DIR)
125
 
        $(SHELL) debian/scripts/source.unpack
126
 
        touch $@
127
 
 
128
 
source.patch: $(STAMP_DIR)/source.patch
129
 
$(STAMP_DIR)/source.patch: $(STAMP_DIR)/source.unpack $(STAMP_DIR)/fix.source.patch $(STAMP_DIR)
130
 
        $(SHELL) debian/scripts/source.patch
131
 
        touch $@
132
 
 
133
 
fix.source.patch: $(STAMP_DIR)/fix.source.patch
134
 
$(STAMP_DIR)/fix.source.patch: $(STAMP_DIR)
135
 
        $(SHELL) debian/scripts/fix.source.patch
136
 
        touch $@
137
 
 
138
 
unfix.source.patch: $(STAMP_DIR)/unfix.source.patch
139
 
$(STAMP_DIR)/unfix.source.patch: $(STAMP_DIR)
140
 
        $(SHELL) debian/scripts/unfix.source.patch
141
 
        touch $@
142
 
 
143
 
source.compile: $(STAMP_DIR)/source.compile
144
 
$(STAMP_DIR)/source.compile: $(STAMP_DIR)/source.make $(STAMP_DIR)
145
 
        $(MAKE) -C $(BUILD_TREE) $(BUILD_TARGET)
146
 
        touch $@
147
 
 
148
 
source.command:
149
 
        (cd $(BUILD_TREE); $(SOURCE_CMD))
150
 
 
151
 
DIR_TARGETS+=$(STAMP_DIR)
152
 
STAMP_DIR_TARGETS+=source.make source.unpack source.patch fix.source.patch unfix.source.patch patchunapply patchunapply
153
 
 
154
 
$(DIR_TARGETS)/:
155
 
        mkdir -p $@
156
 
 
157
 
source.clean: unfix.source.patch
158
 
        $(SHELL) debian/scripts/source.clean