Commit Graph

96 Commits

Author SHA1 Message Date
Kumar Gala 945517205f Revert "build: Fix qemugdb target"
This reverts commit 370571b563 which
breaks the build in weird ways since we end up some times include
Makefile bits multiple times and getting unexpected behavior.  Its also
not clear if this actually fixes the issue with make qemugdb target work
again.

Change-Id: I1a04881daabc0a37651906a42b1bf1fb27f9411f
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-03-09 09:22:51 +00:00
Vinicius Costa Gomes 370571b563 build: Fix qemugdb target
Even deprecated, this target should still work, the issue was
introduced by commit 2bc9d69981.

The problem is that for both of those targets the board's specific
Makefiles should be include'd, it was done only for the non-deprecated
target ('debugserver').

As a note: that is the recommended way of doing a logical OR operation
in Makefiles.

Change-Id: I3ae8f5201c47e65b33a62cea45e25dc2226de489
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-03-07 12:46:14 +00:00
Anas Nashif 2bc9d69981 build: abstract emulation and replace qemu goal with run
This will replace the current goal of 'make qemu' with 'make run' and
moves Qemu handling into its own file and into the boards instead of
being architecture specific.

We should be able to add new boards that support some other type of
emulation (by adding scripts/Makefile.<emu type>) and allow the board to
define their own options for the use type of emulation.

'make qemu' will still work, however it will be deprecated, starting
with this commit it is recommended to use 'make run'.

Jira: ZEP-359
Change-Id: I1cacd56b4ec09421a58cf5d010e22e9035214df6
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-10 20:20:47 +00:00
Anas Nashif 6d9ed994aa build: use target 'debugserver' for Qemu debugging
Use the existing debugserver target also for Qemu debugging. Qemu
should be maintained as one of many emulation/simulations platforms and
emulation should be abstracted in the Makefiles and not tied to Qemu.

qemugdb will still work, it is however being deprecated.

Change-Id: I0cd10fb66debb939b8f7f1304bf2ef4605da6a1d
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-10 20:20:46 +00:00
Anas Nashif 66cfcc26bc tests: introduce Makefile.test
To customise test builds and support test related features such as time
stamps and a boot banner, introduce a Makefile variant that is dedicated
to testing.

Initially we introduce a new config overlay that is used for all tests, in
this case we enable BOOT_BANNER and BUILD_TIMESTAMP. This will print the
current version and the date, useful when reporting bugs and also an
indicator that the system has booted before the test has started.

For example:

[QEMU] CPU: qemu32
***** BOOTING ZEPHYR OS v1.6.99 - BUILD: Dec 21 2016 19:57:13 *****
tc_start() - Test Nanokernel CPU and thread routines
Initializing nanokernel objects
...
..

Change-Id: I224318cdeb55a301964ea366dbc577e2e3a09175
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-03 17:48:44 +00:00
Anas Nashif 418058a123 kernel: remove NANOKERNEL and MICROKERNEL configs
Those are legacy and not needed anymore.

Change-Id: I8113114fd60880b3f538612db7702f6129af0a06
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-12-14 13:45:52 +00:00
Daniel Thompson 560afde9c3 build: Document outputexports
In addition to providing documentaton, we also modify the static_lib
example to use outputexports instead of the double-include
Makefile.toolchain trick. For this to work well we need to fix a tiny
bug in the dependency handling in Makefile.inc.

Change-Id: I6571bc681bc34155f37cff1eccc2ea12ed52ef07
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
2016-11-12 02:08:08 +00:00
jing wang cea9bb992c Makefile.inc: fix 'make debugserver' no rule issue
the issue is caused by lacking $(ARCH) in Makefile.inc, which
cause $(ZEPHYR_BASE)/boards/$(ARCH)/$(BOARD)/Makefile.board fail
to include. So just add ARCH variable by extract it from boards/
folder.

Issue: ZEP-1255
Change-Id: I15453c5e2bced8fc64b545b925086fe5c3bf68c5
Signed-off-by: jing wang <jing.j.wang@intel.com>
2016-11-10 23:46:44 +00:00
Andrew Boie c2de216154 build: force all kernel builds to be Unified kernel
KERNEL_TYPE build parameter is now ignored.

Change-Id: I7523f14ff674ef8b8e24246e5f71111df81cf7df
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-11-04 18:25:32 +00:00
Kumar Gala 8d35760fec board: organize boards based on architecture
Introduce an architecture sorting of boards.  This is to allow for
easier maintenance going forward as the number of boards grows.  It
will be easier for any scripts to know the board/arch mapping without
having to maintain an explicit list of what boards are associated with
which arch.  We can also do things like have architecture maintainers
cover reviews and branches for arch/${ARCH} and boards/${ARCH} going
forward.

