Mercurial > hg > toybox
diff scripts/make.sh @ 234:163498bf547b
Move NEWTOY() list from end of toylist.h to generated/newtoys.h.
author | Rob Landley <rob@landley.net> |
---|---|
date | Sat, 19 Jan 2008 17:43:27 -0600 |
parents | d4176f3f3835 |
children | 7cb15eae1664 |
line wrap: on
line diff
--- a/scripts/make.sh Sat Jan 19 17:08:39 2008 -0600 +++ b/scripts/make.sh Sat Jan 19 17:43:27 2008 -0600 @@ -7,6 +7,21 @@ 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