diff options
author | Sam Ravnborg <sam@neptun.(none)> | 2007-10-19 15:46:01 -0400 |
---|---|---|
committer | Sam Ravnborg <sam@neptun.(none)> | 2007-10-19 15:46:01 -0400 |
commit | 910b40468a9ce3f2f5d48c5d260329c27d45adb5 (patch) | |
tree | 7c6957b94da9c9358839cde3f1ed6c827aac63a7 /scripts | |
parent | 50a8ec31c3a00594ceb7c5f1dcf2ecdaf6a5b847 (diff) |
kbuild: introduce cc-cross-prefix
cc-cross-prefix is useful for the architecture that like
to provide a default CROSS_COMPILE value,
but may have several to select between.
Sample usage:
ifneq ($(SUBARCH),$(ARCH))
ifeq ($(CROSS_COMPILE),)
CROSS_COMPILE := $(call cc-cross-prefix, m68k-linux-gnu- m68k-linux-)
endif
endif
Actual usage by the different archs will taken care of later.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/Kbuild.include | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index de7bb284c611..b96ea8d6a5ed 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include | |||
@@ -56,6 +56,17 @@ endef | |||
56 | # gcc support functions | 56 | # gcc support functions |
57 | # See documentation in Documentation/kbuild/makefiles.txt | 57 | # See documentation in Documentation/kbuild/makefiles.txt |
58 | 58 | ||
59 | # cc-cross-prefix | ||
60 | # Usage: CROSS_COMPILE := $(call cc-cross-prefix, m68k-linux-gnu- m68k-linux-) | ||
61 | # Return first prefix where a prefix$(CC) is found in PATH. | ||
62 | # If no $(CC) found in PATH with listed prefixes return nothing | ||
63 | cc-cross-prefix = \ | ||
64 | $(word 1, $(foreach c,$(1), \ | ||
65 | $(shell set -e; \ | ||
66 | if (which $(strip $(c))$(CC)) > /dev/null 2>&1 ; then \ | ||
67 | echo $(c); \ | ||
68 | fi))) | ||
69 | |||
59 | # output directory for tests below | 70 | # output directory for tests below |
60 | TMPOUT := $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/) | 71 | TMPOUT := $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/) |
61 | 72 | ||