Build the kernel-firmware package (LP #1339172)
[packages/centos6/kernel.git] / Makefile.config
1 # Make rules for configuration files.
2 #
3 # $Id$
4 # this section is needed in order to make O= to work
5
6 OUTPUT := $(abspath ../..)
7
8 ifeq ("$(origin O)", "command line")
9   _EXTRA_ARGS := O=$(O)
10   OUTPUT := $(O)
11 endif
12
13 CFG             = kernel-$(VERSION)
14 CFG_DIR         = $(OUTPUT)/configs
15
16 X86_64CONFIGFILES = $(CFG)-x86_64.config $(CFG)-x86_64-debug.config
17
18 X86CONFIGFILES  = $(CFG)-i686.config $(CFG)-i686-debug.config
19
20 S390CONFIGFILES = $(CFG)-s390x.config $(CFG)-s390x-debug.config \
21                    $(CFG)-s390x-kdump.config
22
23 PPCCONFIGFILES = $(CFG)-ppc64.config $(CFG)-ppc64-kdump.config \
24                   $(CFG)-ppc64-debug.config
25
26 CONFIGFILES = $(X86_64CONFIGFILES) $(X86CONFIGFILES) $(S390CONFIGFILES) \
27               $(PPCCONFIGFILES)
28
29 ARCHCONFIG =
30
31 PLATFORMS       = x86 x86_64 powerpc64 s390
32 TEMPFILES       = $(addprefix temp-, $(addsuffix -generic, $(PLATFORMS)))
33
34 configs: clean-configs $($(ARCHCONFIG)CONFIGFILES)
35         @rm -f $(TEMPFILES)
36         @rm -f temp-generic temp-*-generic temp-*-generic-tmp *-merged
37
38 # overrides updating/checking. not reason to use these unless you're updating
39 # config options requests before GA
40 OVERRIDE_PATH   = ~/redhat/rhel6/configs/;
41 pull-configs: update-configs configs-prep verify-configs
42
43 update-configs:
44         ./generate-rhel-overrides.sh $(OVERRIDE_PATH)
45
46 verify-configs:
47         ./verify_config_files.sh $(OVERRIDE_PATH)
48
49 # Augment the clean target to clean up our own cruft
50 clean ::
51         @rm -fv $(CONFIGFILES) $(TEMPFILES) temp-generic kernel-*config config-*-merged *.include temp-i686-debug-final temp-i686-final
52
53 clean-configs:
54         @rm -fv $(CONFIGFILES) $(TEMPFILES) temp-generic kernel-*config config-*-merged *.include temp-i686-debug-final temp-i686-final
55
56 configs-prep: clean configs
57         @mkdir -p $(CFG_DIR)
58         @rm -f $(CFG_DIR)/*
59         @cp $(CFG)* $(CFG_DIR)
60         @cd ../../ && \
61         for i in $(CFG_DIR)/*.config; do \
62                 mv $$i $(OUTPUT)/.config ; \
63                 Arch=$$(head -1 $(OUTPUT)/.config | cut -b 3-) ; \
64                 echo "Configuring $$i" ; \
65                 make ARCH=$$Arch nonint_oldconfig $(_EXTRA_ARGS) > /dev/null || exit 1 ; \
66                 echo "# $$Arch" > $$i ; \
67                 cat $(OUTPUT)/.config >> $$i ; \
68                 rm $(OUTPUT)/.config; \
69         done
70
71 config-%-merged:
72         @if [ -f $$(basename $@ -merged)-rhel ]; then \
73                 perl merge.pl $$(basename $@ -merged)-rhel $$(basename $@ -merged) >$@; \
74         else \
75                 cp $$(basename $@ -merged) $@; \
76         fi
77
78 temp-generic: config-generic-merged config-nodebug-merged Makefile
79         perl merge.pl config-nodebug-merged config-generic-merged > temp-generic
80
81 temp-debug-generic: config-generic-merged config-debug-merged Makefile
82         perl merge.pl config-debug-merged config-generic-merged > temp-debug-generic
83
84 temp-x86-generic: config-x86-generic-merged temp-generic
85         perl merge.pl $^  > $@
86
87 temp-x86-debug-generic: config-x86-generic-merged temp-debug-generic
88         perl merge.pl $^  > $@
89
90 temp-x86_64-generic: config-x86_64-generic-merged temp-generic
91         perl merge.pl $^  > $@
92
93 temp-x86_64-debug-generic: config-x86_64-generic-merged temp-debug-generic
94         perl merge.pl $^  > $@
95
96 temp-powerpc-generic: config-powerpc-generic-merged temp-generic
97         perl merge.pl $^  > $@
98
99 temp-powerpc-debug-generic: config-powerpc-generic-merged temp-debug-generic
100         perl merge.pl $^  > $@
101
102 temp-powerpc64-debug-generic: config-powerpc64-merged temp-powerpc-debug-generic
103         perl merge.pl $^ powerpc > $@
104
105 temp-s390x-generic: config-s390x-merged temp-generic
106         perl merge.pl $^ > $@
107
108 temp-s390x-debug-generic: config-s390x-merged temp-debug-generic
109         perl merge.pl $^  > $@
110
111 temp-i686-final: config-i686-merged temp-x86-generic
112         perl merge.pl $^ > $@
113
114 temp-i686-debug-final: config-i686-merged temp-x86-debug-generic
115         perl merge.pl $^ > $@
116
117 kernel-$(VERSION)-i686.config: config-i686-nodebug-merged temp-i686-final
118         perl merge.pl $^ i386 > $@
119
120 kernel-$(VERSION)-i686-debug.config: config-i686-debug-merged temp-i686-debug-final
121         perl merge.pl $^ i386 > $@
122
123 kernel-$(VERSION)-x86_64.config: config-x86_64-nodebug-merged temp-x86_64-generic
124         perl merge.pl $^ x86_64 > $@
125
126 kernel-$(VERSION)-x86_64-debug.config: config-x86_64-debug-merged temp-x86_64-debug-generic
127         perl merge.pl $^ x86_64 > $@
128
129 kernel-$(VERSION)-ppc64.config: config-powerpc64-merged temp-powerpc-generic
130         perl merge.pl $^ powerpc > $@
131
132 kernel-$(VERSION)-ppc64-kdump.config: config-powerpc64-kdump-merged kernel-$(VERSION)-ppc64.config
133         perl merge.pl $^ powerpc > $@
134
135 kernel-$(VERSION)-ppc64-debug.config: config-powerpc64-debug-merged temp-powerpc64-debug-generic
136         perl merge.pl $^ powerpc > $@
137
138 kernel-$(VERSION)-s390x.config: config-s390x-merged temp-s390x-generic
139         perl merge.pl $^ s390 > $@
140
141 kernel-$(VERSION)-s390x-debug.config: config-s390x-debug-merged temp-s390x-debug-generic
142         perl merge.pl $^ s390 > $@
143
144 kernel-$(VERSION)-s390x-kdump.config: config-s390x-kdump-merged kernel-$(VERSION)-s390x.config
145         perl merge.pl $^ s390 > $@
146