Change-Id: I02e0a30292b31fad58fb5dfab2682ad1c5a7d5a7
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-10-24 19:59:42 +00:00
Juan Manuel Cruz 941059c69f win-build: fixes to build with alternative make implementations
Some make implementations have different implementations for
notdir and absdir functions.
notdir may require that his parameter do not finish with "\".
absdir may fail when given a windows formated path as input.

The path that is given to notdir as parameter is removed from
the final "\" and abspath is replaced with realpath when the
input given can be a windows formated path.

Jira: ZEP-762

Change-Id: Ic83e3526fc5234decb3192ab1f9f538addf9a76e
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-09-12 12:28:14 +00:00
Inaky Perez-Gonzalez 27482314d4 kconfig: include configuration fragment files from output directory
Current setup includes configuration fragments (*.conf) from the
source directory.

This patch enables said inclusion to also happen from the output
directory; this enables automatic build systems and validation to set
configuration fragments without modifying the source tree.

This is important so that the source tree remains pristine from the
standpoint of source control systems.

Change-Id: Ic4a896afad2b8525c13dd6c6d9081f514b18e7aa
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-09-08 11:31:30 +00:00
Inaky Perez-Gonzalez 93ac1f7ac5 build: default ARCH to be initialized by the board support code
ARCH is defaulted to be x86. This makes it somehow impossible for later
the board code to set it properly when it needs to be evaluated in a
top level makefile for a project.

By undefining it, a lazy resolution is forced that works its way to
the proper Kconfig set by setting BOARD, which should be the ONLY
mandatory argument (to avoid things that will fail like BOARD=galileo
ARCH=arc).

Jira: ZEP-690
Change-Id: I5b10922eb4cdb559ab5fe354bc91c9ffb92f0ca8
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-08-30 21:08:30 +00:00
Andy Ross 72f00d930e Make outdir board-specific to avoid build collisions
Casual building in the tree leads to regular messups where I forget to
clean up the outdir first when switching platforms and the build fails
in strange ways.

Put a $(BOARD) subdirectory under outdir, and use that at $(O) when
the user does not provide an output directory.

Note that "make pristine" continues to remove the entire outdir,
including other architecutres (so as to make the tree pristine).

Also update a few spots where outdir was mentioned in documentation to
clarify the new scheme.

Change-Id: I365eec06ea440f17380b9f9ace5f5d34b9bed4dc
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2016-08-27 11:48:05 +00:00
Juan Manuel Cruz 2bf22ae0e8 win-build: Fixes an issue supporting quotes
Jira: ZEP-517

Change-Id: Ic63df69e3df83d90343ac5d1f88a1c496a8f6e09
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-08-25 11:03:34 +00:00
Kumar Gala 23af1e928e build: Fix application object files placement when building out of tree
For the application object files to get properly placed in the outdir
when the source files are outside of the zephyr tree we need to set
$srctree in kbuild to the parent dir of the application source code
rather than getting the default of $srctree being set to $ZEPHYR_BASE.

By doing this we are able to get the kbuild system to place the object
file results in the outdir rather than in the application source dir.

Jira: ZEP-369
Change-Id: I4d3ba67a4a38c15978d5bf7e1f0a912e9bf00f08
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-06-30 16:49:40 +00:00
Andrew Boie be13e26586 build: add 'qemugdb' target
This new target works much like 'make qemu' but fires up a local GDB
server on port 1234 and pauses execution

Change-Id: I87fd174c66dcc9f2f43b5b1204cc5c34f741622d
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-28 15:56:05 -07:00
Kumar Gala 86cbc320f0 build: quote SOURCE_DIR to allow it to be a list
If SOURCE_DIR happens to be multiple directories we need to quote it so
it gets passed correctly as a list.

Change-Id: I7795ddecd016fad2048f957accd1557bb2215632
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-06-22 05:02:28 +00:00
Kumar Gala 5ccf5298b5 build: make zephyrmake exposed with V=1
Remove extra @ which would always silence output from zephyrmake.  Every
instance of zephyrmake is prefixed with a $(Q) so V=1 will expose them

Change-Id: I8e622cc2175f645897ac78d607486d37c0af1618
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-06-22 05:02:28 +00:00
Anas Nashif b62b810620 Revert "build: Do not depend on python while creating the relative path"
This patch while it fixes a few bugs, introduces other issues, espcially
when building on windows.

This reverts commit ae327c60c9.

Change-Id: I1ffcd6c88d17f5bd6a66df28d99d2d27c0683930
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-06-14 16:55:52 +00:00
Anas Nashif 6361be24bc scripts: add a script to report RAM/ROM usage
Still WIP. Give statistics on memory/flash usage.

