Makefile revision fcf188ffdba160303c1e8e59819239d3bf9f31ad
1# Makefile for toybox.
2# Copyright 2006 Rob Landley <rob@landley.net>
3
4all: toybox
5
6toybox toybox_unstripped: .config *.[ch] lib/*.[ch] toys/*.[ch] scripts/*.sh
7	scripts/make.sh
8
9.PHONY: clean distclean baseline bloatcheck install install_flat \
10	uinstall uninstall_flat test tests help scripts/test
11
12include kconfig/Makefile
13
14$(KCONFIG_TOP): generated/Config.in
15generated/Config.in: toys/*.c scripts/genconfig.sh
16	scripts/genconfig.sh
17
18HOSTCC?=cc
19
20# Development targets
21baseline: toybox_unstripped
22	@cp toybox_unstripped toybox_old
23
24bloatcheck: toybox_old toybox_unstripped
25	@scripts/bloat-o-meter toybox_old toybox_unstripped
26
27instlist: toybox
28	$(HOSTCC) $(CCFLAGS) -I . scripts/install.c -o instlist
29
30install_flat: instlist
31	scripts/install.sh --symlink --force
32
33install:
34	scripts/install.sh --long --symlink --force
35
36uninstall_flat: instlist
37	scripts/install.sh --uninstall
38
39uninstall:
40	scripts/install.sh --long --uninstall
41
42clean::
43	rm -rf toybox toybox_unstripped generated/config.h generated/Config.in \
44		generated/newtoys.h generated/globals.h instlist testdir
45
46distclean: clean
47	rm -f toybox_old .config* generated/help.h
48
49test: tests
50
51tests:
52	scripts/test.sh
53
54help::
55	@echo  '  toybox          - Build toybox.'
56	@echo  '  baseline        - Create busybox_old for use by bloatcheck.'
57	@echo  '  bloatcheck      - Report size differences between old and current versions'
58	@echo  '  test            - Run test suite against compiled commands.'
59	@echo  '  clean           - Delete temporary files.'
60	@echo  "  distclean       - Delete everything that isn't shipped."
61	@echo  '  install_flat    - Install toybox into $$PREFIX directory.'
62	@echo  '  install         - Install toybox into subdirectories of $$PREFIX.'
63	@echo  '  uninstall_flat  - Remove toybox from $$PREFIX directory.'
64	@echo  '  uninstall       - Remove toybox from subdirectories of $$PREFIX.'
65	@echo  ''
66	@echo  'example: CFLAGS="--static" CROSS_COMPILE=armv5l- make defconfig toybox install'
67	@echo  ''
68