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