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 | 58c8508 | 2008-02-17 16:19:52 -0600 | [diff] [blame] | 6 | toybox toybox_unstripped: .config *.[ch] lib/*.[ch] toys/*.[ch] scripts/* |
Rob Landley | 2896480 | 2008-01-19 17:08:39 -0600 | [diff] [blame] | 7 | scripts/make.sh |
| 8 | |
Rob Landley | 41cb696 | 2008-01-21 14:47:08 -0600 | [diff] [blame] | 9 | .PHONY: clean distclean baseline bloatcheck install_flat test tests help |
Rob Landley | 401ae8f | 2006-11-01 22:26:25 -0500 | [diff] [blame] | 10 | |
| 11 | include kconfig/Makefile |
| 12 | |
Rob Landley | 2896480 | 2008-01-19 17:08:39 -0600 | [diff] [blame] | 13 | $(KCONFIG_TOP): generated/Config.in |
| 14 | generated/Config.in: |
| 15 | scripts/genconfig.sh |
Rob Landley | de05a70 | 2007-01-31 14:37:01 -0500 | [diff] [blame] | 16 | |
Rob Landley | 2896480 | 2008-01-19 17:08:39 -0600 | [diff] [blame] | 17 | HOSTCC:=cc |
Rob Landley | 401ae8f | 2006-11-01 22:26:25 -0500 | [diff] [blame] | 18 | |
Rob Landley | cd2edfd | 2006-11-26 18:47:14 -0500 | [diff] [blame] | 19 | # Development targets |
| 20 | baseline: toybox_unstripped |
| 21 | @cp toybox_unstripped toybox_old |
| 22 | |
| 23 | bloatcheck: toybox_old toybox_unstripped |
| 24 | @scripts/bloat-o-meter toybox_old toybox_unstripped |
| 25 | |
Rob Landley | bcfad87 | 2007-01-31 14:18:05 -0500 | [diff] [blame] | 26 | instlist: toybox |
Rob Landley | 30d79a1 | 2007-05-29 16:26:47 -0400 | [diff] [blame] | 27 | $(HOSTCC) $(CCFLAGS) -I . scripts/install.c -o instlist |
Rob Landley | bcfad87 | 2007-01-31 14:18:05 -0500 | [diff] [blame] | 28 | |
| 29 | install_flat: instlist |
| 30 | @mkdir -p $(PREFIX)/ |
| 31 | @cp toybox $(PREFIX)/ |
| 32 | @for i in `./instlist`; do ln -s toybox "$(PREFIX)/$$i"; done |
| 33 | |
Rob Landley | 401ae8f | 2006-11-01 22:26:25 -0500 | [diff] [blame] | 34 | clean:: |
Rob Landley | 7a585c6 | 2008-02-23 15:02:11 -0600 | [diff] [blame^] | 35 | rm -rf toybox toybox_unstripped generated/config.h generated/Config.in \ |
| 36 | generated/newtoys.h generated/globals.h instlist testdir |
Rob Landley | 401ae8f | 2006-11-01 22:26:25 -0500 | [diff] [blame] | 37 | |
| 38 | distclean: clean |
Rob Landley | 58ecc3e | 2008-01-10 14:40:13 -0600 | [diff] [blame] | 39 | rm -f toybox_old .config* generated/help.h |
Rob Landley | cd2edfd | 2006-11-26 18:47:14 -0500 | [diff] [blame] | 40 | |
Rob Landley | e35f2b8 | 2007-06-18 01:09:00 -0400 | [diff] [blame] | 41 | test: tests |
| 42 | |
| 43 | tests: |
| 44 | scripts/testall.sh |
| 45 | |
Rob Landley | cd2edfd | 2006-11-26 18:47:14 -0500 | [diff] [blame] | 46 | help:: |
Rob Landley | 2896480 | 2008-01-19 17:08:39 -0600 | [diff] [blame] | 47 | @echo ' toybox - Build toybox.' |
Rob Landley | cd2edfd | 2006-11-26 18:47:14 -0500 | [diff] [blame] | 48 | @echo ' baseline - Create busybox_old for use by bloatcheck.' |
| 49 | @echo ' bloatcheck - Report size differences between old and current versions' |
Rob Landley | 2896480 | 2008-01-19 17:08:39 -0600 | [diff] [blame] | 50 | @echo ' test - Run test suite against compiled commands.' |
| 51 | @echo ' clean - Delete temporary files.' |
| 52 | @echo ' distclean - Delete everything that isn't shipped.' |
| 53 | @echo ' install_flat - Install toybox into $PREFIX directory.' |