aboutsummaryrefslogtreecommitdiff
path: root/Makefile
AgeCommit message (Collapse)Author
2019-01-08cscope: do not exclude generated filesJerome Forissier
The build directory contains some generated source files, such as include/generated/conf.h, core/include/generated/arm32_sysreg.{h,S} and core/include/generated/asm-defines.h. Let cscope parse them and only exclude the files that are copied into the export-ta_* directories (TA dev kit). Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
2018-12-18Introduce CFG_USER_TA_TARGETS to select user mode architecture(s)Jerome Forissier
This change introduces CFG_USER_TA_TARGETS to allow the configuration directives to select the architectures for which userspace TA and TA libraries shall be built. The only use case for the moment is to be able to build only 32 or 64-bit libraries and TAs when the platform would otherwise support both 32 and 64-bit. See the example below. If CFG_USER_TA_TARGETS is undefined or empty, all the architectures supported by the platform are built. If CFG_USER_TA_TARGETS contains an unsupported value, the build will report an error. Examples: $ make PLATFORM=hikey CFG_ARM64_core=y # Builds both 32 and 64-bit userspace $ make PLATFORM=hikey CFG_ARM64_core=y \ CFG_USER_TA_TARGETS="ta_arm32 ta_arm64" # Same as above $ make PLATFORM=hikey CFG_ARM64_core=y CFG_USER_TA_TARGETS=ta_arm32 # Builds only 32-bit userspace Suggested-by: Etienne Carriere <etienne.carriere@linaro.org> 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>
2018-12-17Add checkpatch targets to MakefileMarkus S. Wamser
+ added target for calling checkpatch on working and staging area + added documentation for targets in Readme Signed-off-by: Markus S. Wamser <markus.wamser@mixed-mode.de> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
2018-07-18Add support for compiling in-tree TAsJens Wiklander
Adds support for compiling in-tree TAs. Unless specified via CFG_USER_TA_TARGET_<ta-name> the TA will be built with the first TA target (aka TA dev kit, when delivered) specified in the variable ta-targets which is initialized in core/arch/arm/plat-*/conf.mk. Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
2018-02-04Force ARCH to armVictor Chong
It is the only value used for now. No other value works, not even aarch64. Signed-off-by: Victor Chong <victor.chong@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
2018-01-31cscope: skip in tree out directoryJens Wiklander
By default if nothing is specified OP-TEE is built keeping the output under the directory "out" in the source tree. With this patch the cscope database will not include those files. Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
2017-10-26make clean: split file list into manageable chunksJerome Forissier
"make clean" might fail with the following error: make[2]: execvp: /bin/bash: Argument list too long This error was observed on a platform that has lots of additional source files compared to upstream (drivers, etc.), and that sets a long output path on the command line (make ... O=/some/long/path). Fix the error by splitting the file list into more manageable chunks. Note that removing one file at a time is not reasonable, because spawning too may shells takes quite a long time (up to 7-10 seconds to "make clean"). Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reported-by: Lijianhui <airbak.li@hisilicon.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
2017-02-08make clean: don't fail on non-empty directoryJerome Forissier
"make clean" may report errors when trying to clean with different configuration values than the ones used during the build. For instance: $ make -s CFG_RPMB_FS=y $ make clean CLEAN out/arm-plat-vexpress rmdir: failed to remove 'out/arm-plat-vexpress/core/tee': Directory not empty rmdir: failed to remove 'out/arm-plat-vexpress/core': Directory not empty rmdir: failed to remove 'out/arm-plat-vexpress': Directory not empty Makefile:88: recipe for target 'clean' failed make: *** [clean] Error 1 The clean command should not fail, since the build tree was properly cleaned for the requested configuration. Fix this by using 'rmdir --ignore-fail-on-non-empty'. 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>
2017-01-09Make sure "make clean" removes everything "make" has created under $(O)Jerome Forissier
"make clean" would leave behind some files and many directories. Fix this by correctly tracking the files and directories created under $(O) during the build process: - Fix incorrect file names in $(cleanfiles) and add a few missing ones. - Introduce a makefile macro: $(cleandirs-for-rmdir), defined in a new file: mk/cleandirs.mk. It returns the list of directories that should be removed, given a list of files. The clean target removes the files, then all the directories in depth- first order. $(O) is also removed, if found to be empty. Note that a more straightforward approach was discussed in [1]: use "rm -rf $(O)/some_dir" and get rid of the whole file and directory tracking via $(cleanfiles) and $(cleandirs). Although it was agreed it would be safe, doing so would necessarily break the backward compatibility for build scripts relying on "make O=<some path>", due to the additional level ($(O)/some_dir). Finally, mk/cleandirs.mk is exported to the TA dev kit and the clean rule for the TAs is updated. [1] https://github.com/OP-TEE/optee_os/pull/1270 Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Andy Green <andy@warmcat.com>
2016-12-05Makefile: unexport MAKEFILE_LIST to reduce the size of the environmentJerome Forissier
To avoid issues [1] with some projects that call us from a top-level Makefile that has an 'export' directive or a '.EXPORT_ALL_VARIABLES:' target, we prevent $(MAKEFILE_LIST) from being exported, thereby greatly reducing the size of the environment. [1] Typically, the build succeeds the first time (because there is no .cmd/.d files yet), then the second invocation of make fails with: CHK out/arm-plat-vexpress/conf.mk make[3]: execvp: /bin/bash: Argument list too long Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Tested-by: Zeng Tao <prime.zeng@hisilicon.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
2016-08-23Fix invalid default value of $(PLATFORM_FLAVOR)Jerome Forissier
Fixes the following error: $ make -s PLATFORM=stm core/arch/arm/plat-stm/system_config.mk:20: *** PLATFORM_FLAVOR=qemu_virt is not supported. Stop. (one would expect PLATFORM_FLAVOR to default to 'orly2'). This patch does the following: - Do not set "PLATFORM_FLAVOR ?= qemu_virt" in the main Makefile. The default value for PLATFORM_FLAVOR has to be defined by each platform in plat-*/conf.mk. - Consistent with the above, "PLATFORM_FLAVOR_$(PLATFORM_FLAVOR) := y" is moved to core/core.mk, after $(platform-dir)/conf.mk has been included, i.e., where $(PLATFORM_FLAVOR) can be relied upon. - All definitions of "PLATFORM_FLAVOR_$(PLATFORM_FLAVOR) := y" are removed from platform files, since it is already taken care of in core/core.mk. Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
2016-08-08Simplify platform testing macrosJerome Forissier
Update the main Makefile so that PLATFORM_$(PLATFORM) and PLATFORM_FLAVOR_$(PLATFORM_FLAVOR) are set to 'y', and add these variables to the export list for the generation of conf.h. As a result, the definition of numerical flavor identifiers in the multiple platform_config.h files is not needed anymore, and we can also get rid of the PLATFORM_FLAVOR_IS() test macro. Instead, replace all occurrences of '#if PLATFORM_FLAVOR_IS(foo)' with '#if defined(PLATFORM_FLAVOR_foo)'. This makes it possible to test the platform and not only the flavor in any source file, so drop the manual definition of PLATFORM_hikey. Finally, remove the definitions of platform_$(PLATFORM) and platform_flavor_$(PLATFORM_FLAVOR) from core/core.mk since they are not used. Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: David Brown <david.brown@linaro.org>
2016-03-15Minimal OP-TEE without user TAsJens Wiklander
Hide all user TA related code under CFG_WITH_USER_TA. When compiled with: CFG_WITH_USER_TA=n CFG_CRYPTO=n CFG_ENC_FS=n CFG_SE_API=n CFG_PCSC_PASSTHRU_READER_DRV=n Skips building in static TA tests for features not enabled. The size of OP-TEE is reduced to one third of its original size. Reviewed-by: Pascal Brand <pascal.brand@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (QEMU xtest 1001) Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
2015-12-03Add support to generate multiple TA dev kitsJens Wiklander
Adds support to generate multiple TA dev kits, one for each word in the variable "ta-targets". ta/ta.mk is included once for each word in "ta-targets" with the word assigned to "ta-target". This word is the assigned the variable "sm" to allow each "ta-target" to be built as a separate sub-module. Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Pascal Brand <pascal.brand@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
2015-07-08Build for PLATFORM=vexpress-qemu_virt by defaultJerome Forissier
Also, for STM platforms, set CROSS_COMPILE=arm-linux-gnueabihf- by default (which is a more standard prefix for the 32-bit compiler). 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>
2015-05-29Build: fix silent mode with make 3.8xPascal Brand
With make 3.8x, in case of 'make all -s -w', MAKEFLAGS equals 'ws' This patch correctly catches the flag 's' Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Pascal Brand <pascal.brand@st.com>
2015-04-30build: add support for make -sJens Wiklander
Adds support for make -s to get a really silent build. This is useful to get a shorter travis build log. Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Pascal Brand <pascal.brand@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
2015-04-13Rename arm32 architecture to armJens Wiklander
Renames arm32 directories to arm. Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (QEMU) Reviewed-by: Pascal Brand <pascal.brand@linaro.org> Tested-by: Pascal Brand <pascal.brand@linaro.org> (QEMU platform)
2015-03-10load/generate TEE Core build configuration fileetienne carriere
At build time, conf.in file is generated at output root core directory. At build entry, if CFG_OPTEE_CONFIG is defined, it specifies the path of the target TEE Core build configuration to use. Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Tested-by: Etienne CARRIERE <etienne.carriere@st.com> Reviewed-by: Pascal BRAND <pascal.brand@st.com> Reviewed-by: Etienne CARRIERE <etienne.carriere@st.com>
2014-10-30Support PLATFORM=<platform>-<flavor>Jerome Forissier
When $(PLATFORM) contains a hyphen, parse it as $(PLATFORM)-$(PLATFORM_FLAVOR). Then, one can use: $ make PLATFORM=vexpress-fvp ... instead of: $ make PLATFORM=vexpress PLATFORM_FLAVOR=fvp ... 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>
2014-09-18Add generation of memory usage report of tee.elfJens Wiklander
2014-09-09Makefile variables $(*-dir) should not have a trailing slashJerome Forissier
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.
2014-09-02Cosmetic fixes for build outputJerome Forissier
By default, the OP-TEE build shows abbreviated output similar to the Linux kernel. This commit fixes a number of deviations/inconsistencies. - Always print a command in uppercase, followed by the target file. - Make sure commands and file paths are nicely aligned, with two leading spaces to make command output/errors better stand out. - Remove some duplicate slashes in file paths. We use the following rule: variables that hold directory names such as $(arch-dir) or $(platform-dir) always have a trailing slash. The 'subdirs' and 'incdirs' variables used in sub-makefiles are an exception because doing otherwise would needlessly clutter the sub-makefiles.
2014-09-01plat-orly2 and plat-cannes merged in plat-stmPascal Brand
PLATFORM_FLAVOR is used to distinguish orly2 and cannes Change-Id: Iaed89451f704120e29b0b0adb83627f11bf9df48
2014-08-18mk/compile.mk: simplify dependency generation; better support ccacheJerome Forissier
This commit modifies the compilation flags that are used to generate dependency files (*.o.d). Rather than using the preprocessor's -MD flag (-Wp,-MD,<depfile>), we now use the frontend's equivalent (-MD -MF <depfile> -MT <target>). There are three reasons for doing so: 1. The GCC man page recommends against using -Wp, because "the preprocessor's direct interface is undocumented and subject to change". 2. The new flags generate the correct rule directly, including the subdirectory in front of the object name, so scripts/fixdep is not needed anymore. 3. ccache (3.1.9) would not handle -Wp,-MD as expected. It would preserve the directory prefix, so that we would end up with an invalid path after the fixdep phase, making the rules useless. With this patch, OP-TEE builds fine with ccache: make -j3 CROSS_COMPILE="ccache arm-linux-gnueabihf-"
2014-06-12Open-source the TEE CorePascal Brand
Signed-off-by: Pascal Brand <pascal.brand@st.com>