2 # Copyright 2006 Rob Landley <rob@landley.net>
4 # If people set these on the make command line, use 'em
5 # Note that CC defaults to "cc" so the one in configure doesn't get
6 # used when scripts/make.sh and care called through "make".
10 export CROSS_COMPILE CFLAGS OPTIMIZE LDOPTIMIZE CC HOSTCC V
14 KCONFIG_CONFIG ?= .config
16 toybox_stuff: $(KCONFIG_CONFIG) *.[ch] lib/*.[ch] toys/*.h toys/*/*.c scripts/*.sh
18 toybox generated/unstripped/toybox: toybox_stuff
21 .PHONY: clean distclean baseline bloatcheck install install_flat \
22 uinstall uninstall_flat tests help toybox_stuff change \
23 list list_working list_pending
25 include kconfig/Makefile
28 $(KCONFIG_CONFIG): $(KCONFIG_TOP)
29 $(KCONFIG_TOP): generated/Config.in
30 generated/Config.in: toys/*/*.c scripts/genconfig.sh
34 baseline: generated/unstripped/toybox
35 @cp generated/unstripped/toybox generated/unstripped/toybox_old
37 bloatcheck: toybox_old generated/unstripped/toybox
38 @scripts/bloatcheck generated/unstripped/toybox_old generated/unstripped/toybox
41 scripts/install.sh --symlink --force
44 scripts/install.sh --symlink --force --airlock
47 scripts/install.sh --long --symlink --force
50 scripts/install.sh --uninstall
53 scripts/install.sh --long --uninstall
59 rm -rf toybox generated change .singleconfig*
61 # If singlemake was in generated/ "make clean; make test_ls" wouldn't work.
63 rm -f toybox_old .config* .singlemake
69 @echo ' toybox - Build toybox.'
70 @echo ' COMMANDNAME - Build individual toybox command as a standalone binary.'
71 @echo ' list - List COMMANDNAMEs you can build standalone.'
72 @echo ' list_pending - List unfinished COMMANDNAMEs out of toys/pending.'
73 @echo ' change - Build each command standalone under change/.'
74 @echo ' baseline - Create toybox_old for use by bloatcheck.'
75 @echo ' bloatcheck - Report size differences between old and current versions'
76 @echo ' test_COMMAND - Run tests for COMMAND (test_ps, test_cat, etc.)'
77 @echo ' tests - Run test suite against all compiled commands.'
78 @echo ' export TEST_HOST=1 to test host command, VERBOSE=1'
79 @echo ' to show diff, VERBOSE=fail to stop after first failure.'
80 @echo ' clean - Delete temporary files.'
81 @echo " distclean - Delete everything that isn't shipped."
82 @echo ' install_airlock - Install toybox and host toolchain into $$PREFIX directory'
83 @echo ' (providing $$PATH for hermetic builds).'
84 @echo ' install_flat - Install toybox into $$PREFIX directory.'
85 @echo ' install - Install toybox into subdirectories of $$PREFIX.'
86 @echo ' uninstall_flat - Remove toybox from $$PREFIX directory.'
87 @echo ' uninstall - Remove toybox from subdirectories of $$PREFIX.'
89 @echo 'example: CFLAGS="--static" CROSS_COMPILE=armv5l- make defconfig toybox install'