Browse Source

Move example commands from "make list" to "make list_example".

Rob Landley 1 year ago
parent
commit
2bf62c7c08
3 changed files with 7 additions and 6 deletions
  1. 1 1
      Makefile
  2. 5 5
      scripts/genconfig.sh
  3. 1 0
      scripts/help.txt

+ 1 - 1
Makefile

@@ -18,7 +18,7 @@ toybox generated/unstripped/toybox: $(KCONFIG_CONFIG) *.[ch] lib/*.[ch] toys/*/*
 
 .PHONY: clean distclean baseline bloatcheck install install_flat \
 	uninstall uninstall_flat tests help change \
-	list list_working list_pending root run_root
+	list list_example list_pending root run_root
 .SUFFIXES: # Disable legacy behavior
 
 include kconfig/Makefile

+ 5 - 5
scripts/genconfig.sh

@@ -73,8 +73,7 @@ toys()
     $SED -En 's/([^:]*):.*(OLD|NEW)TOY\( *([a-zA-Z][^,]*) *,.*/\1:\3/p'
 }
 
-WORKING=
-PENDING=
+WORKING= PENDING= EXAMPLE=
 toys toys/*/*.c | (
 while IFS=":" read FILE NAME
 do
@@ -83,12 +82,13 @@ do
   [ "$NAME" == sh ] && FILE="toys/*/*.c"
   echo -e "$NAME: $FILE *.[ch] lib/*.[ch]\n\tscripts/single.sh $NAME\n"
   echo -e "test_$NAME:\n\tscripts/test.sh $NAME\n"
-  [ "${FILE/pending//}" != "$FILE" ] &&
-    PENDING="$PENDING $NAME" ||
+  [ "${FILE/example//}" != "$FILE" ] && EXAMPLE="$EXAMPLE $NAME" ||
+  [ "${FILE/pending//}" != "$FILE" ] && PENDING="$PENDING $NAME" ||
     WORKING="$WORKING $NAME"
 done &&
 echo -e "clean::\n\t@rm -f $WORKING $PENDING" &&
 echo -e "list:\n\t@echo $(echo $WORKING | tr ' ' '\n' | sort | xargs)" &&
-echo -e "list_pending:\n\t@echo $(echo $PENDING | tr ' ' '\n' | sort | xargs)" &&
+echo -e "list_example:\n\t@echo $(echo $EXAMPLE | tr ' ' '\n' | sort | xargs)"&&
+echo -e "list_pending:\n\t@echo $(echo $PENDING | tr ' ' '\n' | sort | xargs)"&&
 echo -e ".PHONY: $WORKING $PENDING" | $SED 's/ \([^ ]\)/ test_\1/g'
 ) > .singlemake

+ 1 - 0
scripts/help.txt

@@ -1,6 +1,7 @@
   toybox          - Build toybox.
   COMMANDNAME     - Build individual toybox command as a standalone binary.
   list            - List COMMANDNAMEs you can build standalone.
+  list_example    - List example commands (often used by the test suite)
   list_pending    - List unfinished COMMANDNAMEs out of toys/pending.
   change          - Build each command standalone under change/.
   baseline        - Create toybox_old for use by bloatcheck.