comparison Makefile @ 41:a43bdc6f53af

Add bloat-o-meter, make bloatcheck, and scripts/showasm.
author Rob Landley <rob@landley.net>
date Sun, 26 Nov 2006 18:47:14 -0500
parents b707dfcd403c
children 72ff42c01d92
comparison
equal deleted inserted replaced
40:d046f8d1401e 41:a43bdc6f53af
1 # Makefile for toybox. 1 # Makefile for toybox.
2 # Copyright 2006 Rob Landley <rob@landley.net> 2 # Copyright 2006 Rob Landley <rob@landley.net>
3 3
4 CFLAGS = -Wall -Wundef -Os -s 4 CFLAGS = -Wall -Wundef -Os
5 CC = $(CROSS_COMPILE)gcc $(CFLAGS) -funsigned-char 5 CC = $(CROSS_COMPILE)gcc $(CFLAGS) -funsigned-char
6 STRIP = $(CROSS_COMPILE)strip
6 HOST_CC = gcc $(CFLAGS) -funsigned-char 7 HOST_CC = gcc $(CFLAGS) -funsigned-char
7 8
8 all: toybox 9 all: toybox
9 10
10 .PHONY: clean 11 .PHONY: clean
23 -e 'g' -e 's/.*/#define USE_&(...)/p' -e 'd' -e ':tryisset' \ 24 -e 'g' -e 's/.*/#define USE_&(...)/p' -e 'd' -e ':tryisset' \
24 -e 's/^CONFIG_\(.*\)=y.*/\1/' -e 't isset' -e 'd' -e ':isset' \ 25 -e 's/^CONFIG_\(.*\)=y.*/\1/' -e 't isset' -e 'd' -e ':isset' \
25 -e 'h' -e 's/.*/#define CFG_& 1/p' \ 26 -e 'h' -e 's/.*/#define CFG_& 1/p' \
26 -e 'g' -e 's/.*/#define USE_&(...) __VA_ARGS__/p' $< > $@ 27 -e 'g' -e 's/.*/#define USE_&(...) __VA_ARGS__/p' $< > $@
27 28
29 # Development targets
30 baseline: toybox_unstripped
31 @cp toybox_unstripped toybox_old
32
33 bloatcheck: toybox_old toybox_unstripped
34 @scripts/bloat-o-meter toybox_old toybox_unstripped
35
28 # Actual build 36 # Actual build
29 37
30 toyfiles = main.c toys/*.c lib/*.c 38 toyfiles = main.c toys/*.c lib/*.c
31 toybox: gen_config.h $(toyfiles) toys/toylist.h lib/lib.h toys.h 39 toybox_unstripped: gen_config.h $(toyfiles) toys/toylist.h lib/lib.h toys.h
32 $(CC) $(CFLAGS) -I . $(toyfiles) -o toybox \ 40 $(CC) $(CFLAGS) -I . $(toyfiles) -o toybox_unstripped \
33 -ffunction-sections -fdata-sections -Wl,--gc-sections 41 -ffunction-sections -fdata-sections -Wl,--gc-sections
34 42
43 toybox: toybox_unstripped
44 $(STRIP) toybox_unstripped -o toybox
35 clean:: 45 clean::
36 rm -f toybox gen_config.h 46 rm -f toybox gen_config.h
37 47
38 distclean: clean 48 distclean: clean
39 rm -f .config 49 rm -f .config
50
51 help::
52 @echo ' baseline - Create busybox_old for use by bloatcheck.'
53 @echo ' bloatcheck - Report size differences between old and current versions'