2006-11-01 19:26:25 -08:00
|
|
|
# Makefile for toybox.
|
|
|
|
# Copyright 2006 Rob Landley <rob@landley.net>
|
2006-09-28 14:18:51 -07:00
|
|
|
|
2015-10-04 06:44:17 -07:00
|
|
|
# If people set these on the make command line, use 'em
|
|
|
|
# Note that CC defaults to "cc" so the one in configure doesn't get
|
|
|
|
# used when scripts/make.sh and care called through "make".
|
2015-10-05 18:47:49 -07:00
|
|
|
|
|
|
|
HOSTCC?=cc
|
|
|
|
|
2015-10-04 06:44:17 -07:00
|
|
|
export CROSS_COMPILE CFLAGS OPTIMIZE LDOPTIMIZE CC HOSTCC V
|
|
|
|
|
2006-11-01 19:26:25 -08:00
|
|
|
all: toybox
|
|
|
|
|
2013-08-29 23:53:31 -07:00
|
|
|
KCONFIG_CONFIG ?= .config
|
2014-11-28 14:49:46 -08:00
|
|
|
|
|
|
|
toybox_stuff: $(KCONFIG_CONFIG) *.[ch] lib/*.[ch] toys/*.h toys/*/*.c scripts/*.sh
|
|
|
|
|
2016-03-23 01:25:37 -07:00
|
|
|
toybox generated/unstripped/toybox: toybox_stuff
|
2008-01-19 15:08:39 -08:00
|
|
|
scripts/make.sh
|
2006-11-01 19:26:25 -08:00
|
|
|
|
2008-03-27 22:40:57 -07:00
|
|
|
.PHONY: clean distclean baseline bloatcheck install install_flat \
|
2016-03-23 01:25:37 -07:00
|
|
|
uinstall uninstall_flat tests help toybox_stuff change \
|
2016-02-14 12:04:21 -08:00
|
|
|
list list_working list_pending
|
2006-11-01 19:26:25 -08:00
|
|
|
|
2008-01-19 15:08:39 -08:00
|
|
|
include kconfig/Makefile
|
2016-02-07 16:15:53 -08:00
|
|
|
-include .singlemake
|
2007-01-31 11:37:01 -08:00
|
|
|
|
2014-11-28 14:49:46 -08:00
|
|
|
$(KCONFIG_CONFIG): $(KCONFIG_TOP)
|
2008-01-19 15:08:39 -08:00
|
|
|
$(KCONFIG_TOP): generated/Config.in
|
2012-08-25 12:25:22 -07:00
|
|
|
generated/Config.in: toys/*/*.c scripts/genconfig.sh
|
2008-01-19 15:08:39 -08:00
|
|
|
scripts/genconfig.sh
|
2006-11-02 16:50:02 -08:00
|
|
|
|
2006-11-26 15:47:14 -08:00
|
|
|
# Development targets
|
2016-03-23 01:25:37 -07:00
|
|
|
baseline: generated/unstripped/toybox
|
|
|
|
@cp generated/unstripped/toybox generated/unstripped/toybox_old
|
2006-11-26 15:47:14 -08:00
|
|
|
|
2016-03-23 01:25:37 -07:00
|
|
|
bloatcheck: toybox_old generated/unstripped/toybox
|
|
|
|
@scripts/bloatcheck generated/unstripped/toybox_old generated/unstripped/toybox
|
2006-11-26 15:47:14 -08:00
|
|
|
|
2016-02-03 20:33:04 -08:00
|
|
|
install_flat:
|
2008-03-27 22:09:31 -07:00
|
|
|
scripts/install.sh --symlink --force
|
|
|
|
|
|
|
|
install:
|
|
|
|
scripts/install.sh --long --symlink --force
|
2007-01-31 11:18:05 -08:00
|
|
|
|
2016-02-10 21:27:55 -08:00
|
|
|
uninstall_flat:
|
2008-03-27 22:40:57 -07:00
|
|
|
scripts/install.sh --uninstall
|
|
|
|
|
|
|
|
uninstall:
|
|
|
|
scripts/install.sh --long --uninstall
|
|
|
|
|
2015-02-07 15:19:38 -08:00
|
|
|
change:
|
2015-02-13 23:08:15 -08:00
|
|
|
scripts/change.sh
|
2014-11-28 14:49:46 -08:00
|
|
|
|
2006-11-01 19:26:25 -08:00
|
|
|
clean::
|
2016-03-23 01:25:37 -07:00
|
|
|
rm -rf toybox generated change .singleconfig*
|
2006-11-01 19:26:25 -08:00
|
|
|
|
|
|
|
distclean: clean
|
2016-02-07 16:15:53 -08:00
|
|
|
rm -f toybox_old .config* .singlemake
|
2006-11-26 15:47:14 -08:00
|
|
|
|
2007-06-17 22:09:00 -07:00
|
|
|
tests:
|
2008-03-27 22:44:44 -07:00
|
|
|
scripts/test.sh
|
2007-06-17 22:09:00 -07:00
|
|
|
|
2006-11-26 15:47:14 -08:00
|
|
|
help::
|
2008-01-19 15:08:39 -08:00
|
|
|
@echo ' toybox - Build toybox.'
|
2016-02-07 16:15:53 -08:00
|
|
|
@echo ' COMMANDNAME - Build individual toybox command as a standalone binary.'
|
2016-04-19 22:47:05 -07:00
|
|
|
@echo ' list - List COMMANDNAMEs you can build standalone.'
|
|
|
|
@echo ' list_pending - List unfinished COMMANDNAMEs out of toys/pending.'
|
2014-12-13 09:59:10 -08:00
|
|
|
@echo ' change - Build each command standalone under change/.'
|
2015-03-28 11:13:42 -07:00
|
|
|
@echo ' baseline - Create toybox_old for use by bloatcheck.'
|
2006-11-26 15:47:14 -08:00
|
|
|
@echo ' bloatcheck - Report size differences between old and current versions'
|
2016-02-27 13:27:26 -08:00
|
|
|
@echo ' test_COMMAND - Run tests for COMMAND (test_ps, test_cat, etc.)'
|
2016-03-23 01:25:37 -07:00
|
|
|
@echo ' tests - Run test suite against all compiled commands.'
|
2016-02-19 15:56:01 -08:00
|
|
|
@echo ' export TEST_HOST=1 to test host command, VERBOSE=1'
|
|
|
|
@echo ' to show diff, VERBOSE=fail to stop after first failure.'
|
2008-01-19 15:08:39 -08:00
|
|
|
@echo ' clean - Delete temporary files.'
|
2011-12-28 14:17:13 -08:00
|
|
|
@echo " distclean - Delete everything that isn't shipped."
|
|
|
|
@echo ' install_flat - Install toybox into $$PREFIX directory.'
|
|
|
|
@echo ' install - Install toybox into subdirectories of $$PREFIX.'
|
|
|
|
@echo ' uninstall_flat - Remove toybox from $$PREFIX directory.'
|
|
|
|
@echo ' uninstall - Remove toybox from subdirectories of $$PREFIX.'
|
2012-02-04 10:20:39 -08:00
|
|
|
@echo ''
|
|
|
|
@echo 'example: CFLAGS="--static" CROSS_COMPILE=armv5l- make defconfig toybox install'
|
|
|
|
@echo ''
|