aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2016-02-07 18:15:53 -0600
committerRob Landley <rob@landley.net>2016-02-07 18:15:53 -0600
commit712e43ef7c92e8903e6f9d7ca261a420c566d299 (patch)
tree2ead7dae55d167de00e28e20024dce9e5f7c5d1c /scripts
parent3679024969b9b71c1d53a1d76f1aeb9593404490 (diff)
downloadtoybox-712e43ef7c92e8903e6f9d7ca261a420c566d299.tar.gz
Add "make ls" and friends targets, with "make working" and "make pending" lists.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/genconfig.sh26
-rwxr-xr-xscripts/make.sh2
2 files changed, 27 insertions, 1 deletions
diff --git a/scripts/genconfig.sh b/scripts/genconfig.sh
index ce8c0266..7b34f085 100755
--- a/scripts/genconfig.sh
+++ b/scripts/genconfig.sh
@@ -119,3 +119,29 @@ genconfig()
probeconfig > generated/Config.probed || rm generated/Config.probed
genconfig > generated/Config.in || rm generated/Config.in
+
+# Find names of commands that can be built standalone in these C files
+toys()
+{
+ grep 'TOY(.*)' "$@" | grep -v TOYFLAG_NOFORK | \
+ sed -rn 's/([^:]*):.*(OLD|NEW)TOY\( *([a-zA-Z][^,]*) *,.*/\1:\3/p'
+}
+
+WORKING=
+PENDING=
+toys toys/*/*.c | (
+while IFS=":" read FILE NAME
+do
+ [ "$NAME" == help ] && continue
+ [ "$NAME" == install ] && continue
+ echo -e "$NAME:\n\tscripts/single.sh $NAME\n"
+ [ "${FILE/pending//}" != "$FILE" ] &&
+ PENDING="$PENDING $NAME" ||
+ WORKING="$WORKING $NAME"
+done > .singlemake &&
+echo -e "clean::\n\trm -f $WORKING $PENDING" >> .singlemake &&
+echo -e "working:\n\t@echo $(echo $WORKING | tr ' ' '\n' | sort | xargs)" \
+ >> .singlemake &&
+echo -e "pending:\n\t@echo $(echo $PENDING | tr ' ' '\n' | sort | xargs)" \
+ >> .singlemake
+)
diff --git a/scripts/make.sh b/scripts/make.sh
index 9fbf086a..84dda343 100755
--- a/scripts/make.sh
+++ b/scripts/make.sh
@@ -66,7 +66,7 @@ CFLAGS="$CFLAGS $(cat generated/cflags)"
BUILD="$(echo ${CROSS_COMPILE}${CC} $CFLAGS -I . $OPTIMIZE $GITHASH)"
FILES="$(echo lib/*.c main.c $TOYFILES)"
-if [ "${FILES/pending//}" != "$FILES" ]
+if [ "${TOYFILES/pending//}" != "$TOYFILES" ]
then
echo -e "\n\033[1;31mwarning: using unfinished code from toys/pending\033[0m"
fi