blob: 24b8028d354b83cc0c174762c103dff4c7461616 [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 Landleyd04dc1f2013-08-30 01:53:31 -05006KCONFIG_CONFIG ?= .config
7toybox toybox_unstripped: $(KCONFIG_CONFIG) *.[ch] lib/*.[ch] toys/*.h toys/*/*.c scripts/*.sh
Rob Landley28964802008-01-19 17:08:39 -06008 scripts/make.sh
9
Rob Landleybf081b92008-03-28 00:40:57 -050010.PHONY: clean distclean baseline bloatcheck install install_flat \
Rob Landley09c13c92008-03-29 17:25:28 -050011 uinstall uninstall_flat test tests help scripts/test
Rob Landley401ae8f2006-11-01 22:26:25 -050012
13include kconfig/Makefile
14
Rob Landley28964802008-01-19 17:08:39 -060015$(KCONFIG_TOP): generated/Config.in
Rob Landley3a9241a2012-08-25 14:25:22 -050016generated/Config.in: toys/*/*.c scripts/genconfig.sh
Rob Landley28964802008-01-19 17:08:39 -060017 scripts/genconfig.sh
Rob Landleyde05a702007-01-31 14:37:01 -050018
Rob Landleyfcf188f2012-02-19 22:21:45 -060019HOSTCC?=cc
Rob Landley401ae8f2006-11-01 22:26:25 -050020
Rob Landleycd2edfd2006-11-26 18:47:14 -050021# Development targets
22baseline: toybox_unstripped
23 @cp toybox_unstripped toybox_old
24
25bloatcheck: toybox_old toybox_unstripped
Rob Landley7a4551f2012-02-21 21:27:10 -060026 @scripts/bloatcheck toybox_old toybox_unstripped
Rob Landleycd2edfd2006-11-26 18:47:14 -050027
Rob Landley207cada2013-10-03 03:18:00 -050028generated/instlist: toybox
29 $(HOSTCC) -I . scripts/install.c -o generated/instlist
Rob Landleybcfad872007-01-31 14:18:05 -050030
Rob Landley207cada2013-10-03 03:18:00 -050031install_flat: generated/instlist
Rob Landley05fbd1e2008-03-28 00:09:31 -050032 scripts/install.sh --symlink --force
33
34install:
35 scripts/install.sh --long --symlink --force
Rob Landleybcfad872007-01-31 14:18:05 -050036
Rob Landley207cada2013-10-03 03:18:00 -050037uninstall_flat: generated/instlist
Rob Landleybf081b92008-03-28 00:40:57 -050038 scripts/install.sh --uninstall
39
40uninstall:
41 scripts/install.sh --long --uninstall
42
Rob Landley401ae8f2006-11-01 22:26:25 -050043clean::
Rob Landley579ce352014-08-10 12:01:49 -050044 rm -rf toybox toybox_unstripped testdir \
45 .singleconfig .singleconfig.old \
46 generated/Config.* generated/*.h generated/*.o generated/*.dat \
Rob Landley15027d62014-04-15 21:59:42 -050047 generated/instlist generated/mkflags generated/config2help
Rob Landley401ae8f2006-11-01 22:26:25 -050048
49distclean: clean
Rob Landley86cafe12014-01-03 18:23:09 -060050 rm -f toybox_old .config*
Rob Landleycd2edfd2006-11-26 18:47:14 -050051
Rob Landleye35f2b82007-06-18 01:09:00 -040052test: tests
53
54tests:
Rob Landley9d243a22008-03-28 00:44:44 -050055 scripts/test.sh
Rob Landleye35f2b82007-06-18 01:09:00 -040056
Rob Landleycd2edfd2006-11-26 18:47:14 -050057help::
Rob Landley28964802008-01-19 17:08:39 -060058 @echo ' toybox - Build toybox.'
Rob Landleycd2edfd2006-11-26 18:47:14 -050059 @echo ' baseline - Create busybox_old for use by bloatcheck.'
60 @echo ' bloatcheck - Report size differences between old and current versions'
Rob Landley28964802008-01-19 17:08:39 -060061 @echo ' test - Run test suite against compiled commands.'
62 @echo ' clean - Delete temporary files.'
Rob Landleye614ee12011-12-28 16:17:13 -060063 @echo " distclean - Delete everything that isn't shipped."
64 @echo ' install_flat - Install toybox into $$PREFIX directory.'
65 @echo ' install - Install toybox into subdirectories of $$PREFIX.'
66 @echo ' uninstall_flat - Remove toybox from $$PREFIX directory.'
67 @echo ' uninstall - Remove toybox from subdirectories of $$PREFIX.'
Rob Landley09e8bde2012-02-04 12:20:39 -060068 @echo ''
69 @echo 'example: CFLAGS="--static" CROSS_COMPILE=armv5l- make defconfig toybox install'
70 @echo ''