When lib/version was included, a rule depended on .PHONY. This would
unexpectedly invoke other rules defined as dependent on .PHONY (standard
phony-ness signal).
As a side effect, this used to generate srcfiles.txt and
include_paths.txt in build dir. Since they are useful, we might always
build those anyway, and not make them phony at all.
This allows for individual modules to extend the main linker script,
primarily to add their own sections to interate over.
Remove the main shared_* linker scripts.
All makefiles added to EXTRA_BUILDRULES variable
will be included right before processing bulk of build.mk
Change-Id: Ic37e37ea7469ee57e6f6543f378c5d0c1510824b
-Have arch set the default optimization level. Most will use
O2, but arm-m sets to Os.
-Make the link time garbage collection be optional. Only set
for arm-m.
To be more consistent, rename make variable INCLUDES to GLOBAL_INCLUDES.
Also remove the need to put -I in front of each field, the make system
will do that for you.
To fix your module makefiles:
-Change INCLUDES -> GLOBAL_INCLUDES
-Remove -I prefix
Using environment variables LKROOT and LKINC you can specify multiple
parallel top level directories (outside of the lk root) that are overlayed
on top of the build system. This allows for a structure like
lk/
testproject/
someotherfirmware/
Where each of these subdirs has an entire overlayed tree of libraries, platforms,
targets, and projects.
To accomplish this, copy makefile into the root dir and build a lk_inc.mk that
sets LKROOT and LKINC.
-Each module's rules.mk defines a seperate linkage unit. Each
module can have a private set of CFLAGS, DEFINES, INCLUDES, and so
forth.
-Files to be compiled are now added by source, not object.
Most rules.mk files can be converted easily by following these steps:
1) add 'MODULE := $(LOCAL_DIR)' near the top of the file
2) change OBJS += to MODULE_SRCS += and list source files instead of .os
3) add 'include make/module.mk' at the bottom of the file
See make/module.mk for directions.