| #
2e480519 |
| 19-Sep-2024 |
Jens Wiklander <jens.wiklander@linaro.org> |
mk/subdir.mk: introduce srcs_ext-y and srcs_ext_base-y
Introduce two new variables srcs_ext-y and srcs_ext_base-y to deal with compiling source code outside of this git (optee_os.git).
srcs_ext_bas
mk/subdir.mk: introduce srcs_ext-y and srcs_ext_base-y
Introduce two new variables srcs_ext-y and srcs_ext_base-y to deal with compiling source code outside of this git (optee_os.git).
srcs_ext_base-y assigns the root directory of the external source files to compile. srcs_ext-y works as srcs-y except that it's relative to the $(srcs_ext_base-y) directory.
Introduce the per source file variable oname-<file name>-y to override the default output object file name. This helps to shorten and make a more sane name for the output object file name when the source file is outside optee_os source tree, for instance, a third-party library.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| #
5db2cbd7 |
| 19-Sep-2024 |
Jens Wiklander <jens.wiklander@linaro.org> |
mk: introduce global-incdirs_ext-y
Introduce the global-incdirs_ext-y variable to deal with including header files from outside of this git (optee_os.git).
Signed-off-by: Jens Wiklander <jens.wikla
mk: introduce global-incdirs_ext-y
Introduce the global-incdirs_ext-y variable to deal with including header files from outside of this git (optee_os.git).
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| #
43d2c044 |
| 19-Sep-2024 |
Jens Wiklander <jens.wiklander@linaro.org> |
mk/subdir.mk: refactor process-subdir-{srcs-y,gensrcs-helper}
Moves the common parts of the two make macros process-subdir-srcs-y and process-subdir-gensrcs-helper into a new macro, process-file-var
mk/subdir.mk: refactor process-subdir-{srcs-y,gensrcs-helper}
Moves the common parts of the two make macros process-subdir-srcs-y and process-subdir-gensrcs-helper into a new macro, process-file-vars.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| #
b7c039eb |
| 18-Oct-2024 |
Jens Wiklander <jens.wiklander@linaro.org> |
mk: add global-cppflags-y
Add global-cppflags-y as a new sub.mk variable. The content of the variable is added to the C preprocessor flags passed to all files compiled in the current submodule, $(sm
mk: add global-cppflags-y
Add global-cppflags-y as a new sub.mk variable. The content of the variable is added to the C preprocessor flags passed to all files compiled in the current submodule, $(sm), similarly to how the content of global-incdirs-y is passed on.
This flag is intended for libraries that in addition to exporting an include path also need certain defines set.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| #
001524d4 |
| 06-May-2022 |
Jerome Forissier <jerome.forissier@linaro.org> |
build: allow multiple occurrences of the same directory in subdirs-y
This change enables adding the same directory several times to subdirs-y in sub.mk without causing warnings. This means we can no
build: allow multiple occurrences of the same directory in subdirs-y
This change enables adding the same directory several times to subdirs-y in sub.mk without causing warnings. This means we can now use patterns such as:
subdirs-$(CFG_FOO) += foobar subdirs-$(CFG_BAR) += foobar
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
d50ff941 |
| 19-Jan-2022 |
Jorge Ramirez-Ortiz <jorge@foundries.io> |
mk/subdir.mk: handle repositories outside the OP-TEE tree
The tags incdirs_ext and subdirs_ext allows specifying paths outside the current tree.
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.
mk/subdir.mk: handle repositories outside the OP-TEE tree
The tags incdirs_ext and subdirs_ext allows specifying paths outside the current tree.
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Reviewed-by: Jerome Forissier <jerome@forissier.org>
show more ...
|
| #
4010618f |
| 14-Aug-2020 |
Jerome Forissier <jerome@forissier.org> |
mk/subdir.mk: handle C++ flags related variables
Adds proper handling of cxxflags-y, cxxflags-<file name>-y, cxxflags-remove-y, cxxflags-remove-<file name>-y, cxxflags-lib-y in the same way as for C
mk/subdir.mk: handle C++ flags related variables
Adds proper handling of cxxflags-y, cxxflags-<file name>-y, cxxflags-remove-y, cxxflags-remove-<file name>-y, cxxflags-lib-y in the same way as for C flags.
Fixes: be3bc461c686 ("ta: experimental C++ support") Signed-off-by: Jerome Forissier <jerome@forissier.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
098883e8 |
| 17-Jul-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
subdir.mk: clear aflags-remove-y after processing
After processing a sub.mk by subdir.mk also clear aflags-remove-y together with the rest of the variables to clear.
Reviewed-by: Jerome Forissier <
subdir.mk: clear aflags-remove-y after processing
After processing a sub.mk by subdir.mk also clear aflags-remove-y together with the rest of the variables to clear.
Reviewed-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
3e3182ab |
| 13-May-2020 |
Jerome Forissier <jerome@forissier.org> |
mk/subdir.mk: avoid trailing slash in $(sub-dir-out)
As a general rule, paths to directories should not end with a slash [1]. In some cases, $(sub-dir-out) does not meet this requirement. For exampl
mk/subdir.mk: avoid trailing slash in $(sub-dir-out)
As a general rule, paths to directories should not end with a slash [1]. In some cases, $(sub-dir-out) does not meet this requirement. For example when building the 'crypt' TA in the optee_test project:
GEN /tmp/optee/optee_test/out/ta/crypt//ca_crt.c CC /tmp/optee/optee_test/out/ta/crypt//ca_crt.o GEN /tmp/optee/optee_test/out/ta/crypt//mid_crt.c CC /tmp/optee/optee_test/out/ta/crypt//mid_crt.o GEN /tmp/optee/optee_test/out/ta/crypt//mid_key.c CC /tmp/optee/optee_test/out/ta/crypt//mid_key.o
In this example, $(sub-dir-out) is /tmp/optee/optee_test/out/ta/crypt/.
This patch removes the trailing slash.
[1] commit 4334e8d79fa3 ("Makefile variables $(*-dir) should not have a trailing slash")
Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
27fd7c71 |
| 23-Oct-2019 |
Jerome Forissier <jerome@forissier.org> |
mk: gensrc: add generated file to $(cleanfiles) automatically
The gensrc mechanism should not require the user to update the cleanfiles variable since it can do it by itself. This commit updates the
mk: gensrc: add generated file to $(cleanfiles) automatically
The gensrc mechanism should not require the user to update the cleanfiles variable since it can do it by itself. This commit updates the implementation and simplifies the call sites.
Signed-off-by: Jerome Forissier <jerome@forissier.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
cba8ca1c |
| 13-Sep-2019 |
Jerome Forissier <jerome@forissier.org> |
build: prevent produce-* from being forced built before current submodule
Problem:
$ make -s out/arm-plat-vexpress/core/mm/fobj.o $ rm out/arm-plat-vexpress/ldelf/ldelf.elf $ rm out/arm-plat-vex
build: prevent produce-* from being forced built before current submodule
Problem:
$ make -s out/arm-plat-vexpress/core/mm/fobj.o $ rm out/arm-plat-vexpress/ldelf/ldelf.elf $ rm out/arm-plat-vexpress/core/mm/fobj.o $ make out/arm-plat-vexpress/core/mm/fobj.o CHK out/arm-plat-vexpress/conf.mk CHK out/arm-plat-vexpress/include/generated/conf.h LD out/arm-plat-vexpress/ldelf/ldelf.elf GEN out/arm-plat-vexpress/core/ldelf_hex.c CC out/arm-plat-vexpress/core/mm/fobj.o
Why would fobj.o depend on ldelf.elf and ldelf_hex.c? Answer is: it shouldn't. This behavior is caused by FORCE-GENSRC$(sm) depending on all the produce-<something> targets. In fact, such a dependency is rarely needed. It makes sense for include files for instance; but certainly not for C source files which are pulled in the build by other means.
This patch introduces force-gensrc-<something> to prevent the generated file $(produce-<something>) from being added to FORCE-GENSRC$(sm) unless $(force-gensrcs-<something>) is "y". The test case above works as expected:
$ make -s out/arm-plat-vexpress/core/mm/fobj.o $ rm out/arm-plat-vexpress/ldelf/ldelf.elf $ rm out/arm-plat-vexpress/core/mm/fobj.o $ make out/arm-plat-vexpress/core/mm/fobj.o CHK out/arm-plat-vexpress/conf.mk CHK out/arm-plat-vexpress/include/generated/conf.h CC out/arm-plat-vexpress/core/mm/fobj.o
Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
94cd76ca |
| 17-Jul-2018 |
Jens Wiklander <jens.wiklander@linaro.org> |
Use per $(sm) unique FORCE-GENSRC
Uses per $(sm) unique FORCE-GENSRC to allow one submodule (sm) depend on files produced by another submodule.
CFG_IN_TREE_EARLY_TAS needs this for the core submodu
Use per $(sm) unique FORCE-GENSRC
Uses per $(sm) unique FORCE-GENSRC to allow one submodule (sm) depend on files produced by another submodule.
CFG_IN_TREE_EARLY_TAS needs this for the core submodule to depend on a submodule representing an in-tree TA.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
070168e2 |
| 12-Mar-2018 |
Jerome Forissier <jerome.forissier@linaro.org> |
build: introduce asm-defines-y
The Makefile rules that are used to generate a C header file containing constants for struct offsets etc. are currently in mk/compile.mk. They are used by core.mk whic
build: introduce asm-defines-y
The Makefile rules that are used to generate a C header file containing constants for struct offsets etc. are currently in mk/compile.mk. They are used by core.mk which sets a variable (asm-defines-file) before it includes compile.mk. This works well for this purpose, but does not scale to several files.
There is a use case for platform code to be able to use the asm-defines mechanism, too. Therefore, introduce a variable that can be used in any sub.mk: asm-defines-y.
In addition, to avoid duplication, the DEFINE and DEFINES macros are moved to their own header (core/include/gen-asm-defines.h), with the added benefit that it can be explicitly excluded from the checkpatch list and thus not generate any warning on the 'DEFINE' macro needing parentheses.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Tested-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| #
13301e12 |
| 06-Apr-2017 |
Jens Wiklander <jens.wiklander@linaro.org> |
mk/subdir.mk: clear gen-srcs when initializing
When initializing in mk/subdir.mk to process another sub.mk clear gen-srcs also to avoid leftovers from previous sub.mk.
Reviewed-by: Etienne Carriere
mk/subdir.mk: clear gen-srcs when initializing
When initializing in mk/subdir.mk to process another sub.mk clear gen-srcs also to avoid leftovers from previous sub.mk.
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Tested-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
606f378c |
| 13-Oct-2016 |
Jerome Forissier <jerome.forissier@linaro.org> |
build: include submodule in name of per-library variables
Because a library may be built several times for different submodules (for example, libutils.a is built differently for kernel and user mode
build: include submodule in name of per-library variables
Because a library may be built several times for different submodules (for example, libutils.a is built differently for kernel and user mode), the names of the variables that hold library-specific flags have to uniquely identify the instance of the library that's being built.
Example use case: to build libutils with flag FOO for the core and flag BAR for the user mode, add this to lib/libutils/sub.mk:
ifeq ($(sm),core) cppflags-lib-y += -DFOO else cppflags-lib-y += -DBAR endif
Without this fix, the above would fail because all the flags would be added to all the builds of libutils.
Fixes: 3d34e125a253 ("Add support for $(cflags-lib-y)") Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| #
c95ce41f |
| 30-May-2016 |
Jens Wiklander <jens.wiklander@linaro.org> |
build: remove old gensrc facility
Removes the build facility for auto generated source files now that it's replaced by a new and more advanced.
Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Rev
build: remove old gensrc facility
Removes the build facility for auto generated source files now that it's replaced by a new and more advanced.
Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
36a06054 |
| 02-Jun-2016 |
Jens Wiklander <jens.wiklander@linaro.org> |
mk: add new gensrc build facility
Adds a new build facility for auto generated source files.
Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro
mk: add new gensrc build facility
Adds a new build facility for auto generated source files.
Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
3d34e125 |
| 30-Oct-2014 |
Jerome Forissier <jerome.forissier@linaro.org> |
Add support for $(cflags-lib-y)
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Pascal Brand <pascal.brand@linaro.o
Add support for $(cflags-lib-y)
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Pascal Brand <pascal.brand@linaro.org> Tested-by: Pascal Brand <pascal.brand@linaro.org> (STM platform)
show more ...
|
| #
73dc728d |
| 25-Sep-2014 |
Jerome Forissier <jerome.forissier@linaro.org> |
Add support for per-directory/per-library/per-file includes, and per-library CPP flags
The new variables that can be used in sub.mk are:
1) For includes: incdirs-y, incdirs-lib-y, incdirs-<filena
Add support for per-directory/per-library/per-file includes, and per-library CPP flags
The new variables that can be used in sub.mk are:
1) For includes: incdirs-y, incdirs-lib-y, incdirs-<filename>-y
For example, suppose core/lib/libfoo/sub.mk contains the following:
# All source files declared in $(srcs-y) in this sub.mk will # have -Icore/lib/libfoo/include incdirs-y := include
# All source files for the current library $(libname) will be built # with -Icore/lib/libfoo/include/baz (even files that are in other # directories) incdirs-lib-y := include/baz
# In addition to the above, bar.c will be compiled with # -Icore/lib/libfoo/include/bar incdirs-bar.c-y := include/bar
2) For CPP flags: cppflags-lib-y
For example, to add -DLIBFOO to all the source files that belong to the same library, add this to any of the sub.mk files:
cppflags-lib-y := -DLIBFOO
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Pascal Brand <pascal.brand@linaro.org> Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (QEMU virt platform)
show more ...
|
| #
4334e8d7 |
| 08-Sep-2014 |
Jerome Forissier <jerome.forissier@linaro.org> |
Makefile variables $(*-dir) should not have a trailing slash
As a general rule, Makefile variables that are directories should not have a trailing slash, and should be used as: $(some-dir)/some-file
Makefile variables $(*-dir) should not have a trailing slash
As a general rule, Makefile variables that are directories should not have a trailing slash, and should be used as: $(some-dir)/some-file rather than $(some-dir)some-file. This is more readable.
show more ...
|
| #
565e42f9 |
| 07-Aug-2014 |
Pascal Brand <pascal.brand@st.com> |
subdir.mk supports absolute path
Signed-off-by: Pascal Brand <pascal.brand@st.com>
|
| #
b0104773 |
| 12-Jun-2014 |
Pascal Brand <pascal.brand@st.com> |
Open-source the TEE Core
Signed-off-by: Pascal Brand <pascal.brand@st.com>
|