aboutsummaryrefslogtreecommitdiff
path: root/scripts/make.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/make.sh')
-rwxr-xr-xscripts/make.sh30
1 files changed, 11 insertions, 19 deletions
diff --git a/scripts/make.sh b/scripts/make.sh
index e4f0b35e..9fdadc47 100755
--- a/scripts/make.sh
+++ b/scripts/make.sh
@@ -13,6 +13,13 @@ then
exit 1
fi
+# Respond to V= by echoing command lines as well as running them
+do_loudly()
+{
+ [ ! -z "$V" ] && echo "$@"
+ "$@"
+}
+
echo "Make generated/config.h from $KCONFIG_CONFIG."
# This long and roundabout sed invocation is to make old versions of sed happy.
@@ -59,10 +66,7 @@ sed -n -e 's/^USE_[A-Z0-9_]*(/&/p' toys/*/*.c \
sed -n -e 's/.*(NEWTOY(\([^,]*\), *\(\("[^"]*"[^,]*\)*\),.*/#define OPTSTR_\1\t\2/p' \
generated/newtoys.h > generated/oldtoys.h
-if [ ! -e generated/mkflags ]
-then
- $HOSTCC scripts/mkflags.c -o generated/mkflags || exit 1
-fi
+do_loudly $HOSTCC scripts/mkflags.c -o generated/mkflags || exit 1
echo -n "generated/flags.h "
@@ -125,21 +129,9 @@ GLOBSTRUCT="$(getglobals)"
) > generated/globals.h
echo "generated/help.h"
-# Only recreate generated/help.h if python2 is installed. Does not work with 3.
-[ -z "$(python --version 2>&1 | grep 'Python 2')" ] &&
- PYTHON="$(which python2 || which python2.6 || which python2.7)" ||
- PYTHON=python
-if [ ! -z "$(grep 'CONFIG_TOYBOX_HELP=y' $KCONFIG_CONFIG)" ];
-then
- if [ -z "$PYTHON" ];
- then
- echo "Python 2.x required to rebuild generated/help.h"
- # exit 1
- else
- echo "Extract help text from Config.in."
- "$PYTHON" scripts/config2help.py Config.in > generated/help.h || exit 1
- fi
-fi
+do_loudly $HOSTCC scripts/config2help.c -I . lib/xwrap.c lib/llist.c lib/lib.c \
+ -o generated/config2help && \
+generated/config2help Config.in .config > generated/help.h || exit 1
# Extract a list of toys/*/*.c files to compile from the data in $KCONFIG_CONFIG