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 | 7a585c6 | 2008-02-23 15:02:11 -0600 | [diff] [blame] | 44 | rm -rf toybox toybox_unstripped generated/config.h generated/Config.in \ |
Rob Landley | da60b9b | 2014-02-28 23:04:57 -0600 | [diff] [blame] | 45 | generated/newtoys.h generated/globals.h testdir \ |
Rob Landley | 207cada | 2013-10-03 03:18:00 -0500 | [diff] [blame] | 46 | generated/Config.probed generated/oldtoys.h generated/flags.h \ |
Rob Landley | 15027d6 | 2014-04-15 21:59:42 -0500 | [diff] [blame] | 47 | .singleconfig .singleconfig.old generated/help.h \ |
| 48 | generated/instlist generated/mkflags generated/config2help |
Rob Landley | 401ae8f | 2006-11-01 22:26:25 -0500 | [diff] [blame] | 49 | |
| 50 | distclean: clean |
Rob Landley | 86cafe1 | 2014-01-03 18:23:09 -0600 | [diff] [blame] | 51 | rm -f toybox_old .config* |
Rob Landley | cd2edfd | 2006-11-26 18:47:14 -0500 | [diff] [blame] | 52 | |
Rob Landley | e35f2b8 | 2007-06-18 01:09:00 -0400 | [diff] [blame] | 53 | test: tests |
| 54 | |
| 55 | tests: |
Rob Landley | 9d243a2 | 2008-03-28 00:44:44 -0500 | [diff] [blame] | 56 | scripts/test.sh |
Rob Landley | e35f2b8 | 2007-06-18 01:09:00 -0400 | [diff] [blame] | 57 | |
Rob Landley | cd2edfd | 2006-11-26 18:47:14 -0500 | [diff] [blame] | 58 | help:: |
Rob Landley | 2896480 | 2008-01-19 17:08:39 -0600 | [diff] [blame] | 59 | @echo ' toybox - Build toybox.' |
Rob Landley | cd2edfd | 2006-11-26 18:47:14 -0500 | [diff] [blame] | 60 | @echo ' baseline - Create busybox_old for use by bloatcheck.' |
| 61 | @echo ' bloatcheck - Report size differences between old and current versions' |
Rob Landley | 2896480 | 2008-01-19 17:08:39 -0600 | [diff] [blame] | 62 | @echo ' test - Run test suite against compiled commands.' |
| 63 | @echo ' clean - Delete temporary files.' |
Rob Landley | e614ee1 | 2011-12-28 16:17:13 -0600 | [diff] [blame] | 64 | @echo " distclean - Delete everything that isn't shipped." |
| 65 | @echo ' install_flat - Install toybox into $$PREFIX directory.' |
| 66 | @echo ' install - Install toybox into subdirectories of $$PREFIX.' |
| 67 | @echo ' uninstall_flat - Remove toybox from $$PREFIX directory.' |
| 68 | @echo ' uninstall - Remove toybox from subdirectories of $$PREFIX.' |
Rob Landley | 09e8bde | 2012-02-04 12:20:39 -0600 | [diff] [blame] | 69 | @echo '' |
| 70 | @echo 'example: CFLAGS="--static" CROSS_COMPILE=armv5l- make defconfig toybox install' |
| 71 | @echo '' |