Better dependencies, and feed the linker --gc-sections. (Which is not an
substitute for building just the stuff we need, but is easy to do for now.)
This commit is contained in:
parent
63d41686d8
commit
7fc43f7978
6
Makefile
6
Makefile
@ -11,6 +11,8 @@ all: toybox
|
|||||||
|
|
||||||
include kconfig/Makefile
|
include kconfig/Makefile
|
||||||
|
|
||||||
|
.config: Config.in toys/Config.in
|
||||||
|
|
||||||
# The long and roundabout sed is to make old versions of sed happy. New ones
|
# The long and roundabout sed is to make old versions of sed happy. New ones
|
||||||
# have '\n' so can replace one line with two without all the branches and
|
# have '\n' so can replace one line with two without all the branches and
|
||||||
# mucking about with hold space.
|
# mucking about with hold space.
|
||||||
@ -26,9 +28,9 @@ gen_config.h: .config
|
|||||||
# Actual build
|
# Actual build
|
||||||
|
|
||||||
toyfiles = main.c toys/*.c lib/*.c
|
toyfiles = main.c toys/*.c lib/*.c
|
||||||
toybox: gen_config.h $(toyfiles)
|
toybox: gen_config.h $(toyfiles) lib/lib.h toys.h
|
||||||
$(CC) -Wall -Os -s -funsigned-char $(CFLAGS) -I . \
|
$(CC) -Wall -Os -s -funsigned-char $(CFLAGS) -I . \
|
||||||
$(toyfiles) -o toybox
|
$(toyfiles) -o toybox -ffunction-sections -fdata-sections -Wl,--gc-sections
|
||||||
|
|
||||||
clean::
|
clean::
|
||||||
rm -f toybox gen_config.h
|
rm -f toybox gen_config.h
|
||||||
|
Loading…
Reference in New Issue
Block a user