2 # Copyright 2006 Rob Landley <rob@landley.net>
4 # If people set these on the make command line, use 'em
5 # Note that CC defaults to "cc" so the one in configure doesn't get
6 # used when scripts/make.sh and care called through "make".
10 export CROSS_COMPILE CFLAGS OPTIMIZE LDOPTIMIZE CC HOSTCC V
14 KCONFIG_CONFIG ?= .config
16 toybox_stuff: $(KCONFIG_CONFIG) *.[ch] lib/*.[ch] toys/*.h toys/*/*.c scripts/*.sh
18 toybox toybox_unstripped: toybox_stuff
21 .PHONY: clean distclean baseline bloatcheck install install_flat \
22 uinstall uninstall_flat test tests help toybox_stuff change
24 include kconfig/Makefile
26 $(KCONFIG_CONFIG): $(KCONFIG_TOP)
27 $(KCONFIG_TOP): generated/Config.in
28 generated/Config.in: toys/*/*.c scripts/genconfig.sh
32 baseline: toybox_unstripped
33 @cp toybox_unstripped toybox_old
35 bloatcheck: toybox_old toybox_unstripped
36 @scripts/bloatcheck toybox_old toybox_unstripped
38 generated/instlist: toybox_stuff
39 NOBUILD=1 scripts/make.sh
40 $(HOSTCC) -I . scripts/install.c -o generated/instlist
42 install_flat: generated/instlist
43 scripts/install.sh --symlink --force
46 scripts/install.sh --long --symlink --force
48 uninstall_flat: generated/instlist
49 scripts/install.sh --uninstall
52 scripts/install.sh --long --uninstall
58 rm -rf toybox toybox_unstripped generated change .singleconfig*
61 rm -f toybox_old .config*
69 @echo ' toybox - Build toybox.'
70 @echo ' change - Build each command standalone under change/.'
71 @echo ' baseline - Create toybox_old for use by bloatcheck.'
72 @echo ' bloatcheck - Report size differences between old and current versions'
73 @echo ' test - Run test suite against compiled commands.'
74 @echo ' clean - Delete temporary files.'
75 @echo " distclean - Delete everything that isn't shipped."
76 @echo ' install_flat - Install toybox into $$PREFIX directory.'
77 @echo ' install - Install toybox into subdirectories of $$PREFIX.'
78 @echo ' uninstall_flat - Remove toybox from $$PREFIX directory.'
79 @echo ' uninstall - Remove toybox from subdirectories of $$PREFIX.'
81 @echo 'example: CFLAGS="--static" CROSS_COMPILE=armv5l- make defconfig toybox install'