diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-01-27 14:10:29 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-01-27 14:10:29 -0600 |
commit | bb09f350b8beaa7c68d898131c54f52722e16522 (patch) | |
tree | 5c37e581a6bff82ddc8791e6f62c94426fbc3304 /misc/tools/kconfig-frontends/utils/merge | |
parent | 97b98200709f76e968fe73dd5a7ed0c43e4084db (diff) | |
download | nuttx-bb09f350b8beaa7c68d898131c54f52722e16522.tar.gz nuttx-bb09f350b8beaa7c68d898131c54f52722e16522.tar.bz2 nuttx-bb09f350b8beaa7c68d898131c54f52722e16522.zip |
Update kconfig-frontends to 3.12.0
Diffstat (limited to 'misc/tools/kconfig-frontends/utils/merge')
-rwxr-xr-x | misc/tools/kconfig-frontends/utils/merge | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/misc/tools/kconfig-frontends/utils/merge b/misc/tools/kconfig-frontends/utils/merge index 974d5cb7e..81b0c61bb 100755 --- a/misc/tools/kconfig-frontends/utils/merge +++ b/misc/tools/kconfig-frontends/utils/merge @@ -32,11 +32,13 @@ usage() { echo " -m only merge the fragments, do not execute the make command" echo " -n use allnoconfig instead of alldefconfig" echo " -r list redundant entries when merging fragments" + echo " -O dir to put generated output files" } MAKE=true ALLTARGET=alldefconfig WARNREDUN=false +OUTPUT=. while true; do case $1 in @@ -59,6 +61,16 @@ while true; do shift continue ;; + "-O") + if [ -d $2 ];then + OUTPUT=$(echo $2 | sed 's/\/*$//') + else + echo "output directory $2 does not exist" 1>&2 + exit 1 + fi + shift 2 + continue + ;; *) break ;; @@ -100,25 +112,33 @@ for MERGE_FILE in $MERGE_LIST ; do done if [ "$MAKE" = "false" ]; then - cp $TMP_FILE .config + cp $TMP_FILE $OUTPUT/.config echo "#" - echo "# merged configuration written to .config (needs make)" + echo "# merged configuration written to $OUTPUT/.config (needs make)" echo "#" clean_up 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 $ALLTARGET +make KCONFIG_ALLCONFIG=$TMP_FILE $OUTPUT_ARG $ALLTARGET # Check all specified config values took (might have missed-dependency issues) for CFG in $(sed -n "$SED_CONFIG_EXP" $TMP_FILE); do REQUESTED_VAL=$(grep -w -e "$CFG" $TMP_FILE) - ACTUAL_VAL=$(grep -w -e "$CFG" .config) + ACTUAL_VAL=$(grep -w -e "$CFG" $OUTPUT/.config) if [ "x$REQUESTED_VAL" != "x$ACTUAL_VAL" ] ; then echo "Value requested for $CFG not in final .config" echo "Requested value: $REQUESTED_VAL" |