Rob Landley | 401ae8f | 2006-11-01 22:26:25 -0500 | [diff] [blame] | 1 | # Makefile for toybox. |
| 2 | # Copyright 2006 Rob Landley <rob@landley.net> |
landley | c562150 | 2006-09-28 17:18:51 -0400 | [diff] [blame] | 3 | |
Rob Landley | 5b39d5c | 2015-10-04 08:44:17 -0500 | [diff] [blame] | 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". |
Rob Landley | 1223578 | 2015-10-05 20:47:49 -0500 | [diff] [blame] | 7 | |
| 8 | HOSTCC?=cc |
| 9 | |
Rob Landley | 5b39d5c | 2015-10-04 08:44:17 -0500 | [diff] [blame] | 10 | export CROSS_COMPILE CFLAGS OPTIMIZE LDOPTIMIZE CC HOSTCC V |
| 11 | |
Rob Landley | 401ae8f | 2006-11-01 22:26:25 -0500 | [diff] [blame] | 12 | all: toybox |
| 13 | |
Rob Landley | d04dc1f | 2013-08-30 01:53:31 -0500 | [diff] [blame] | 14 | KCONFIG_CONFIG ?= .config |
Rob Landley | 62390fd | 2014-11-28 16:49:46 -0600 | [diff] [blame] | 15 | |
| 16 | toybox_stuff: $(KCONFIG_CONFIG) *.[ch] lib/*.[ch] toys/*.h toys/*/*.c scripts/*.sh |
| 17 | |
Rob Landley | a8d0d13 | 2016-03-23 03:25:37 -0500 | [diff] [blame] | 18 | toybox generated/unstripped/toybox: toybox_stuff |
Rob Landley | 2896480 | 2008-01-19 17:08:39 -0600 | [diff] [blame] | 19 | scripts/make.sh |
| 20 | |
Rob Landley | bf081b9 | 2008-03-28 00:40:57 -0500 | [diff] [blame] | 21 | .PHONY: clean distclean baseline bloatcheck install install_flat \ |
Rob Landley | a8d0d13 | 2016-03-23 03:25:37 -0500 | [diff] [blame] | 22 | uinstall uninstall_flat tests help toybox_stuff change \ |
Rob Landley | 05b7529 | 2016-02-14 14:04:21 -0600 | [diff] [blame] | 23 | list list_working list_pending |
Rob Landley | 401ae8f | 2006-11-01 22:26:25 -0500 | [diff] [blame] | 24 | |
| 25 | include kconfig/Makefile |
Rob Landley | 712e43e | 2016-02-07 18:15:53 -0600 | [diff] [blame] | 26 | -include .singlemake |
Rob Landley | 401ae8f | 2006-11-01 22:26:25 -0500 | [diff] [blame] | 27 | |
Rob Landley | 62390fd | 2014-11-28 16:49:46 -0600 | [diff] [blame] | 28 | $(KCONFIG_CONFIG): $(KCONFIG_TOP) |
Rob Landley | 2896480 | 2008-01-19 17:08:39 -0600 | [diff] [blame] | 29 | $(KCONFIG_TOP): generated/Config.in |
Rob Landley | 3a9241a | 2012-08-25 14:25:22 -0500 | [diff] [blame] | 30 | generated/Config.in: toys/*/*.c scripts/genconfig.sh |
Rob Landley | 2896480 | 2008-01-19 17:08:39 -0600 | [diff] [blame] | 31 | scripts/genconfig.sh |
Rob Landley | de05a70 | 2007-01-31 14:37:01 -0500 | [diff] [blame] | 32 | |
Rob Landley | cd2edfd | 2006-11-26 18:47:14 -0500 | [diff] [blame] | 33 | # Development targets |
Rob Landley | a8d0d13 | 2016-03-23 03:25:37 -0500 | [diff] [blame] | 34 | baseline: generated/unstripped/toybox |
| 35 | @cp generated/unstripped/toybox generated/unstripped/toybox_old |
Rob Landley | cd2edfd | 2006-11-26 18:47:14 -0500 | [diff] [blame] | 36 | |
Rob Landley | a8d0d13 | 2016-03-23 03:25:37 -0500 | [diff] [blame] | 37 | bloatcheck: toybox_old generated/unstripped/toybox |
| 38 | @scripts/bloatcheck generated/unstripped/toybox_old generated/unstripped/toybox |
Rob Landley | cd2edfd | 2006-11-26 18:47:14 -0500 | [diff] [blame] | 39 | |
Rob Landley | 9a64b8d | 2016-02-03 22:33:04 -0600 | [diff] [blame] | 40 | install_flat: |
Rob Landley | 05fbd1e | 2008-03-28 00:09:31 -0500 | [diff] [blame] | 41 | scripts/install.sh --symlink --force |
| 42 | |
Rob Landley | 6c3188c | 2016-10-02 22:41:55 -0500 | [diff] [blame] | 43 | install_airlock: |
| 44 | scripts/install.sh --symlink --force --airlock |
| 45 | |
Rob Landley | 05fbd1e | 2008-03-28 00:09:31 -0500 | [diff] [blame] | 46 | install: |
| 47 | scripts/install.sh --long --symlink --force |
Rob Landley | bcfad87 | 2007-01-31 14:18:05 -0500 | [diff] [blame] | 48 | |
Rob Landley | df07fb7 | 2016-02-10 23:27:55 -0600 | [diff] [blame] | 49 | uninstall_flat: |
Rob Landley | bf081b9 | 2008-03-28 00:40:57 -0500 | [diff] [blame] | 50 | scripts/install.sh --uninstall |
| 51 | |
| 52 | uninstall: |
| 53 | scripts/install.sh --long --uninstall |
| 54 | |
Rob Landley | 5eb4475 | 2015-02-07 17:19:38 -0600 | [diff] [blame] | 55 | change: |
Rob Landley | 45962a7 | 2015-02-14 01:08:15 -0600 | [diff] [blame] | 56 | scripts/change.sh |
Rob Landley | 62390fd | 2014-11-28 16:49:46 -0600 | [diff] [blame] | 57 | |
Rob Landley | 401ae8f | 2006-11-01 22:26:25 -0500 | [diff] [blame] | 58 | clean:: |
Rob Landley | a8d0d13 | 2016-03-23 03:25:37 -0500 | [diff] [blame] | 59 | rm -rf toybox generated change .singleconfig* |
Rob Landley | 401ae8f | 2006-11-01 22:26:25 -0500 | [diff] [blame] | 60 | |
Rob Landley | 8cc325d | 2016-09-04 18:07:12 -0500 | [diff] [blame] | 61 | # If singlemake was in generated/ "make clean; make test_ls" wouldn't work. |
Rob Landley | 401ae8f | 2006-11-01 22:26:25 -0500 | [diff] [blame] | 62 | distclean: clean |
Rob Landley | 712e43e | 2016-02-07 18:15:53 -0600 | [diff] [blame] | 63 | rm -f toybox_old .config* .singlemake |
Rob Landley | cd2edfd | 2006-11-26 18:47:14 -0500 | [diff] [blame] | 64 | |
Rob Landley | e35f2b8 | 2007-06-18 01:09:00 -0400 | [diff] [blame] | 65 | tests: |
Rob Landley | 9d243a2 | 2008-03-28 00:44:44 -0500 | [diff] [blame] | 66 | scripts/test.sh |
Rob Landley | e35f2b8 | 2007-06-18 01:09:00 -0400 | [diff] [blame] | 67 | |
Rob Landley | cd2edfd | 2006-11-26 18:47:14 -0500 | [diff] [blame] | 68 | help:: |
Rob Landley | 2896480 | 2008-01-19 17:08:39 -0600 | [diff] [blame] | 69 | @echo ' toybox - Build toybox.' |
Rob Landley | 712e43e | 2016-02-07 18:15:53 -0600 | [diff] [blame] | 70 | @echo ' COMMANDNAME - Build individual toybox command as a standalone binary.' |
Rob Landley | a599514 | 2016-04-20 00:47:05 -0500 | [diff] [blame] | 71 | @echo ' list - List COMMANDNAMEs you can build standalone.' |
| 72 | @echo ' list_pending - List unfinished COMMANDNAMEs out of toys/pending.' |
Rob Landley | e72ea20 | 2014-12-13 11:59:10 -0600 | [diff] [blame] | 73 | @echo ' change - Build each command standalone under change/.' |
Elliott Hughes | 58e0642 | 2015-03-28 13:13:42 -0500 | [diff] [blame] | 74 | @echo ' baseline - Create toybox_old for use by bloatcheck.' |
Rob Landley | cd2edfd | 2006-11-26 18:47:14 -0500 | [diff] [blame] | 75 | @echo ' bloatcheck - Report size differences between old and current versions' |
Elliott Hughes | d3904ef | 2016-02-27 13:27:26 -0800 | [diff] [blame] | 76 | @echo ' test_COMMAND - Run tests for COMMAND (test_ps, test_cat, etc.)' |
Rob Landley | a8d0d13 | 2016-03-23 03:25:37 -0500 | [diff] [blame] | 77 | @echo ' tests - Run test suite against all compiled commands.' |
Rob Landley | 5ec9f52 | 2016-02-19 17:56:01 -0600 | [diff] [blame] | 78 | @echo ' export TEST_HOST=1 to test host command, VERBOSE=1' |
| 79 | @echo ' to show diff, VERBOSE=fail to stop after first failure.' |
Rob Landley | 2896480 | 2008-01-19 17:08:39 -0600 | [diff] [blame] | 80 | @echo ' clean - Delete temporary files.' |
Rob Landley | e614ee1 | 2011-12-28 16:17:13 -0600 | [diff] [blame] | 81 | @echo " distclean - Delete everything that isn't shipped." |
Rob Landley | cba5dc4 | 2017-01-04 14:18:12 -0600 | [diff] [blame] | 82 | @echo ' install_airlock - Install toybox and host toolchain into $$PREFIX directory' |
| 83 | @echo ' (providing $$PATH for hermetic builds).' |
Rob Landley | e614ee1 | 2011-12-28 16:17:13 -0600 | [diff] [blame] | 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.' |
Rob Landley | 09e8bde | 2012-02-04 12:20:39 -0600 | [diff] [blame] | 88 | @echo '' |
| 89 | @echo 'example: CFLAGS="--static" CROSS_COMPILE=armv5l- make defconfig toybox install' |
| 90 | @echo '' |