Run:
 make BOARD=<board> ram_report
 or
 make BOARD=<board> rom_report

Change-Id: I6b0aee09b89275e12f1cde863d2c0f5b8dfd0409
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-26 15:19:15 +00:00
Caio Marcelo de Oliveira Filho e450b2db00 build: use export to pass CFLAGS to zephyrmake
If CFLAGS have spaces, the existing zephyrmake leaks part of it as
arguments for make. Instead of explicitly setting, just the export the
CFLAGS to make it visible to the inner call to make.

Change-Id: I7b083cbc19a49e8dede39333443c701567d214c0
Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
2016-05-23 17:44:47 +00:00
bitpathe ae327c60c9 build: Do not depend on python while creating the relative path
Change-Id: I45892371b3d72a681fc0d5c3fdc49af2f0094296
Signed-off-by: Bit Pathe <bitpathe@gmail.com>
2016-05-16 22:21:01 +00:00
Anas Nashif a0cf03b1c7 build: add extra dependency for zephyr.lnk and rebuild with new boards
When building an application for a different BOARD, the .link file
was never updated causing issues with linking.
Also, make sure we restart the build process when the board has changed.
This guarantees that the file is recreated when the dependencies have
changed.

Jira: ZEP-239
Change-Id: Ided3a71c03fd8b2c6ab9c2bf8370104cd5071c08
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-16 19:43:50 +00:00
Juan Manuel Cruz 5516bcaa72 build: Add MinGW dependencies in makefile
Jira: ZEP-177
Change-Id: I5c67b9ed6c279b2b59afd4cd0351df5f0d030533
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-05-14 15:55:03 +00:00
Anas Nashif 57605a558c build: generate error if board is not found
Change-Id: Icf0c713d5fe3bb56dea4d74c87176c04f80df329
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-25 19:17:04 +00:00
Anas Nashif 7bf6ce5b3b build: support multiple defconfigs per board
We will now look for the defconfig to be used using wildcards which will
allow us to host similar boards in the same directory and share all existing
files.

JIRA: ZEP-103

Change-Id: Icfe5dc2fa4b2c4e21e6b1285d80e0c844d430d7d
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-03-14 20:54:08 +00:00
Anas Nashif 872676c735 build: fix parallel builds of applications
When building with more than 1 job, we were getting:

make[1]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.

Trying to fix this in the Makefile resulted in dependency issues and unsatisfied
dependencies in the compilation and build chain.

Change-Id: Ic73d089cf6a0a0d7b6fd83908b8144c34af25582
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:30 -05:00
Anas Nashif a49762ccce add debug/debugserver support
Change-Id: I114994cb092870cd57b8e43b197d56ab8ca7db20
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:30 -05:00
Anas Nashif 54634d6a43 add support for debugserver
Change-Id: Ib22d9c06ba7816c3b870973d16e1c25229f31e1f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:30 -05:00
Anas Nashif 71d22157b4 makefile: do not create directories when calling help
Create a new help target.

Change-Id: I33200cb129a2527d31d19ec99bc1cd6ded1c21ea
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:30 -05:00
Anas Nashif 51be9a50a4 Add flash support for boards using latest SDK
Using the latest SDK (0.7.2) you can flash directly using make
by specifying the board, for example

make BOARD=arduino_101 flash

This will build and flash the generated binary to the board.

Change-Id: I90254abd69874efbb449ef318079958980c23074
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:29 -05:00
Yonattan Louise 4a2ce3c0c9 mingw: change backslashes to forward slashes
If the path of the SOURCE_DIR has the windows format. We change the
backslashes to avoid escaping the characters.

Change-Id: I93247ade884374b292cd34176dee81f53796da8a
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:17 -05:00
Louise Mendoza 0c3f05bcd7 mingw: Use built-in pwd with -W option for mingw builds
The pwd for mingw has a different output to the pwd shell's built-in pwd.
This change uses the built-in pwd for keep compatibilty with the path
in mingw.

Change-Id: I43d605157e19f661480e68ecbbd024c5f077e461
Signed-off-by: Louise Mendoza <yonattan.a.louise.mendoza@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:16 -05:00
Louise Mendoza 7a2836f0f4 Remove quotation marks form CFLAGS.
The quotation marks in windows cause the exact interpretation
of the text, including the special symbols like '\', that
cause problems with the parameter of the toolchain.

Change-Id: Ib223ed64b92380419e2fd86b703247ada1a06e34
Signed-off-by: Louise Mendoza <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:25:16 -05:00
Anas Nashif 9d26ab769d dequote and strip CONF_FILE variable and minor variable cleanup
Avoid issues with variables having quotes and leading/trailing spaces.
Additionally, set KERN_TYPE to micro.

