aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/Makefile.build
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/Makefile.build')
-rw-r--r--scripts/Makefile.build45
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 :=
22EXTRA_CFLAGS := 22EXTRA_CFLAGS :=
23EXTRA_CPPFLAGS := 23EXTRA_CPPFLAGS :=
24EXTRA_LDFLAGS := 24EXTRA_LDFLAGS :=
25asflags-y :=
26ccflags-y :=
27cppflags-y :=
28ldflags-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
29include scripts/Kbuild.include 33include scripts/Kbuild.include
30 34
35# For backward compatibility check that these variables does not change
36save-cflags := $(CFLAGS)
37
31# The filename Kbuild has precedence over Makefile 38# The filename Kbuild has precedence over Makefile
32kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src)) 39kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src))
33include $(if $(wildcard $(kbuild-dir)/Kbuild), $(kbuild-dir)/Kbuild, $(kbuild-dir)/Makefile) 40kbuild-file := $(if $(wildcard $(kbuild-dir)/Kbuild),$(kbuild-dir)/Kbuild,$(kbuild-dir)/Makefile)
34 41include $(kbuild-file)
42
43# If the save-* variables changed error out
44ifeq ($(KBUILD_NOPEDANTIC),)
45 ifneq ("$(save-cflags)","$(CFLAGS)")
46 $(error CFLAGS was changed in "$(kbuild-file)". Fix it to use EXTRA_CFLAGS)
47 endif
48endif
35include scripts/Makefile.lib 49include scripts/Makefile.lib
36 50
37ifdef host-progs 51ifdef 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)))
56endif 70endif
57 71
58
59ifdef EXTRA_TARGETS
60$(warning kbuild: $(obj)/Makefile - Usage of EXTRA_TARGETS is obsolete in 2.6. Please fix!)
61endif
62
63ifdef build-targets
64$(warning kbuild: $(obj)/Makefile - Usage of build-targets is obsolete in 2.6. Please fix!)
65endif
66
67ifdef export-objs
68$(warning kbuild: $(obj)/Makefile - Usage of export-objs is obsolete in 2.6. Please fix!)
69endif
70
71ifdef O_TARGET
72$(warning kbuild: $(obj)/Makefile - Usage of O_TARGET := $(O_TARGET) is obsolete in 2.6. Please fix!)
73endif
74
75ifdef L_TARGET
76$(error kbuild: $(obj)/Makefile - Use of L_TARGET is replaced by lib-y in 2.6. Please fix!)
77endif
78
79ifdef list-multi
80$(warning kbuild: $(obj)/Makefile - list-multi := $(list-multi) is obsolete in 2.6. Please fix!)
81endif
82
83ifndef obj 72ifndef obj
84$(warning kbuild: Makefile.build is included improperly) 73$(warning kbuild: Makefile.build is included improperly)
85endif 74endif
@@ -291,7 +280,7 @@ endif # builtin-target
291# 280#
292ifdef lib-target 281ifdef lib-target
293quiet_cmd_link_l_target = AR $@ 282quiet_cmd_link_l_target = AR $@
294cmd_link_l_target = rm -f $@; $(AR) $(EXTRA_ARFLAGS) rcs $@ $(lib-y) 283cmd_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)