blob: b224f3e3a31f265c59757b16c514f1c51742b581 [file] [log] [blame]
Rob Landley401ae8f2006-11-01 22:26:25 -05001# Makefile for toybox.
2# Copyright 2006 Rob Landley <rob@landley.net>
landleyc5621502006-09-28 17:18:51 -04003
Rob Landley401ae8f2006-11-01 22:26:25 -05004all: toybox
5
Rob Landley87df5f62008-05-04 16:20:15 -05006toybox toybox_unstripped: .config *.[ch] lib/*.[ch] toys/*.[ch] scripts/*.sh
Rob Landley28964802008-01-19 17:08:39 -06007 scripts/make.sh
8
Rob Landleybf081b92008-03-28 00:40:57 -05009.PHONY: clean distclean baseline bloatcheck install install_flat \
Rob Landley09c13c92008-03-29 17:25:28 -050010 uinstall uninstall_flat test tests help scripts/test
Rob Landley401ae8f2006-11-01 22:26:25 -050011
12include kconfig/Makefile
13
Rob Landley28964802008-01-19 17:08:39 -060014$(KCONFIG_TOP): generated/Config.in
Rob Landley27f57792012-02-03 23:16:28 -060015generated/Config.in: toys/*.c scripts/genconfig.sh
Rob Landley28964802008-01-19 17:08:39 -060016 scripts/genconfig.sh
Rob Landleyde05a702007-01-31 14:37:01 -050017
Rob Landleyfcf188f2012-02-19 22:21:45 -060018HOSTCC?=cc
Rob Landley401ae8f2006-11-01 22:26:25 -050019
Rob Landleycd2edfd2006-11-26 18:47:14 -050020# Development targets
21baseline: toybox_unstripped
22 @cp toybox_unstripped toybox_old
23
24bloatcheck: toybox_old toybox_unstripped
Rob Landley7a4551f2012-02-21 21:27:10 -060025 @scripts/bloatcheck toybox_old toybox_unstripped
Rob Landleycd2edfd2006-11-26 18:47:14 -050026
Rob Landleybcfad872007-01-31 14:18:05 -050027instlist: toybox
Rob Landley97abd4a2012-06-18 23:23:24 -050028 $(HOSTCC) -I . scripts/install.c -o instlist
Rob Landleybcfad872007-01-31 14:18:05 -050029
30install_flat: instlist
Rob Landley05fbd1e2008-03-28 00:09:31 -050031 scripts/install.sh --symlink --force
32
33install:
34 scripts/install.sh --long --symlink --force
Rob Landleybcfad872007-01-31 14:18:05 -050035
Rob Landleybf081b92008-03-28 00:40:57 -050036uninstall_flat: instlist
37 scripts/install.sh --uninstall
38
39uninstall:
40 scripts/install.sh --long --uninstall
41
Rob Landley401ae8f2006-11-01 22:26:25 -050042clean::
Rob Landley7a585c62008-02-23 15:02:11 -060043 rm -rf toybox toybox_unstripped generated/config.h generated/Config.in \
Rob Landleyf2e61cb2012-02-28 06:34:35 -060044 generated/newtoys.h generated/globals.h instlist testdir \
45 generated/Config.probed
Rob Landley401ae8f2006-11-01 22:26:25 -050046
47distclean: clean
Rob Landley58ecc3e2008-01-10 14:40:13 -060048 rm -f toybox_old .config* generated/help.h
Rob Landleycd2edfd2006-11-26 18:47:14 -050049
Rob Landleye35f2b82007-06-18 01:09:00 -040050test: tests
51
52tests:
Rob Landley9d243a22008-03-28 00:44:44 -050053 scripts/test.sh
Rob Landleye35f2b82007-06-18 01:09:00 -040054
Rob Landleycd2edfd2006-11-26 18:47:14 -050055help::
Rob Landley28964802008-01-19 17:08:39 -060056 @echo ' toybox - Build toybox.'
Rob Landleycd2edfd2006-11-26 18:47:14 -050057 @echo ' baseline - Create busybox_old for use by bloatcheck.'
58 @echo ' bloatcheck - Report size differences between old and current versions'
Rob Landley28964802008-01-19 17:08:39 -060059 @echo ' test - Run test suite against compiled commands.'
60 @echo ' clean - Delete temporary files.'
Rob Landleye614ee12011-12-28 16:17:13 -060061 @echo " distclean - Delete everything that isn't shipped."
62 @echo ' install_flat - Install toybox into $$PREFIX directory.'
63 @echo ' install - Install toybox into subdirectories of $$PREFIX.'
64 @echo ' uninstall_flat - Remove toybox from $$PREFIX directory.'
65 @echo ' uninstall - Remove toybox from subdirectories of $$PREFIX.'
Rob Landley09e8bde2012-02-04 12:20:39 -060066 @echo ''
67 @echo 'example: CFLAGS="--static" CROSS_COMPILE=armv5l- make defconfig toybox install'
68 @echo ''