/[pkgs]/rpms/kernel/F-9/Makefile
ViewVC logotype

Contents of /rpms/kernel/F-9/Makefile

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.72 - (show annotations) (download)
Mon Jan 12 19:54:16 2009 UTC (10 months, 1 week ago) by kyle
Branch: MAIN
CVS Tags: kernel-2_6_28-1_fc9, kernel-2_6_28-2_fc9, HEAD
Changes since 1.71: +4 -2 lines
* Mon Jan 12 2009 Kyle McMartin <kyle@redhat.com>
- Rebase for Fedora 9.
- Turn off CONFIG_MAXSMP on x86_64.
1 # Makefile for source rpm: kernel
2 # $Id: Makefile,v 1.72 2009/01/12 19:54:16 kyle Exp $
3 NAME := kernel
4 SPECFILE := kernel.spec
5
6 # use noarch for make prep instead of the current CPU
7 # noarch creates and checks all config files not just the current one,
8 # in addition "i386" isn't a valid kernel target
9 PREPARCH = noarch
10
11 # we only check the .sign signatures
12 UPSTREAM_CHECKS = sign
13
14 # local targets we need to carry around in addition to the default sources
15 TARGETS = download
16
17 define find-makefile-common
18 for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
19 endef
20
21 MAKEFILE_COMMON := $(shell $(find-makefile-common))
22
23 ifeq ($(MAKEFILE_COMMON),)
24 # attept a checkout
25 define checkout-makefile-common
26 test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2
27 endef
28
29 MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
30 endif
31
32 include $(MAKEFILE_COMMON)
33 include Makefile.config
34
35 extremedebug:
36 @perl -pi -e 's/# CONFIG_DEBUG_PAGEALLOC is not set/CONFIG_DEBUG_PAGEALLOC=y/' config-nodebug
37
38 debug:
39 @perl -pi -e 's/# CONFIG_SLUB_DEBUG_ON is not set/CONFIG_SLUB_DEBUG_ON=y/' config-nodebug
40 @perl -pi -e 's/# CONFIG_LOCK_STAT is not set/CONFIG_LOCK_STAT=y/' config-nodebug
41 @perl -pi -e 's/# CONFIG_DEBUG_STACK_USAGE is not set/CONFIG_DEBUG_STACK_USAGE=y/' config-nodebug
42 @perl -pi -e 's/# CONFIG_DEBUG_SLAB is not set/CONFIG_DEBUG_SLAB=y/' config-nodebug
43 @perl -pi -e 's/# CONFIG_DEBUG_MUTEXES is not set/CONFIG_DEBUG_MUTEXES=y/' config-nodebug
44 @perl -pi -e 's/# CONFIG_DEBUG_RT_MUTEXES is not set/CONFIG_DEBUG_RT_MUTEXES=y/' config-nodebug
45 @perl -pi -e 's/# CONFIG_DEBUG_RWSEMS is not set/CONFIG_DEBUG_RWSEMS=y/' config-nodebug
46 @perl -pi -e 's/# CONFIG_DEBUG_LOCK_ALLOC is not set/CONFIG_DEBUG_LOCK_ALLOC=y/' config-nodebug
47 @perl -pi -e 's/# CONFIG_PROVE_LOCKING is not set/CONFIG_PROVE_LOCKING=y/' config-nodebug
48 @perl -pi -e 's/# CONFIG_DEBUG_SPINLOCK is not set/CONFIG_DEBUG_SPINLOCK=y/' config-nodebug
49 @perl -pi -e 's/# CONFIG_DEBUG_VM is not set/CONFIG_DEBUG_VM=y/' config-nodebug
50 @perl -pi -e 's/# CONFIG_DEBUG_SLEEP_IN_IRQ is not set/CONFIG_DEBUG_SLEEP_IN_IRQ=y/' config-nodebug
51 @perl -pi -e 's/# CONFIG_FAULT_INJECTION is not set/CONFIG_FAULT_INJECTION=y/' config-nodebug
52 @perl -pi -e 's/# CONFIG_FAILSLAB is not set/CONFIG_FAILSLAB=y/' config-nodebug
53 @perl -pi -e 's/# CONFIG_FAIL_PAGE_ALLOC is not set/CONFIG_FAIL_PAGE_ALLOC=y/' config-nodebug
54 @perl -pi -e 's/# CONFIG_FAIL_MAKE_REQUEST is not set/CONFIG_FAIL_MAKE_REQUEST=y/' config-nodebug
55 @perl -pi -e 's/# CONFIG_FAULT_INJECTION_DEBUG_FS is not set/CONFIG_FAULT_INJECTION_DEBUG_FS=y/' config-nodebug
56 @perl -pi -e 's/# CONFIG_FAULT_INJECTION_STACKTRACE_FILTER is not set/CONFIG_FAULT_INJECTION_STACKTRACE_FILTER=y/' config-nodebug
57 @perl -pi -e 's/# CONFIG_DEBUG_SG is not set/CONFIG_DEBUG_SG=y/' config-nodebug
58 @perl -pi -e 's/# CONFIG_DEBUG_WRITECOUNT is not set/CONFIG_DEBUG_WRITECOUNT=y/' config-nodebug
59 @perl -pi -e 's/# CONFIG_DEBUG_OBJECTS is not set/CONFIG_DEBUG_OBJECTS=y/' config-nodebug
60 @perl -pi -e 's/# CONFIG_DEBUG_OBJECTS_FREE is not set/CONFIG_DEBUG_OBJECTS_FREE=y/' config-nodebug
61 @perl -pi -e 's/# CONFIG_DEBUG_OBJECTS_TIMERS is not set/CONFIG_DEBUG_OBJECTS_TIMERS=y/' config-nodebug
62 @perl -pi -e 's/# CONFIG_X86_PTDUMP is not set/CONFIG_X86_PTDUMP=y/' config-nodebug
63 @perl -pi -e 's/# CONFIG_CAN_DEBUG_DEVICES is not set/CONFIG_CAN_DEBUG_DEVICES=y/' config-nodebug
64 @perl -pi -e 's/# CONFIG_MODULE_FORCE_UNLOAD is not set/CONFIG_MODULE_FORCE_UNLOAD=y/' config-nodebug
65 @perl -pi -e 's/# CONFIG_SYSCTL_SYSCALL_CHECK is not set/CONFIG_SYSCTL_SYSCALL_CHECK=y/' config-nodebug
66 @perl -pi -e 's/# CONFIG_PM_TEST_SUSPEND is not set/CONFIG_PM_TEST_SUSPEND=y/' config-generic
67
68 @# just in case we're going from extremedebug -> debug
69 @perl -pi -e 's/CONFIG_DEBUG_PAGEALLOC=y/# CONFIG_DEBUG_PAGEALLOC is not set/' config-nodebug
70
71 @perl -pi -e 's/^%define debugbuildsenabled 1/%define debugbuildsenabled 0/' kernel.spec
72 @perl -pi -e 's/CONFIG_NR_CPUS=64/CONFIG_NR_CPUS=512/' config-x86_64-generic
73
74 release:
75 @perl -pi -e 's/CONFIG_SLUB_DEBUG_ON=y/# CONFIG_SLUB_DEBUG_ON is not set/' config-nodebug
76 @perl -pi -e 's/CONFIG_LOCK_STAT=y/# CONFIG_LOCK_STAT is not set/' config-nodebug
77 @perl -pi -e 's/CONFIG_DEBUG_STACK_USAGE=y/# CONFIG_DEBUG_STACK_USAGE is not set/' config-nodebug
78 @perl -pi -e 's/CONFIG_DEBUG_SLAB=y/# CONFIG_DEBUG_SLAB is not set/' config-nodebug
79 @perl -pi -e 's/CONFIG_DEBUG_MUTEXES=y/# CONFIG_DEBUG_MUTEXES is not set/' config-nodebug
80 @perl -pi -e 's/CONFIG_DEBUG_RT_MUTEXES=y/# CONFIG_DEBUG_RT_MUTEXES is not set/' config-nodebug
81 @perl -pi -e 's/CONFIG_DEBUG_RWSEMS=y/# CONFIG_DEBUG_RWSEMS is not set/' config-nodebug
82 @perl -pi -e 's/CONFIG_DEBUG_LOCK_ALLOC=y/# CONFIG_DEBUG_LOCK_ALLOC is not set/' config-nodebug
83 @perl -pi -e 's/CONFIG_PROVE_LOCKING=y/# CONFIG_PROVE_LOCKING is not set/' config-nodebug
84 @perl -pi -e 's/CONFIG_DEBUG_SPINLOCK=y/# CONFIG_DEBUG_SPINLOCK is not set/' config-nodebug
85 @perl -pi -e 's/CONFIG_DEBUG_PAGEALLOC=y/# CONFIG_DEBUG_PAGEALLOC is not set/' config-debug
86 @perl -pi -e 's/CONFIG_DEBUG_PAGEALLOC=y/# CONFIG_DEBUG_PAGEALLOC is not set/' config-nodebug
87 @perl -pi -e 's/CONFIG_DEBUG_VM=y/# CONFIG_DEBUG_VM is not set/' config-nodebug
88 @perl -pi -e 's/CONFIG_DEBUG_SLEEP_IN_IRQ=y/# CONFIG_DEBUG_SLEEP_IN_IRQ is not set/' config-nodebug
89 @perl -pi -e 's/CONFIG_FAULT_INJECTION=y/# CONFIG_FAULT_INJECTION is not set/' config-nodebug
90 @perl -pi -e 's/CONFIG_FAILSLAB=y/# CONFIG_FAILSLAB is not set/' config-nodebug
91 @perl -pi -e 's/CONFIG_FAIL_PAGE_ALLOC=y/# CONFIG_FAIL_PAGE_ALLOC is not set/' config-nodebug
92 @perl -pi -e 's/CONFIG_FAIL_MAKE_REQUEST=y/# CONFIG_FAIL_MAKE_REQUEST is not set/' config-nodebug
93 @perl -pi -e 's/CONFIG_FAULT_INJECTION_DEBUG_FS=y/# CONFIG_FAULT_INJECTION_DEBUG_FS is not set/' config-nodebug
94 @perl -pi -e 's/CONFIG_FAULT_INJECTION_STACKTRACE_FILTER=y/# CONFIG_FAULT_INJECTION_STACKTRACE_FILTER is not set/' config-nodebug
95 @perl -pi -e 's/CONFIG_DEBUG_SG=y/# CONFIG_DEBUG_SG is not set/' config-nodebug
96 @perl -pi -e 's/CONFIG_DEBUG_WRITECOUNT=y/# CONFIG_DEBUG_WRITECOUNT is not set/' config-nodebug
97 @perl -pi -e 's/CONFIG_DEBUG_OBJECTS=y/# CONFIG_DEBUG_OBJECTS is not set/' config-nodebug
98 @perl -pi -e 's/CONFIG_DEBUG_OBJECTS_FREE=y/# CONFIG_DEBUG_OBJECTS_FREE is not set/' config-nodebug
99 @perl -pi -e 's/CONFIG_DEBUG_OBJECTS_TIMERS=y/# CONFIG_DEBUG_OBJECTS_TIMERS is not set/' config-nodebug
100 @perl -pi -e 's/CONFIG_X86_PTDUMP=y/# CONFIG_X86_PTDUMP is not set/' config-nodebug
101 @perl -pi -e 's/CONFIG_CAN_DEBUG_DEVICES=y/# CONFIG_CAN_DEBUG_DEVICES is not set/' config-nodebug
102 @perl -pi -e 's/CONFIG_MODULE_FORCE_UNLOAD=y/# CONFIG_MODULE_FORCE_UNLOAD is not set/' config-nodebug
103 @perl -pi -e 's/CONFIG_SYSCTL_SYSCALL_CHECK=y/# CONFIG_SYSCTL_SYSCALL_CHECK is not set/' config-nodebug
104 @perl -pi -e 's/CONFIG_PM_TEST_SUSPEND=y/#\ CONFIG_PM_TEST_SUSPEND\ is\ not\ set/' config-generic
105
106 @perl -pi -e 's/CONFIG_NR_CPUS=512/CONFIG_NR_CPUS=64/' config-x86_64-generic
107
108 @perl -pi -e 's/^%define debugbuildsenabled 0/%define debugbuildsenabled 1/' kernel.spec
109
110 rhel:
111 @perl -pi -e 's/# CONFIG_PPC_64K_PAGES is not set/CONFIG_PPC_64K_PAGES=y/' config-powerpc64
112 @perl -pi -e 's/CONFIG_NR_CPUS=64/CONFIG_NR_CPUS=512/' config-x86_64-generic
113
114 reconfig:
115 @rm -f kernel-*-config
116 @VERSION="2.6.27" make -f Makefile.config configs
117 @scripts/reconfig.sh
118
119 force-tag: $(SPECFILE) $(COMMON_DIR)/branches
120 @$(MAKE) tag TAG_OPTS="-F $(TAG_OPTS)"
121
122 # since i386 isn't a target...
123 compile compile-short: DIST_DEFINES += --target $(shell uname -m)
124
125 # 'make local' also needs to build the noarch firmware package
126 local: noarch
127
128 #
129 # Hacks for building vanilla (unpatched) kernel rpms.
130 # Use "make vanilla-TARGET" like "make TARGET" (make vanilla-scratch-build).
131 #
132 vanilla-%: $(SPECFILE:.spec=-vanilla.spec)
133 @$(MAKE) $* SPECFILE=$<
134
135 $(SPECFILE:.spec=-vanilla.spec): $(SPECFILE)
136 @rm -f $@
137 (echo %define nopatches 1; cat $<) > $@
138
139 #scratch-build: NAME = $(shell rpm $(RPM_DEFINES) $(DIST_DEFINES) -q --qf "%{NAME}\n" --specfile $(SPECFILE)| head -1)
140 #scratch-build: test-srpm
141 # $(BUILD_CLIENT) build $(BUILD_FLAGS) --scratch $(TARGET) \
142 # $(SRCRPMDIR)/$(NAME)-$(VERSION)-$(RELEASE).src.rpm
143
144 # Dismal kludge for building via brew from cvs after "make vanilla-tag".
145 ifdef BEEHIVE_SRPM_BUILD
146 export CHECKOUT_TAG ?= $(shell sed s/^.// CVS/Tag)
147 tag-pattern = $(TAG_NAME)-$(TAG_VERSION)-0_%_$(TAG_RELEASE)
148 ifeq (,$(filter-out $(tag-pattern),$(CHECKOUT_TAG)))
149 variant := $(patsubst $(tag-pattern),%,$(CHECKOUT_TAG))
150 srpm: SPECFILE := $(wildcard $(SPECFILE:.spec=-$(variant).spec) \
151 $(SPECFILE:.spec=.t.$(variant).spec))
152 srpm beehive-sprm: RELEASE := 0.$(variant).$(RELEASE)
153 endif
154 endif
155
156 ifndef KVERSION
157 KVERSION := $(shell awk '$$1 == "%define" && $$2 == "base_sublevel" { \
158 print "2.6." $$3 \
159 }' $(SPECFILE))
160 endif
161
162 #
163 # Hacks for building kernel rpms from upstream code plus local GIT branches.
164 # Use "make git/BRANCH/TARGET" like "make TARGET".
165 # Use "make git/BRANCH-fedora/TARGET" to include Fedora patches on top.
166 #
167 ifndef GIT_SPEC
168 git/%:
169 @$(MAKE) GIT_SPEC=$(subst /,-,$(*D)) git-$(*F)
170 else
171 git-%: $(SPECFILE:.spec=.t.$(GIT_SPEC).spec)
172 @$(MAKE) GIT_SPEC= $* SPECFILE=$<
173 endif
174
175 #
176 # Your git-branches.mk file can define GIT_DIR, e.g.:
177 # GIT_DIR = ${HOME}/kernel/.git
178 # Make sure GIT_AUTHOR_NAME and GIT_AUTHOR_EMAIL are also set
179 # or your rpm changelogs will look like crap.
180 #
181 # For each branch it can define a variable branch-BRANCH or tag-BRANCH
182 # giving the parent of BRANCH to diff against in a separate patch. If
183 # the parent is unknown, it will use $(branch-upstream) defaulting to
184 # "refs/remotes/upstream/master".
185 #
186 # Defining tag-BRANCH means the tag corresponds to an upstream patch in
187 # the sources file, so that is used instead of generating a patch with
188 # git. If there is no tag-upstream defined, it will figure out a vNNN
189 # tag or vNNN-gitN pseudo-tag from the last patch in the sources file.
190 # For example:
191 # tag-some-hacks = v2.6.21-rc5
192 # branch-more-hacks = some-hacks
193 # Leads to patches:
194 # git diff v2.6.21-rc5..more-hacks > linux-2.6.21-rc5-some-hacks.patch
195 # git diff some-hacks..more-hacks > linux-2.6.21-rc5-more-hacks.patch
196 # Whereas having no git-branches.mk at all but doing
197 # "make GIT_DIR=... git/mybranch/test-srpm" does:
198 # id=`cat patch-2.6.21-rc5-git4.id` # auto-fetched via upstream file
199 # git diff $id..upstream > linux-2.6.21-rc5-git4-upstream.patch
200 # git diff upstream..mybranch > linux-2.6.21-rc5-git4-mybranch.patch
201 # If the upstream patch (or any branch patch) is empty it's left out.
202 #
203 git-branches.mk:;
204 -include git-branches.mk
205
206 branch-upstream ?= refs/remotes/upstream/master
207
208 ifdef GIT_DIR
209 export GIT_DIR
210 export GIT_AUTHOR_NAME
211 export GIT_AUTHOR_EMAIL
212 gen-patches ?= gen-patches
213
214 ifndef havespec
215 $(SPECFILE:.spec=.t.%-fedora.spec): $(SPECFILE) $(gen-patches) FORCE
216 ./$(gen-patches) --fedora < $< > $@ $(gen-patches-args)
217 $(SPECFILE:.spec=.t.%.spec): $(SPECFILE) $(gen-patches) FORCE
218 ./$(gen-patches) < $< > $@ $(gen-patches-args)
219 .PRECIOUS: $(SPECFILE:.spec=.t.%.spec) $(SPECFILE:.spec=.t.%-fedora.spec)
220 endif
221
222 spec-%: $(SPECFILE:.spec=.t.%.spec) ;
223 $(SPECFILE):;
224 FORCE:;
225
226 branch-of-* = $(firstword $(head-$*) $*)
227 gen-patches-args = --name $* v$(KVERSION) $(call heads,$(branch-of-*))
228 define heads
229 $(if $(tag-$1),$(filter-out v$(KVERSION),$(tag-$1)),\
230 $(call heads,$(firstword $(branch-$1) $(branch-upstream)))) $1
231 endef
232
233 files-%-fedora:
234 @echo $(SPECFILE:.spec=.t.$*-fedora.spec)
235 @$(call list-patches,$(branch-of-*))
236 files-%:
237 @echo $(SPECFILE:.spec=.t.$*.spec)
238 @$(call list-patches,$(branch-of-*))
239 define list-patches
240 $(if $(tag-$1),version=$(patsubst v%,%,$(tag-$1)),\
241 $(call list-patches,$(firstword $(branch-$1) $(branch-upstream)))); \
242 echo linux-$${version}-$(patsubst refs/remotes/%/master,%,$1).patch
243 endef
244
245 ifndef tag-$(branch-upstream)
246 tag-$(branch-upstream) := $(shell \
247 sed -n 's/^.* *//;s/\.bz2$$//;s/patch-/v/;/^v/h;$${g;p}' sources)
248 endif
249 endif

admin@fedoraproject.org
ViewVC Help
Powered by ViewVC 1.1.2