blob: 40a3426395f3e823a539978a09d5afc57b3d6c2f [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 Landley7a585c62008-02-23 15:02:11 -060044 rm -rf toybox toybox_unstripped generated/config.h generated/Config.in \
Rob Landleyda60b9b2014-02-28 23:04:57 -060045 generated/newtoys.h generated/globals.h testdir \
Rob Landley207cada2013-10-03 03:18:00 -050046 generated/Config.probed generated/oldtoys.h generated/flags.h \
Rob Landley15027d62014-04-15 21:59:42 -050047 .singleconfig .singleconfig.old generated/help.h \
48 generated/instlist generated/mkflags generated/config2help
Rob Landley401ae8f2006-11-01 22:26:25 -050049
50distclean: clean
Rob Landley86cafe12014-01-03 18:23:09 -060051 rm -f toybox_old .config*
Rob Landleycd2edfd2006-11-26 18:47:14 -050052
Rob Landleye35f2b82007-06-18 01:09:00 -040053test: tests
54
55tests:
Rob Landley9d243a22008-03-28 00:44:44 -050056 scripts/test.sh
Rob Landleye35f2b82007-06-18 01:09:00 -040057
Rob Landleycd2edfd2006-11-26 18:47:14 -050058help::
Rob Landley28964802008-01-19 17:08:39 -060059 @echo ' toybox - Build toybox.'
Rob Landleycd2edfd2006-11-26 18:47:14 -050060 @echo ' baseline - Create busybox_old for use by bloatcheck.'
61 @echo ' bloatcheck - Report size differences between old and current versions'
Rob Landley28964802008-01-19 17:08:39 -060062 @echo ' test - Run test suite against compiled commands.'
63 @echo ' clean - Delete temporary files.'
Rob Landleye614ee12011-12-28 16:17:13 -060064 @echo " distclean - Delete everything that isn't shipped."
65 @echo ' install_flat - Install toybox into $$PREFIX directory.'
66 @echo ' install - Install toybox into subdirectories of $$PREFIX.'
67 @echo ' uninstall_flat - Remove toybox from $$PREFIX directory.'
68 @echo ' uninstall - Remove toybox from subdirectories of $$PREFIX.'
Rob Landley09e8bde2012-02-04 12:20:39 -060069 @echo ''
70 @echo 'example: CFLAGS="--static" CROSS_COMPILE=armv5l- make defconfig toybox install'
71 @echo ''