OSDN Git Service

Don't delete testdir after running test.sh. Add it to make clean instead.
[android-x86/external-toybox.git] / Makefile
1 # Makefile for toybox.
2 # Copyright 2006 Rob Landley <rob@landley.net>
3
4 all: toybox
5
6 toybox toybox_unstripped: .config *.[ch] lib/*.[ch] toys/*.[ch] scripts/*
7         scripts/make.sh
8
9 .PHONY: clean distclean baseline bloatcheck install_flat test tests help
10
11 include kconfig/Makefile
12
13 $(KCONFIG_TOP): generated/Config.in
14 generated/Config.in:
15         scripts/genconfig.sh
16
17 HOSTCC:=cc
18
19 # Development targets
20 baseline: toybox_unstripped
21         @cp toybox_unstripped toybox_old
22
23 bloatcheck: toybox_old toybox_unstripped
24         @scripts/bloat-o-meter toybox_old toybox_unstripped
25
26 instlist: toybox
27         $(HOSTCC) $(CCFLAGS) -I . scripts/install.c -o instlist
28
29 install_flat: instlist
30         @mkdir -p $(PREFIX)/
31         @cp toybox $(PREFIX)/
32         @for i in `./instlist`; do ln -s toybox "$(PREFIX)/$$i"; done
33
34 clean::
35         rm -rf toybox toybox_unstripped generated/config.h generated/Config.in \
36                 generated/newtoys.h generated/globals.h instlist testdir
37
38 distclean: clean
39         rm -f toybox_old .config* generated/help.h
40
41 test: tests
42
43 tests:
44         scripts/testall.sh
45
46 help::
47         @echo  '  toybox          - Build toybox.'
48         @echo  '  baseline        - Create busybox_old for use by bloatcheck.'
49         @echo  '  bloatcheck      - Report size differences between old and current versions'
50         @echo  '  test            - Run test suite against compiled commands.'
51         @echo  '  clean           - Delete temporary files.'
52         @echo  '  distclean       - Delete everything that isn't shipped.'
53         @echo  '  install_flat    - Install toybox into $PREFIX directory.'