Makefile revision b1aaba1fc8176ac0b7c202a664d2554aa0967116
1# Makefile for toybox.
2# Copyright 2006 Rob Landley <rob@landley.net>
3
4all: toybox
5
6toybox toybox_unstripped:
7	scripts/make.sh
8
9.PHONY: clean distclean baseline bloatcheck install_flat test tests help \
10	toybox toybox_unstripped
11
12include kconfig/Makefile
13
14$(KCONFIG_TOP): generated/Config.in
15generated/Config.in:
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	@mkdir -p $(PREFIX)/
32	@cp toybox $(PREFIX)/
33	@for i in `./instlist`; do ln -s toybox "$(PREFIX)/$$i"; done
34
35clean::
36	rm -f toybox toybox_unstripped generated/config.h generated/Config.in \
37		generated/newtoys.h generated/globals.h instlist
38
39distclean: clean
40	rm -f toybox_old .config* generated/help.h
41
42test: tests
43
44tests:
45	scripts/testall.sh
46
47help::
48	@echo  '  toybox          - Build toybox.'
49	@echo  '  baseline        - Create busybox_old for use by bloatcheck.'
50	@echo  '  bloatcheck      - Report size differences between old and current versions'
51	@echo  '  test            - Run test suite against compiled commands.'
52	@echo  '  clean           - Delete temporary files.'
53	@echo  '  distclean       - Delete everything that isn't shipped.'
54	@echo  '  install_flat    - Install toybox into $PREFIX directory.'
55