OSDN Git Service

Merge remote-tracking branch 'toybox/master' into HEAD
[android-x86/external-toybox.git] / Makefile
1 # Makefile for toybox.
2 # Copyright 2006 Rob Landley <rob@landley.net>
3
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".
7
8 HOSTCC?=cc
9
10 export CROSS_COMPILE CFLAGS OPTIMIZE LDOPTIMIZE CC HOSTCC V
11
12 all: toybox
13
14 KCONFIG_CONFIG ?= .config
15
16 toybox_stuff: $(KCONFIG_CONFIG) *.[ch] lib/*.[ch] toys/*.h toys/*/*.c scripts/*.sh
17
18 toybox toybox_unstripped: toybox_stuff
19         scripts/make.sh
20
21 .PHONY: clean distclean baseline bloatcheck install install_flat \
22         uinstall uninstall_flat test tests help toybox_stuff change
23
24 include kconfig/Makefile
25
26 $(KCONFIG_CONFIG): $(KCONFIG_TOP)
27 $(KCONFIG_TOP): generated/Config.in
28 generated/Config.in: toys/*/*.c scripts/genconfig.sh
29         scripts/genconfig.sh
30
31 # Development targets
32 baseline: toybox_unstripped
33         @cp toybox_unstripped toybox_old
34
35 bloatcheck: toybox_old toybox_unstripped
36         @scripts/bloatcheck toybox_old toybox_unstripped
37
38 install_flat:
39         scripts/install.sh --symlink --force
40
41 install:
42         scripts/install.sh --long --symlink --force
43
44 uninstall_flat: generated/instlist
45         scripts/install.sh --uninstall
46
47 uninstall:
48         scripts/install.sh --long --uninstall
49
50 change:
51         scripts/change.sh
52
53 clean::
54         rm -rf toybox toybox_unstripped generated change .singleconfig*
55
56 distclean: clean
57         rm -f toybox_old .config*
58
59 test: tests
60
61 tests:
62         scripts/test.sh
63
64 help::
65         @echo  '  toybox          - Build toybox.'
66         @echo  '  change          - Build each command standalone under change/.'
67         @echo  '  baseline        - Create toybox_old for use by bloatcheck.'
68         @echo  '  bloatcheck      - Report size differences between old and current versions'
69         @echo  '  test            - Run test suite against compiled commands.'
70         @echo  '  clean           - Delete temporary files.'
71         @echo  "  distclean       - Delete everything that isn't shipped."
72         @echo  '  install_flat    - Install toybox into $$PREFIX directory.'
73         @echo  '  install         - Install toybox into subdirectories of $$PREFIX.'
74         @echo  '  uninstall_flat  - Remove toybox from $$PREFIX directory.'
75         @echo  '  uninstall       - Remove toybox from subdirectories of $$PREFIX.'
76         @echo  ''
77         @echo  'example: CFLAGS="--static" CROSS_COMPILE=armv5l- make defconfig toybox install'
78         @echo  ''