aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/Kbuild.include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-12-28 18:13:48 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2008-12-28 18:13:48 -0500
commit96faec945f39cab38403f60f515bff43660b4dab (patch)
treee6681330a42303bb34be80d347cd01ff79f5b80a /scripts/Kbuild.include
parent2926328554fa740518e2a6585b2cefb01e5f65f3 (diff)
parent9bb482476c6c9d1ae033306440c51ceac93ea80c (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-next
* git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-next: (25 commits) allow stripping of generated symbols under CONFIG_KALLSYMS_ALL kbuild: strip generated symbols from *.ko kbuild: simplify use of genksyms kernel-doc: check for extra kernel-doc notations kbuild: add headerdep used to detect inclusion cycles in header files kbuild: fix string equality testing in tags.sh kbuild: fix make tags/cscope kbuild: fix make incompatibility kbuild: remove TAR_IGNORE setlocalversion: add git-svn support setlocalversion: print correct subversion revision scripts: improve the decodecode script scripts/package: allow custom options to rpm genksyms: allow to ignore symbol checksum changes genksyms: track symbol checksum changes tags and cscope support really belongs in a shell script kconfig: fix options to check-lxdialog.sh kbuild: gen_init_cpio expands shell variables in file names remove bashisms from scripts/extract-ikconfig kbuild: teach mkmakfile to be silent ...
Diffstat (limited to 'scripts/Kbuild.include')
-rw-r--r--scripts/Kbuild.include22
1 files changed, 12 insertions, 10 deletions
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index 982dcae7bbe2..c29be8f90248 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -25,6 +25,13 @@ basetarget = $(basename $(notdir $@))
25escsq = $(subst $(squote),'\$(squote)',$1) 25escsq = $(subst $(squote),'\$(squote)',$1)
26 26
27### 27###
28# Easy method for doing a status message
29 kecho := :
30 quiet_kecho := echo
31silent_kecho := :
32kecho := $($(quiet)kecho)
33
34###
28# filechk is used to check if the content of a generated file is updated. 35# filechk is used to check if the content of a generated file is updated.
29# Sample usage: 36# Sample usage:
30# define filechk_sample 37# define filechk_sample
@@ -39,22 +46,15 @@ escsq = $(subst $(squote),'\$(squote)',$1)
39# - If they are equal no change, and no timestamp update 46# - If they are equal no change, and no timestamp update
40# - stdin is piped in from the first prerequisite ($<) so one has 47# - stdin is piped in from the first prerequisite ($<) so one has
41# to specify a valid file as first prerequisite (often the kbuild file) 48# to specify a valid file as first prerequisite (often the kbuild file)
42 chk_filechk = :
43 quiet_chk_filechk = echo ' CHK $@'
44silent_chk_filechk = :
45 upd_filechk = :
46 quiet_upd_filechk = echo ' UPD $@'
47silent_upd_filechk = :
48
49define filechk 49define filechk
50 $(Q)set -e; \ 50 $(Q)set -e; \
51 $($(quiet)chk_filechk); \ 51 $(kecho) ' CHK $@'; \
52 mkdir -p $(dir $@); \ 52 mkdir -p $(dir $@); \
53 $(filechk_$(1)) < $< > $@.tmp; \ 53 $(filechk_$(1)) < $< > $@.tmp; \
54 if [ -r $@ ] && cmp -s $@ $@.tmp; then \ 54 if [ -r $@ ] && cmp -s $@ $@.tmp; then \
55 rm -f $@.tmp; \ 55 rm -f $@.tmp; \
56 else \ 56 else \
57 $($(quiet)upd_filechk); \ 57 $(kecho) ' UPD $@'; \
58 mv -f $@.tmp $@; \ 58 mv -f $@.tmp $@; \
59 fi 59 fi
60endef 60endef
@@ -144,7 +144,9 @@ ld-option = $(call try-run,\
144build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj 144build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj
145 145
146# Prefix -I with $(srctree) if it is not an absolute path. 146# Prefix -I with $(srctree) if it is not an absolute path.
147addtree = $(if $(filter-out -I/%,$(1)),$(patsubst -I%,-I$(srctree)/%,$(1))) $(1) 147# skip if -I has no parameter
148addtree = $(if $(patsubst -I%,%,$(1)), \
149$(if $(filter-out -I/%,$(1)),$(patsubst -I%,-I$(srctree)/%,$(1))) $(1))
148 150
149# Find all -I options and call addtree 151# Find all -I options and call addtree
150flags = $(foreach o,$($(1)),$(if $(filter -I%,$(o)),$(call addtree,$(o)),$(o))) 152flags = $(foreach o,$($(1)),$(if $(filter -I%,$(o)),$(call addtree,$(o)),$(o)))