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
|
|
|
|
|
|
|
|
toybox toybox_unstripped: 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 \
|
2015-02-13 23:08:15 -08:00
|
|
|
uinstall uninstall_flat test tests help toybox_stuff change
|
2006-11-01 19:26:25 -08:00
|
|
|
|
2008-01-19 15:08:39 -08:00
|
|
|
include kconfig/Makefile
|
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
|
|
|
|
baseline: toybox_unstripped
|
|
|
|
@cp toybox_unstripped toybox_old
|
|
|
|
|
|
|
|
bloatcheck: toybox_old toybox_unstripped
|
2012-02-21 19:27:10 -08:00
|
|
|
@scripts/bloatcheck toybox_old toybox_unstripped
|
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
|
|
|
|
2013-10-03 01:18:00 -07:00
|
|
|
uninstall_flat: generated/instlist
|
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::
|
2014-11-28 14:51:32 -08:00
|
|
|
rm -rf toybox toybox_unstripped generated change .singleconfig*
|
2006-11-01 19:26:25 -08:00
|
|
|
|
|
|
|
distclean: clean
|
2014-01-03 16:23:09 -08:00
|
|
|
rm -f toybox_old .config*
|
2006-11-26 15:47:14 -08:00
|
|
|
|
2007-06-17 22:09:00 -07:00
|
|
|
test: tests
|
|
|
|
|
|
|
|
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.'
|
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'
|
2008-01-19 15:08:39 -08:00
|
|
|
@echo ' test - Run test suite against compiled commands.'
|
|
|
|
@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 ''
|