blob: e4d88828d48251f949bcb08f2979d2fcd9a405e1 [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 Landley28964802008-01-19 17:08:39 -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
25 @scripts/bloat-o-meter toybox_old toybox_unstripped
26
Rob Landleybcfad872007-01-31 14:18:05 -050027instlist: toybox
Rob Landley30d79a12007-05-29 16:26:47 -040028 $(HOSTCC) $(CCFLAGS) -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 \
44 generated/newtoys.h generated/globals.h instlist testdir
Rob Landley401ae8f2006-11-01 22:26:25 -050045
46distclean: clean
Rob Landley58ecc3e2008-01-10 14:40:13 -060047 rm -f toybox_old .config* generated/help.h
Rob Landleycd2edfd2006-11-26 18:47:14 -050048
Rob Landleye35f2b82007-06-18 01:09:00 -040049test: tests
50
51tests:
Rob Landley9d243a22008-03-28 00:44:44 -050052 scripts/test.sh
Rob Landleye35f2b82007-06-18 01:09:00 -040053
Rob Landleycd2edfd2006-11-26 18:47:14 -050054help::
Rob Landley28964802008-01-19 17:08:39 -060055 @echo ' toybox - Build toybox.'
Rob Landleycd2edfd2006-11-26 18:47:14 -050056 @echo ' baseline - Create busybox_old for use by bloatcheck.'
57 @echo ' bloatcheck - Report size differences between old and current versions'
Rob Landley28964802008-01-19 17:08:39 -060058 @echo ' test - Run test suite against compiled commands.'
59 @echo ' clean - Delete temporary files.'
Rob Landleye614ee12011-12-28 16:17:13 -060060 @echo " distclean - Delete everything that isn't shipped."
61 @echo ' install_flat - Install toybox into $$PREFIX directory.'
62 @echo ' install - Install toybox into subdirectories of $$PREFIX.'
63 @echo ' uninstall_flat - Remove toybox from $$PREFIX directory.'
64 @echo ' uninstall - Remove toybox from subdirectories of $$PREFIX.'
Rob Landley09e8bde2012-02-04 12:20:39 -060065 @echo ''
66 @echo 'example: CFLAGS="--static" CROSS_COMPILE=armv5l- make defconfig toybox install'
67 @echo ''