aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Konovalov <andrey.konovalov@linaro.org>2013-04-15 23:11:42 +0400
committerAndrey Konovalov <andrey.konovalov@linaro.org>2013-04-15 23:11:42 +0400
commit8ca8004618e773bb846afa3b392b8e3b3c3076da (patch)
treeedef7a790a45833ca9a52aa78c385aa29a20c346
parent97cc7927de1da8e8f9a3799ae46a829ec968ce25 (diff)
parent147b85bed8bf93f67c069d00099d1fbc1d63097e (diff)
Merge branch 'tracking-llct-v3.9-misc-fixes' into merge-linux-linaro-core-trackingllct-20130415.0
-rw-r--r--scripts/Kbuild.include6
-rw-r--r--scripts/Makefile.build6
-rw-r--r--scripts/kconfig/Makefile30
-rwxr-xr-xscripts/kconfig/merge_config.sh10
-rw-r--r--scripts/mod/Makefile10
5 files changed, 45 insertions, 17 deletions
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index 978416dd31ca..5ecac2ae6fd3 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -222,11 +222,15 @@ if_changed = $(if $(strip $(any-prereq) $(arg-check)), \
$(echo-cmd) $(cmd_$(1)); \
echo 'cmd_$@ := $(make-cmd)' > $(dot-target).cmd)
+ifeq ($(KBUILD_SCRIPTROOT),)
+KBUILD_SCRIPTROOT=.
+endif
+
# Execute the command and also postprocess generated .d dependencies file.
if_changed_dep = $(if $(strip $(any-prereq) $(arg-check) ), \
@set -e; \
$(echo-cmd) $(cmd_$(1)); \
- scripts/basic/fixdep $(depfile) $@ '$(make-cmd)' > $(dot-target).tmp;\
+ $(KBUILD_SCRIPTROOT)/scripts/basic/fixdep $(depfile) $@ '$(make-cmd)' > $(dot-target).tmp;\
rm -f $(depfile); \
mv -f $(dot-target).tmp $(dot-target).cmd)
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 0e801c3cdaf8..641a7bbdaad9 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -290,13 +290,17 @@ cmd_record_mcount = \
fi;
endif
+ifeq ($(KBUILD_SCRIPTROOT),)
+KBUILD_SCRIPTROOT=.
+endif
+
define rule_cc_o_c
$(call echo-cmd,checksrc) $(cmd_checksrc) \
$(call echo-cmd,cc_o_c) $(cmd_cc_o_c); \
$(cmd_modversions) \
$(call echo-cmd,record_mcount) \
$(cmd_record_mcount) \
- scripts/basic/fixdep $(depfile) $@ '$(call make-cmd,cc_o_c)' > \
+ $(KBUILD_SCRIPTROOT)/scripts/basic/fixdep $(depfile) $@ '$(call make-cmd,cc_o_c)' > \
$(dot-target).tmp; \
rm -f $(depfile); \
mv -f $(dot-target).tmp $(dot-target).cmd
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index 231b4759c714..ea29352e16b8 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -14,6 +14,12 @@ endif
# We need this, in case the user has it in its environment
unexport CONFIG_
+ifdef KBUILD_SCRIPTROOT
+CONF = $(KBUILD_SCRIPTROOT)/scripts/kconfig/conf
+else
+CONF = $(obj)/conf
+endif
+
xconfig: $(obj)/qconf
$< $(Kconfig)
@@ -23,31 +29,31 @@ gconfig: $(obj)/gconf
menuconfig: $(obj)/mconf
$< $(Kconfig)
-config: $(obj)/conf
+config: $(CONF)
$< --oldaskconfig $(Kconfig)
nconfig: $(obj)/nconf
$< $(Kconfig)
-oldconfig: $(obj)/conf
+oldconfig: $(CONF)
$< --$@ $(Kconfig)
-silentoldconfig: $(obj)/conf
+silentoldconfig: $(CONF)
$(Q)mkdir -p include/generated
$< --$@ $(Kconfig)
-localyesconfig localmodconfig: $(obj)/streamline_config.pl $(obj)/conf
+localyesconfig localmodconfig: $(obj)/streamline_config.pl $(CONF)
$(Q)mkdir -p include/generated
$(Q)perl $< --$@ $(srctree) $(Kconfig) > .tmp.config
$(Q)if [ -f .config ]; then \
cmp -s .tmp.config .config || \
(mv -f .config .config.old.1; \
mv -f .tmp.config .config; \
- $(obj)/conf --silentoldconfig $(Kconfig); \
+ $(CONF) --silentoldconfig $(Kconfig); \
mv -f .config.old.1 .config.old) \
else \
mv -f .tmp.config .config; \
- $(obj)/conf --silentoldconfig $(Kconfig); \
+ $(CONF) --silentoldconfig $(Kconfig); \
fi
$(Q)rm -f .tmp.config
@@ -76,24 +82,24 @@ update-po-config: $(obj)/kxgettext $(obj)/gconf.glade.h
PHONY += allnoconfig allyesconfig allmodconfig alldefconfig randconfig
-allnoconfig allyesconfig allmodconfig alldefconfig randconfig: $(obj)/conf
+allnoconfig allyesconfig allmodconfig alldefconfig randconfig: $(CONF)
$< --$@ $(Kconfig)
PHONY += listnewconfig olddefconfig oldnoconfig savedefconfig defconfig
-listnewconfig olddefconfig: $(obj)/conf
+listnewconfig olddefconfig: $(CONF)
$< --$@ $(Kconfig)
# oldnoconfig is an alias of olddefconfig, because people already are dependent
# on its behavior(sets new symbols to their default value but not 'n') with the
# counter-intuitive name.
-oldnoconfig: $(obj)/conf
+oldnoconfig: $(CONF)
$< --olddefconfig $(Kconfig)
-savedefconfig: $(obj)/conf
+savedefconfig: $(CONF)
$< --$@=defconfig $(Kconfig)
-defconfig: $(obj)/conf
+defconfig: $(CONF)
ifeq ($(KBUILD_DEFCONFIG),)
$< --defconfig $(Kconfig)
else
@@ -101,7 +107,7 @@ else
$(Q)$< --defconfig=arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG) $(Kconfig)
endif
-%_defconfig: $(obj)/conf
+%_defconfig: $(CONF)
$(Q)$< --defconfig=arch/$(SRCARCH)/configs/$@ $(Kconfig)
# Help text used by make help
diff --git a/scripts/kconfig/merge_config.sh b/scripts/kconfig/merge_config.sh
index 05274fccb88e..81b0c61bb9e2 100755
--- a/scripts/kconfig/merge_config.sh
+++ b/scripts/kconfig/merge_config.sh
@@ -120,10 +120,18 @@ if [ "$MAKE" = "false" ]; then
exit
fi
+# If we have an output dir, setup the O= argument, otherwise leave
+# it blank, since O=. will create an unnecessary ./source softlink
+OUTPUT_ARG=""
+if [ "$OUTPUT" != "." ] ; then
+ OUTPUT_ARG="O=$OUTPUT"
+fi
+
+
# Use the merged file as the starting point for:
# alldefconfig: Fills in any missing symbols with Kconfig default
# allnoconfig: Fills in any missing symbols with # CONFIG_* is not set
-make KCONFIG_ALLCONFIG=$TMP_FILE O=$OUTPUT $ALLTARGET
+make KCONFIG_ALLCONFIG=$TMP_FILE $OUTPUT_ARG $ALLTARGET
# Check all specified config values took (might have missed-dependency issues)
diff --git a/scripts/mod/Makefile b/scripts/mod/Makefile
index 9415b5663364..01e783fb93d9 100644
--- a/scripts/mod/Makefile
+++ b/scripts/mod/Makefile
@@ -1,6 +1,12 @@
hostprogs-y := modpost mk_elfconfig
always := $(hostprogs-y) empty.o
+ifdef KBUILD_SCRIPTROOT
+MKELFCONFIG = $(KBUILD_SCRIPTROOT)/scripts/mod/mk_elfconfig
+else
+MKELFCONFIG = $(obj)/mk_elfconfig
+endif
+
modpost-objs := modpost.o file2alias.o sumversion.o
devicetable-offsets-file := devicetable-offsets.h
@@ -43,9 +49,9 @@ $(obj)/modpost.o $(obj)/file2alias.o $(obj)/sumversion.o: $(obj)/elfconfig.h
$(obj)/file2alias.o: $(obj)/$(devicetable-offsets-file)
quiet_cmd_elfconfig = MKELF $@
- cmd_elfconfig = $(obj)/mk_elfconfig < $< > $@
+ cmd_elfconfig = $(MKELFCONFIG) < $< > $@
-$(obj)/elfconfig.h: $(obj)/empty.o $(obj)/mk_elfconfig FORCE
+$(obj)/elfconfig.h: $(obj)/empty.o $(MKELFCONFIG) FORCE
$(call if_changed,elfconfig)
targets += elfconfig.h