aboutsummaryrefslogtreecommitdiff
path: root/scripts/make.sh
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2008-01-19 17:43:27 -0600
committerRob Landley <rob@landley.net>2008-01-19 17:43:27 -0600
commit55928b1e0a08d84a5cbc50020f0a8c1024f5b6ce (patch)
tree22a4175b86fc92f3ac5745f658dcb4f4f339fcec /scripts/make.sh
parent2896480c4918f2accccb8301bec457a7bff7377e (diff)
downloadtoybox-55928b1e0a08d84a5cbc50020f0a8c1024f5b6ce.tar.gz
Move NEWTOY() list from end of toylist.h to generated/newtoys.h.
Diffstat (limited to 'scripts/make.sh')
-rwxr-xr-xscripts/make.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/scripts/make.sh b/scripts/make.sh
index 6cdd01a8..b5300d38 100755
--- a/scripts/make.sh
+++ b/scripts/make.sh
@@ -7,6 +7,21 @@ source ./configure
echo "Extract configuration information from toys/*.c files."
scripts/genconfig.sh
+# Create a list of all the applets toybox can provide. Note that the first
+# entry is out of order on purpose (the toybox multiplexer applet must be the
+# first element of the array). The rest must be sorted in alphabetical order
+# for fast binary search.
+
+function newtoys()
+{
+ for i in toys/*.c
+ do
+ sed -n -e '1,/^config [A-Z]/s/^USE_/&/p' $i || exit 1
+ done
+}
+echo "NEWTOY(toybox, NULL, 0)" > generated/newtoys.h
+newtoys | sort >> generated/newtoys.h
+
# Only recreate generated/help.h if python is installed
if [ ! -z "$(which python)" ] && [ ! -z "$(grep 'CONFIG_HELP=y' .config)" ]
then