X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=scripts%2FKbuild.include;h=d64e6badc9427ed9d6c8a2d47652d5ecab693293;hb=c0f005888c6663898a040cd922947dd8caa55160;hp=de7bb284c6116d8ea3997ae224a25e3081aaf619;hpb=2843483d2eb02ad104edbe8b2429fb6a39d25063;p=linux-2.6-omap-h63xx.git diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index de7bb284c61..d64e6badc94 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include @@ -39,15 +39,22 @@ escsq = $(subst $(squote),'\$(squote)',$1) # - If they are equal no change, and no timestamp update # - stdin is piped in from the first prerequisite ($<) so one has # to specify a valid file as first prerequisite (often the kbuild file) + chk_filechk = : + quiet_chk_filechk = echo ' CHK $@' +silent_chk_filechk = : + upd_filechk = : + quiet_upd_filechk = echo ' UPD $@' +silent_upd_filechk = : + define filechk $(Q)set -e; \ - echo ' CHK $@'; \ + $($(quiet)chk_filechk); \ mkdir -p $(dir $@); \ $(filechk_$(1)) < $< > $@.tmp; \ if [ -r $@ ] && cmp -s $@ $@.tmp; then \ rm -f $@.tmp; \ else \ - echo ' UPD $@'; \ + $($(quiet)upd_filechk); \ mv -f $@.tmp $@; \ fi endef @@ -56,6 +63,17 @@ endef # gcc support functions # See documentation in Documentation/kbuild/makefiles.txt +# cc-cross-prefix +# Usage: CROSS_COMPILE := $(call cc-cross-prefix, m68k-linux-gnu- m68k-linux-) +# Return first prefix where a prefix$(CC) is found in PATH. +# If no $(CC) found in PATH with listed prefixes return nothing +cc-cross-prefix = \ + $(word 1, $(foreach c,$(1), \ + $(shell set -e; \ + if (which $(strip $(c))$(CC)) > /dev/null 2>&1 ; then \ + echo $(c); \ + fi))) + # output directory for tests below TMPOUT := $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/)