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
|
|
|
|
|
2018-06-02 07:09:22 -07:00
|
|
|
export CROSS_COMPILE CFLAGS OPTIMIZE LDOPTIMIZE CC HOSTCC V STRIP
|
2015-10-04 06:44:17 -07:00
|
|
|
|
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
|
|
|
|
2020-08-07 00:25:50 -07:00
|
|
|
toybox generated/unstripped/toybox: $(KCONFIG_CONFIG) *.[ch] lib/*.[ch] toys/*/*.c scripts/*.sh Config.in
|
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 \
|
2020-08-07 00:25:50 -07:00
|
|
|
uinstall uninstall_flat tests help change \
|
2019-08-22 12:34:45 -07:00
|
|
|
list list_working list_pending root run_root
|
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)
|
2019-08-01 23:35:16 -07:00
|
|
|
@if [ -e "$(KCONFIG_CONFIG)" ]; then make silentoldconfig; \
|
2018-10-27 08:54:18 -07:00
|
|
|
else echo "Not configured (run 'make defconfig' or 'make menuconfig')";\
|
|
|
|
exit 1; fi
|
|
|
|
|
|
|
|
$(KCONFIG_TOP): generated/Config.in generated/Config.probed
|
2019-08-01 23:35:43 -07:00
|
|
|
generated/Config.probed: 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
|
|
|
|
2017-12-19 14:16:31 -08:00
|
|
|
bloatcheck: generated/unstripped/toybox_old generated/unstripped/toybox
|
2016-03-23 01:25:37 -07:00
|
|
|
@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
|
|
|
|
|
2016-10-02 20:41:55 -07:00
|
|
|
install_airlock:
|
|
|
|
scripts/install.sh --symlink --force --airlock
|
|
|
|
|
2008-03-27 22:09:31 -07:00
|
|
|
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
|
|
|
|
2019-09-06 22:30:59 -07:00
|
|
|
root_clean:
|
2019-08-22 12:34:45 -07:00
|
|
|
@rm -rf root
|
2019-09-06 22:30:59 -07:00
|
|
|
@echo root cleaned
|
|
|
|
|
|
|
|
clean::
|
2020-03-02 15:52:04 -08:00
|
|
|
@rm -rf toybox generated change .singleconfig*
|
2019-08-22 12:34:45 -07:00
|
|
|
@echo cleaned
|
|
|
|
|
2016-09-04 16:07:12 -07:00
|
|
|
# If singlemake was in generated/ "make clean; make test_ls" wouldn't work.
|
2019-09-06 22:30:59 -07:00
|
|
|
distclean: clean root_clean
|
2020-05-17 04:37:10 -07:00
|
|
|
@rm -f toybox* .config* .singlemake
|
2019-08-22 12:34:45 -07:00
|
|
|
@echo removed .config
|
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
|
|
|
|
2019-08-22 12:34:45 -07:00
|
|
|
root:
|
|
|
|
scripts/mkroot.sh $(MAKEFLAGS)
|
|
|
|
|
|
|
|
run_root:
|
2020-05-01 08:14:12 -07:00
|
|
|
cd root/"$${CROSS:-host}" && ./qemu-*.sh
|
2019-08-22 12:34:45 -07:00
|
|
|
|
2006-11-26 15:47:14 -08:00
|
|
|
help::
|
2018-01-10 08:54:11 -08:00
|
|
|
@cat scripts/help.txt
|