diff options
Diffstat (limited to 'scripts/Makefile.build')
-rw-r--r-- | scripts/Makefile.build | 45 |
1 files changed, 17 insertions, 28 deletions
diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 7fd6055bedfd..de9836eee8bb 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build | |||
@@ -22,16 +22,30 @@ EXTRA_AFLAGS := | |||
22 | EXTRA_CFLAGS := | 22 | EXTRA_CFLAGS := |
23 | EXTRA_CPPFLAGS := | 23 | EXTRA_CPPFLAGS := |
24 | EXTRA_LDFLAGS := | 24 | EXTRA_LDFLAGS := |
25 | asflags-y := | ||
26 | ccflags-y := | ||
27 | cppflags-y := | ||
28 | ldflags-y := | ||
25 | 29 | ||
26 | # Read .config if it exist, otherwise ignore | 30 | # Read .config if it exist, otherwise ignore |
27 | -include include/config/auto.conf | 31 | -include include/config/auto.conf |
28 | 32 | ||
29 | include scripts/Kbuild.include | 33 | include scripts/Kbuild.include |
30 | 34 | ||
35 | # For backward compatibility check that these variables does not change | ||
36 | save-cflags := $(CFLAGS) | ||
37 | |||
31 | # The filename Kbuild has precedence over Makefile | 38 | # The filename Kbuild has precedence over Makefile |
32 | kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src)) | 39 | kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src)) |
33 | include $(if $(wildcard $(kbuild-dir)/Kbuild), $(kbuild-dir)/Kbuild, $(kbuild-dir)/Makefile) | 40 | kbuild-file := $(if $(wildcard $(kbuild-dir)/Kbuild),$(kbuild-dir)/Kbuild,$(kbuild-dir)/Makefile) |
34 | 41 | include $(kbuild-file) | |
42 | |||
43 | # If the save-* variables changed error out | ||
44 | ifeq ($(KBUILD_NOPEDANTIC),) | ||
45 | ifneq ("$(save-cflags)","$(CFLAGS)") | ||
46 | $(error CFLAGS was changed in "$(kbuild-file)". Fix it to use EXTRA_CFLAGS) | ||
47 | endif | ||
48 | endif | ||
35 | include scripts/Makefile.lib | 49 | include scripts/Makefile.lib |
36 | 50 | ||
37 | ifdef host-progs | 51 | ifdef host-progs |
@@ -55,31 +69,6 @@ _dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj)) | |||
55 | _dummy := $(foreach d,$(obj-dirs), $(shell [ -d $(d) ] || mkdir -p $(d))) | 69 | _dummy := $(foreach d,$(obj-dirs), $(shell [ -d $(d) ] || mkdir -p $(d))) |
56 | endif | 70 | endif |
57 | 71 | ||
58 | |||
59 | ifdef EXTRA_TARGETS | ||
60 | $(warning kbuild: $(obj)/Makefile - Usage of EXTRA_TARGETS is obsolete in 2.6. Please fix!) | ||
61 | endif | ||
62 | |||
63 | ifdef build-targets | ||
64 | $(warning kbuild: $(obj)/Makefile - Usage of build-targets is obsolete in 2.6. Please fix!) | ||
65 | endif | ||
66 | |||
67 | ifdef export-objs | ||
68 | $(warning kbuild: $(obj)/Makefile - Usage of export-objs is obsolete in 2.6. Please fix!) | ||
69 | endif | ||
70 | |||
71 | ifdef O_TARGET | ||
72 | $(warning kbuild: $(obj)/Makefile - Usage of O_TARGET := $(O_TARGET) is obsolete in 2.6. Please fix!) | ||
73 | endif | ||
74 | |||
75 | ifdef L_TARGET | ||
76 | $(error kbuild: $(obj)/Makefile - Use of L_TARGET is replaced by lib-y in 2.6. Please fix!) | ||
77 | endif | ||
78 | |||
79 | ifdef list-multi | ||
80 | $(warning kbuild: $(obj)/Makefile - list-multi := $(list-multi) is obsolete in 2.6. Please fix!) | ||
81 | endif | ||
82 | |||
83 | ifndef obj | 72 | ifndef obj |
84 | $(warning kbuild: Makefile.build is included improperly) | 73 | $(warning kbuild: Makefile.build is included improperly) |
85 | endif | 74 | endif |
@@ -291,7 +280,7 @@ endif # builtin-target | |||
291 | # | 280 | # |
292 | ifdef lib-target | 281 | ifdef lib-target |
293 | quiet_cmd_link_l_target = AR $@ | 282 | quiet_cmd_link_l_target = AR $@ |
294 | cmd_link_l_target = rm -f $@; $(AR) $(EXTRA_ARFLAGS) rcs $@ $(lib-y) | 283 | cmd_link_l_target = rm -f $@; $(AR) rcs $@ $(lib-y) |
295 | 284 | ||
296 | $(lib-target): $(lib-y) FORCE | 285 | $(lib-target): $(lib-y) FORCE |
297 | $(call if_changed,link_l_target) | 286 | $(call if_changed,link_l_target) |