Mercurial > hg > toybox
annotate Makefile @ 1702:8ce8c5365f8b draft 0.5.2
stat -f didn't work on 32 bit systems because type sizes wrong (fix from Elliott Hughes).
author | Rob Landley <rob@landley.net> |
---|---|
date | Wed, 25 Feb 2015 00:45:50 -0600 |
parents | a5901bfefda5 |
children | 190ecf70fbe5 |
rev | line source |
---|---|
14
f8e628f61f16
Make the config generate gen_config.h with CFG_ and USE() macros.
Rob Landley <rob@landley.net>
parents:
7
diff
changeset
|
1 # Makefile for toybox. |
f8e628f61f16
Make the config generate gen_config.h with CFG_ and USE() macros.
Rob Landley <rob@landley.net>
parents:
7
diff
changeset
|
2 # Copyright 2006 Rob Landley <rob@landley.net> |
f8e628f61f16
Make the config generate gen_config.h with CFG_ and USE() macros.
Rob Landley <rob@landley.net>
parents:
7
diff
changeset
|
3 |
f8e628f61f16
Make the config generate gen_config.h with CFG_ and USE() macros.
Rob Landley <rob@landley.net>
parents:
7
diff
changeset
|
4 all: toybox |
f8e628f61f16
Make the config generate gen_config.h with CFG_ and USE() macros.
Rob Landley <rob@landley.net>
parents:
7
diff
changeset
|
5 |
1032
40d0c96a8e89
Add scripts/single.sh to build individual non-multiplexed standalone commands.
Rob Landley <rob@landley.net>
parents:
999
diff
changeset
|
6 KCONFIG_CONFIG ?= .config |
1578
a34104fc7544
Add "make change" target to build the big toybox binary as a bunch of little ones (in the "change" subdirectory), and tweak scripts/make.sh to avoid redundant work when rebuilding.
Rob Landley <rob@landley.net>
parents:
1492
diff
changeset
|
7 |
a34104fc7544
Add "make change" target to build the big toybox binary as a bunch of little ones (in the "change" subdirectory), and tweak scripts/make.sh to avoid redundant work when rebuilding.
Rob Landley <rob@landley.net>
parents:
1492
diff
changeset
|
8 toybox_stuff: $(KCONFIG_CONFIG) *.[ch] lib/*.[ch] toys/*.h toys/*/*.c scripts/*.sh |
a34104fc7544
Add "make change" target to build the big toybox binary as a bunch of little ones (in the "change" subdirectory), and tweak scripts/make.sh to avoid redundant work when rebuilding.
Rob Landley <rob@landley.net>
parents:
1492
diff
changeset
|
9 |
a34104fc7544
Add "make change" target to build the big toybox binary as a bunch of little ones (in the "change" subdirectory), and tweak scripts/make.sh to avoid redundant work when rebuilding.
Rob Landley <rob@landley.net>
parents:
1492
diff
changeset
|
10 toybox toybox_unstripped: toybox_stuff |
233
d4176f3f3835
Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents:
232
diff
changeset
|
11 scripts/make.sh |
d4176f3f3835
Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents:
232
diff
changeset
|
12 |
274
5b948171e495
Add uninstall and uninstall_flat.
Rob Landley <rob@landley.net>
parents:
273
diff
changeset
|
13 .PHONY: clean distclean baseline bloatcheck install install_flat \ |
1694
a5901bfefda5
Move guts of "make change" to scripts/change.sh, don't try to build sh or help standalone.
Rob Landley <rob@landley.net>
parents:
1679
diff
changeset
|
14 uinstall uninstall_flat test tests help toybox_stuff change |
14
f8e628f61f16
Make the config generate gen_config.h with CFG_ and USE() macros.
Rob Landley <rob@landley.net>
parents:
7
diff
changeset
|
15 |
f8e628f61f16
Make the config generate gen_config.h with CFG_ and USE() macros.
Rob Landley <rob@landley.net>
parents:
7
diff
changeset
|
16 include kconfig/Makefile |
1
59d58fab67c6
Next snapshot. Tries to grab something out of lib in order to build, I have
landley@driftwood
parents:
diff
changeset
|
17 |
1578
a34104fc7544
Add "make change" target to build the big toybox binary as a bunch of little ones (in the "change" subdirectory), and tweak scripts/make.sh to avoid redundant work when rebuilding.
Rob Landley <rob@landley.net>
parents:
1492
diff
changeset
|
18 $(KCONFIG_CONFIG): $(KCONFIG_TOP) |
233
d4176f3f3835
Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents:
232
diff
changeset
|
19 $(KCONFIG_TOP): generated/Config.in |
653
2986aa63a021
Move commands into "posix", "lsb", and "other" menus/directories.
Rob Landley <rob@landley.net>
parents:
603
diff
changeset
|
20 generated/Config.in: toys/*/*.c scripts/genconfig.sh |
233
d4176f3f3835
Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents:
232
diff
changeset
|
21 scripts/genconfig.sh |
19
414625f97667
Better dependencies, and feed the linker --gc-sections. (Which is not an
Rob Landley <rob@landley.net>
parents:
14
diff
changeset
|
22 |
484
4099d3026e56
Set HOSTCC only if it isn't already set as an environment variable.
Rob Landley <rob@landley.net>
parents:
429
diff
changeset
|
23 HOSTCC?=cc |
14
f8e628f61f16
Make the config generate gen_config.h with CFG_ and USE() macros.
Rob Landley <rob@landley.net>
parents:
7
diff
changeset
|
24 |
41
a43bdc6f53af
Add bloat-o-meter, make bloatcheck, and scripts/showasm.
Rob Landley <rob@landley.net>
parents:
38
diff
changeset
|
25 # Development targets |
a43bdc6f53af
Add bloat-o-meter, make bloatcheck, and scripts/showasm.
Rob Landley <rob@landley.net>
parents:
38
diff
changeset
|
26 baseline: toybox_unstripped |
a43bdc6f53af
Add bloat-o-meter, make bloatcheck, and scripts/showasm.
Rob Landley <rob@landley.net>
parents:
38
diff
changeset
|
27 @cp toybox_unstripped toybox_old |
a43bdc6f53af
Add bloat-o-meter, make bloatcheck, and scripts/showasm.
Rob Landley <rob@landley.net>
parents:
38
diff
changeset
|
28 |
a43bdc6f53af
Add bloat-o-meter, make bloatcheck, and scripts/showasm.
Rob Landley <rob@landley.net>
parents:
38
diff
changeset
|
29 bloatcheck: toybox_old toybox_unstripped |
492
f3169b2492f1
Replace GPL python debug script with BSD shell script.
Rob Landley <rob@landley.net>
parents:
484
diff
changeset
|
30 @scripts/bloatcheck toybox_old toybox_unstripped |
41
a43bdc6f53af
Add bloat-o-meter, make bloatcheck, and scripts/showasm.
Rob Landley <rob@landley.net>
parents:
38
diff
changeset
|
31 |
1578
a34104fc7544
Add "make change" target to build the big toybox binary as a bunch of little ones (in the "change" subdirectory), and tweak scripts/make.sh to avoid redundant work when rebuilding.
Rob Landley <rob@landley.net>
parents:
1492
diff
changeset
|
32 generated/instlist: toybox_stuff |
a34104fc7544
Add "make change" target to build the big toybox binary as a bunch of little ones (in the "change" subdirectory), and tweak scripts/make.sh to avoid redundant work when rebuilding.
Rob Landley <rob@landley.net>
parents:
1492
diff
changeset
|
33 NOBUILD=1 scripts/make.sh |
1076
1c15ba60aa64
Switch flag generation from shell to C.
Rob Landley <rob@landley.net>
parents:
1032
diff
changeset
|
34 $(HOSTCC) -I . scripts/install.c -o generated/instlist |
89 | 35 |
1076
1c15ba60aa64
Switch flag generation from shell to C.
Rob Landley <rob@landley.net>
parents:
1032
diff
changeset
|
36 install_flat: generated/instlist |
273
e589555d6416
Add install target, and make install_flat use scripts/install.sh
Rob Landley <rob@landley.net>
parents:
265
diff
changeset
|
37 scripts/install.sh --symlink --force |
e589555d6416
Add install target, and make install_flat use scripts/install.sh
Rob Landley <rob@landley.net>
parents:
265
diff
changeset
|
38 |
e589555d6416
Add install target, and make install_flat use scripts/install.sh
Rob Landley <rob@landley.net>
parents:
265
diff
changeset
|
39 install: |
e589555d6416
Add install target, and make install_flat use scripts/install.sh
Rob Landley <rob@landley.net>
parents:
265
diff
changeset
|
40 scripts/install.sh --long --symlink --force |
89 | 41 |
1076
1c15ba60aa64
Switch flag generation from shell to C.
Rob Landley <rob@landley.net>
parents:
1032
diff
changeset
|
42 uninstall_flat: generated/instlist |
274
5b948171e495
Add uninstall and uninstall_flat.
Rob Landley <rob@landley.net>
parents:
273
diff
changeset
|
43 scripts/install.sh --uninstall |
5b948171e495
Add uninstall and uninstall_flat.
Rob Landley <rob@landley.net>
parents:
273
diff
changeset
|
44 |
5b948171e495
Add uninstall and uninstall_flat.
Rob Landley <rob@landley.net>
parents:
273
diff
changeset
|
45 uninstall: |
5b948171e495
Add uninstall and uninstall_flat.
Rob Landley <rob@landley.net>
parents:
273
diff
changeset
|
46 scripts/install.sh --long --uninstall |
5b948171e495
Add uninstall and uninstall_flat.
Rob Landley <rob@landley.net>
parents:
273
diff
changeset
|
47 |
1679
ce1d240b8ec8
Clean up the output of "make change".
Rob Landley <rob@landley.net>
parents:
1606
diff
changeset
|
48 change: |
1694
a5901bfefda5
Move guts of "make change" to scripts/change.sh, don't try to build sh or help standalone.
Rob Landley <rob@landley.net>
parents:
1679
diff
changeset
|
49 scripts/change.sh |
1578
a34104fc7544
Add "make change" target to build the big toybox binary as a bunch of little ones (in the "change" subdirectory), and tweak scripts/make.sh to avoid redundant work when rebuilding.
Rob Landley <rob@landley.net>
parents:
1492
diff
changeset
|
50 |
14
f8e628f61f16
Make the config generate gen_config.h with CFG_ and USE() macros.
Rob Landley <rob@landley.net>
parents:
7
diff
changeset
|
51 clean:: |
1579
302f271e8d5d
Add "change" subdirectory to make clean.
Rob Landley <rob@landley.net>
parents:
1578
diff
changeset
|
52 rm -rf toybox toybox_unstripped generated change .singleconfig* |
14
f8e628f61f16
Make the config generate gen_config.h with CFG_ and USE() macros.
Rob Landley <rob@landley.net>
parents:
7
diff
changeset
|
53 |
f8e628f61f16
Make the config generate gen_config.h with CFG_ and USE() macros.
Rob Landley <rob@landley.net>
parents:
7
diff
changeset
|
54 distclean: clean |
1179
260cce6c3e35
Replace python help converter with C implementation.
Rob Landley <rob@landley.net>
parents:
1113
diff
changeset
|
55 rm -f toybox_old .config* |
41
a43bdc6f53af
Add bloat-o-meter, make bloatcheck, and scripts/showasm.
Rob Landley <rob@landley.net>
parents:
38
diff
changeset
|
56 |
133
a459c6b39645
Fix makefile to defconfig properly, and leak in a bit of the new test
Rob Landley <rob@landley.net>
parents:
123
diff
changeset
|
57 test: tests |
a459c6b39645
Fix makefile to defconfig properly, and leak in a bit of the new test
Rob Landley <rob@landley.net>
parents:
123
diff
changeset
|
58 |
a459c6b39645
Fix makefile to defconfig properly, and leak in a bit of the new test
Rob Landley <rob@landley.net>
parents:
123
diff
changeset
|
59 tests: |
275
005af6006ce3
Update help, move test.sh to scripts, and fix "make test" to call right script.
Rob Landley <rob@landley.net>
parents:
274
diff
changeset
|
60 scripts/test.sh |
133
a459c6b39645
Fix makefile to defconfig properly, and leak in a bit of the new test
Rob Landley <rob@landley.net>
parents:
123
diff
changeset
|
61 |
41
a43bdc6f53af
Add bloat-o-meter, make bloatcheck, and scripts/showasm.
Rob Landley <rob@landley.net>
parents:
38
diff
changeset
|
62 help:: |
233
d4176f3f3835
Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents:
232
diff
changeset
|
63 @echo ' toybox - Build toybox.' |
1606
26287486fddc
Add "make help" entry for "make change".
Rob Landley <rob@landley.net>
parents:
1579
diff
changeset
|
64 @echo ' change - Build each command standalone under change/.' |
41
a43bdc6f53af
Add bloat-o-meter, make bloatcheck, and scripts/showasm.
Rob Landley <rob@landley.net>
parents:
38
diff
changeset
|
65 @echo ' baseline - Create busybox_old for use by bloatcheck.' |
a43bdc6f53af
Add bloat-o-meter, make bloatcheck, and scripts/showasm.
Rob Landley <rob@landley.net>
parents:
38
diff
changeset
|
66 @echo ' bloatcheck - Report size differences between old and current versions' |
233
d4176f3f3835
Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents:
232
diff
changeset
|
67 @echo ' test - Run test suite against compiled commands.' |
d4176f3f3835
Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents:
232
diff
changeset
|
68 @echo ' clean - Delete temporary files.' |
400 | 69 @echo " distclean - Delete everything that isn't shipped." |
70 @echo ' install_flat - Install toybox into $$PREFIX directory.' | |
71 @echo ' install - Install toybox into subdirectories of $$PREFIX.' | |
72 @echo ' uninstall_flat - Remove toybox from $$PREFIX directory.' | |
73 @echo ' uninstall - Remove toybox from subdirectories of $$PREFIX.' | |
429
27104029d771
Add a basic README and an example to "make help".
Rob Landley <rob@landley.net>
parents:
426
diff
changeset
|
74 @echo '' |
27104029d771
Add a basic README and an example to "make help".
Rob Landley <rob@landley.net>
parents:
426
diff
changeset
|
75 @echo 'example: CFLAGS="--static" CROSS_COMPILE=armv5l- make defconfig toybox install' |
27104029d771
Add a basic README and an example to "make help".
Rob Landley <rob@landley.net>
parents:
426
diff
changeset
|
76 @echo '' |