Change-Id: Id3f5aeca6844292bbb537f443bd36f191432fe58
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:13 -05:00
Anas Nashif 1cfc5b3f6f Move defconfig files to the board directory
This commit also renames boards and makes naming consistent between
board name and defconfig files.

quark_d2000_reference -> quark_d2000_crb
quark_se_test_sss -> quark_se_sss_ctb
quark_se_test -> quark_se_ctb

Change-Id: Ibe6a5102edb987fe1d6ce32c8c392a87d45d6951
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:11 -05:00
Anas Nashif c740608ce5 Use BOARD instead of PLATFORM_CONFIG
Change-Id: I14db0087cd705df0db8a911071bc3949b5c79314
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:11 -05:00
Sergio Rodriguez 2e2ad8166e qemu: Creation of QEMU specific platforms
Setting up new platforms to handle emulation, and make them the only
ones able to run on QEMU from the Makefile "qemu" target to avoid
confusion with other platforms. We have now platform qemu_x86 and
platform qemu_cortex_m3, also modification to the sanity checks to have
qemu support only on those platforms

Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
Change-Id: I9291918a1d58fea4f37750ada78234628f9a5d98
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:56 -05:00
Anas Nashif 182a646c0d build: use realpath instead of readlink -f
readlink is not portable and does not work the same way on different
platforms, use Make realpath instead.

Change-Id: I5348000b624d8ac76c2c409962dd1930761ed6ce
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:54 -05:00
Anas Nashif c4ad67dd9c use oldnoconfig and avoid using 'yes'
We use yes to answer question to an interactive 'make oldconfig'
and generate lots of noise. 'yes' is also not portable, so skip
the yes and use 'make oldnoconfig' instead.

Change-Id: I14f7056c7735e1a020aad2f37c652e4a53872760
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:54 -05:00
Anas Nashif c47769bd56 kconfig: move all defconfig fragments to configs/
When building for a certain platform, we have no idea
what architecture we are building for.

We used to specify the architecture alongside the board or platform
name and this was used to find the defconfig in arch/<arch>/configs.

By putting all board configurations we support in one place we do
not have to specify the architecture, just the configuration name.

Change-Id: Ib7e9f63b9a8051714dc207f583fd26ef620497d8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:53 -05:00
Benjamin Walsh 334c14e66e x86: CLFLUSH and cache line size detection
Detect the presence of CLFLUSH instruction and cache line size at
runtime. It is still possible to set them manually via kconfig options
if the values are known.

Change-Id: I00bda1de4c5c241826ead6f43b887b99a963cc7b
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:24:41 -05:00
Anas Nashif fa2e18b294 kbuild: make menuconfig work with local configuration
Calling 'make menuconfig' from an application will prepare
the configuration defined in the application (Makefile) and
will launch menuconfig with the correct configuration rather
than the default for the architecture.

Change-Id: I6c611ddaa23b67632c507291294a73b6c4283cea
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:29 -05:00
Anas Nashif 2ce8d30892 remove nano/micro defconfigs, use 1 file only
Do not use micro_* or nano_* defconfigs, instead maintain platform
in one single defconfig and merge nano or micro support on top.

Change-Id: I0d5184f37865ed8312e516e48cf5a8584a287dfe
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:28 -05:00
Anas Nashif f5e3be2af7 build: re-add initconfig to generate .config
run make initconfig to only create the .config in outdir.
The .config will be the result of the defconfig merged with the local
application config define in CONF_FILE.

Change-Id: If2a308ac3805d32cea8dd7be7a14772f22443600
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:28 -05:00
Anas Nashif fbed1e4bcd Kbuild: Use DOTCONFIG instead of /.config
Change-Id: Ida72f1321f6b02c5d506e4c9a9a18035e9c13b0d
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:33 -05:00
Anas Nashif 13a0223cda Kbuild: Remove .dir target
This is not needed anymore, directory is created by
mergeconfig.

Change-Id: I3a24b14d08b9c5c0203f66536dd74109da55064c
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:33 -05:00
Anas Nashif e80edfc7bf cleanup Makefile.inc and fixed mergeconfig
Remove the environment file due the fact it was destructive and
removed existing .config and build environment. Now, if you change
the architecture, you will not be building against old environment,
instead, kconfig will prompt you for the changes.

Change-Id: Ib557dd2a0562dcfe23fee60863b3e667f1c99060
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:33 -05:00
Anas Nashif fde80d7ead cleanup makefiles and remove duplication
Makefile.inc duplicates many of the existing targets in Makefile.
Instead of duplication, pass all none local targets to Makefile
and implement only those needed locally.

Change-Id: I1e923dd398a138543fa676ab67570b630c75d7ea
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:32 -05:00