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 | 401ae8f | 2006-11-01 22:26:25 -0500 | [diff] [blame] | 4 | all: toybox |
| 5 | |
Rob Landley | d04dc1f | 2013-08-30 01:53:31 -0500 | [diff] [blame] | 6 | KCONFIG_CONFIG ?= .config |
Rob Landley | 62390fd | 2014-11-28 16:49:46 -0600 | [diff] [blame] | 7 | |
| 8 | toybox_stuff: $(KCONFIG_CONFIG) *.[ch] lib/*.[ch] toys/*.h toys/*/*.c scripts/*.sh |
| 9 | |
| 10 | toybox toybox_unstripped: toybox_stuff |
Rob Landley | 2896480 | 2008-01-19 17:08:39 -0600 | [diff] [blame] | 11 | scripts/make.sh |
| 12 | |
Rob Landley | bf081b9 | 2008-03-28 00:40:57 -0500 | [diff] [blame] | 13 | .PHONY: clean distclean baseline bloatcheck install install_flat \ |
Rob Landley | 45962a7 | 2015-02-14 01:08:15 -0600 | [diff] [blame] | 14 | uinstall uninstall_flat test tests help toybox_stuff change |
Rob Landley | 401ae8f | 2006-11-01 22:26:25 -0500 | [diff] [blame] | 15 | |
| 16 | include kconfig/Makefile |
| 17 | |
Rob Landley | 62390fd | 2014-11-28 16:49:46 -0600 | [diff] [blame] | 18 | $(KCONFIG_CONFIG): $(KCONFIG_TOP) |
Rob Landley | 2896480 | 2008-01-19 17:08:39 -0600 | [diff] [blame] | 19 | $(KCONFIG_TOP): generated/Config.in |
Rob Landley | 3a9241a | 2012-08-25 14:25:22 -0500 | [diff] [blame] | 20 | generated/Config.in: toys/*/*.c scripts/genconfig.sh |
Rob Landley | 2896480 | 2008-01-19 17:08:39 -0600 | [diff] [blame] | 21 | scripts/genconfig.sh |
Rob Landley | de05a70 | 2007-01-31 14:37:01 -0500 | [diff] [blame] | 22 | |
Rob Landley | fcf188f | 2012-02-19 22:21:45 -0600 | [diff] [blame] | 23 | HOSTCC?=cc |
Rob Landley | 401ae8f | 2006-11-01 22:26:25 -0500 | [diff] [blame] | 24 | |
Rob Landley | cd2edfd | 2006-11-26 18:47:14 -0500 | [diff] [blame] | 25 | # Development targets |
| 26 | baseline: toybox_unstripped |
| 27 | @cp toybox_unstripped toybox_old |
| 28 | |
| 29 | bloatcheck: toybox_old toybox_unstripped |
Rob Landley | 7a4551f | 2012-02-21 21:27:10 -0600 | [diff] [blame] | 30 | @scripts/bloatcheck toybox_old toybox_unstripped |
Rob Landley | cd2edfd | 2006-11-26 18:47:14 -0500 | [diff] [blame] | 31 | |
Rob Landley | 62390fd | 2014-11-28 16:49:46 -0600 | [diff] [blame] | 32 | generated/instlist: toybox_stuff |
| 33 | NOBUILD=1 scripts/make.sh |
Rob Landley | 207cada | 2013-10-03 03:18:00 -0500 | [diff] [blame] | 34 | $(HOSTCC) -I . scripts/install.c -o generated/instlist |
Rob Landley | bcfad87 | 2007-01-31 14:18:05 -0500 | [diff] [blame] | 35 | |
Rob Landley | 207cada | 2013-10-03 03:18:00 -0500 | [diff] [blame] | 36 | install_flat: generated/instlist |
Rob Landley | 05fbd1e | 2008-03-28 00:09:31 -0500 | [diff] [blame] | 37 | scripts/install.sh --symlink --force |
| 38 | |
| 39 | install: |
| 40 | scripts/install.sh --long --symlink --force |
Rob Landley | bcfad87 | 2007-01-31 14:18:05 -0500 | [diff] [blame] | 41 | |
Rob Landley | 207cada | 2013-10-03 03:18:00 -0500 | [diff] [blame] | 42 | uninstall_flat: generated/instlist |
Rob Landley | bf081b9 | 2008-03-28 00:40:57 -0500 | [diff] [blame] | 43 | scripts/install.sh --uninstall |
| 44 | |
| 45 | uninstall: |
| 46 | scripts/install.sh --long --uninstall |
| 47 | |
Rob Landley | 5eb4475 | 2015-02-07 17:19:38 -0600 | [diff] [blame] | 48 | change: |
Rob Landley | 45962a7 | 2015-02-14 01:08:15 -0600 | [diff] [blame] | 49 | scripts/change.sh |
Rob Landley | 62390fd | 2014-11-28 16:49:46 -0600 | [diff] [blame] | 50 | |
Rob Landley | 401ae8f | 2006-11-01 22:26:25 -0500 | [diff] [blame] | 51 | clean:: |
Rob Landley | 6d33f3a | 2014-11-28 16:51:32 -0600 | [diff] [blame] | 52 | rm -rf toybox toybox_unstripped generated change .singleconfig* |
Rob Landley | 401ae8f | 2006-11-01 22:26:25 -0500 | [diff] [blame] | 53 | |
| 54 | distclean: clean |
Rob Landley | 86cafe1 | 2014-01-03 18:23:09 -0600 | [diff] [blame] | 55 | rm -f toybox_old .config* |
Rob Landley | cd2edfd | 2006-11-26 18:47:14 -0500 | [diff] [blame] | 56 | |
Rob Landley | e35f2b8 | 2007-06-18 01:09:00 -0400 | [diff] [blame] | 57 | test: tests |
| 58 | |
| 59 | tests: |
Rob Landley | 9d243a2 | 2008-03-28 00:44:44 -0500 | [diff] [blame] | 60 | scripts/test.sh |
Rob Landley | e35f2b8 | 2007-06-18 01:09:00 -0400 | [diff] [blame] | 61 | |
Rob Landley | cd2edfd | 2006-11-26 18:47:14 -0500 | [diff] [blame] | 62 | help:: |
Rob Landley | 2896480 | 2008-01-19 17:08:39 -0600 | [diff] [blame] | 63 | @echo ' toybox - Build toybox.' |
Rob Landley | e72ea20 | 2014-12-13 11:59:10 -0600 | [diff] [blame] | 64 | @echo ' change - Build each command standalone under change/.' |
Elliott Hughes | 58e0642 | 2015-03-28 13:13:42 -0500 | [diff] [blame] | 65 | @echo ' baseline - Create toybox_old for use by bloatcheck.' |
Rob Landley | cd2edfd | 2006-11-26 18:47:14 -0500 | [diff] [blame] | 66 | @echo ' bloatcheck - Report size differences between old and current versions' |
Rob Landley | 2896480 | 2008-01-19 17:08:39 -0600 | [diff] [blame] | 67 | @echo ' test - Run test suite against compiled commands.' |
| 68 | @echo ' clean - Delete temporary files.' |
Rob Landley | e614ee1 | 2011-12-28 16:17:13 -0600 | [diff] [blame] | 69 | @echo " distclean - Delete everything that isn't shipped." |
| 70 | @echo ' install_flat - Install toybox into $$PREFIX directory.' |
| 71 | @echo ' install - Install toybox into subdirectories of $$PREFIX.' |
| 72 | @echo ' uninstall_flat - Remove toybox from $$PREFIX directory.' |
| 73 | @echo ' uninstall - Remove toybox from subdirectories of $$PREFIX.' |
Rob Landley | 09e8bde | 2012-02-04 12:20:39 -0600 | [diff] [blame] | 74 | @echo '' |
| 75 | @echo 'example: CFLAGS="--static" CROSS_COMPILE=armv5l- make defconfig toybox install' |
| 76 | @echo '' |