Commit Graph

54 Commits

Author SHA1 Message Date
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
Juan Manuel Cruz ea0c810bc5 kbuild: environmental vars rebuild
This commit allows kbuild to rebuild if the following environmental
variables change: KERNEL_TYPE, PLATFORM_CONFIG, ARCH.

Change-Id: Ibab0392b6eb362a5423bce149c013235b75d3140
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:15:26 -05:00
Anas Nashif 97493575a6 build: simplify clean target
Do not delete files that do not exist and just clean
the outdir directory which has all the objects.
The source directories now do not have any built objects.

Change-Id: I5774fa325717c65b6666de495b35f9b86f57473c
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:45 -05:00
Anas Nashif 0db074eae4 build: fixed typo when stripping variable
Change-Id: I9dba0c02aac92b1443933ce5d9a7d997ec2ed2e2
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:45 -05:00
Anas Nashif 7aa584d9c2 build: Let application specify the defconfig
We should be able to point to a defconfig file that is
outside of the buildsystem instead of using system
provided defconfigs.

In Makefile of application, specify for example:

KBUILD_DEFCONFIG=/tmp/micro_basic_atom_defconfig

Change-Id: I63e500bf74892654587b63d788a94541c33072e8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:45 -05:00
Andrew Boie 776d5f7c22 build: fix application build in symlinked environment
This fixes issues building in a tree which has symlinks in its path,
for some reason PROJECT_BASE ends up having symlinks removed from it
but not ZEPHYR_BASE, causing Python to generate relative paths
with "../.." (for example) in the beginning. This patch ensures both
have symlinks removed before computing SOURCE_DIR.

Change-Id: I3e0688b602a320d7644834b73cde79cfe91cb677
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:14:42 -05:00
Arkadiusz Lichwa a9c1163ed9 build: Fix python3 printf syntax
Using as default on build host Python3.4 environment,
the build of Zephyr terminates with complain.

File "<string>", line 1
      import os.path; print os.path.relpath(...)
                             ^
SyntaxError: invalid syntax

Change-Id: I99abf647ffc68d4e8a0b3d6c74a5362435670aa4
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-02-05 20:14:42 -05:00
Andrew Boie 9132a13542 build: HACK fix issue where project objects don't end up in $(O)
Kbuild doesn't like absolute paths since it can't compute an outdir path
by applying a prefix. Convert to relative path before calling the kernel
Make session.

This will not work for projects that are completely outside the Zephyr
tree as leading ../ in the relative SOURCE_DIR will mess up the outdir
calculation.

Change-Id: I6680796d5da4624b01aa3c45ac2c4b4a8a99d09a
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:14:42 -05:00
Andrew Boie ca12bbb569 fix issue where two outdirs are created
O was getting passed along to the main Kbuild Make session which is
called with -C. If O was a relative path, the outdir would effectively
become $(ZEPHYR_BASE)/$(O) which is not what we want.

Change-Id: I148539490ecfc2d4e84a0fdf3e3dd1ab24503633
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:14:41 -05:00
Andrew Boie c69920798b Makefile.inc: fix indentation
An additional level of indent after line continuations makes this file
easier to read.

Change-Id: I2f5de9b811a5e725639d3a0c2cd62196c2a9e9c4
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:14:38 -05:00
Peter Mitsis 519351ee92 Use PLATFORM_CONFIG to specify configuration
Uses PLATFORM_CONFIG to specify the configuration file instead of
KBUILD_DEFCONFIG.  This name is more intuitive to Zephyr users and
it is not tied to kbuild.

Example usage:
    make PLATFORM_CONFIG=generic_pc_atom_n28xx
    make PLATFORM_CONFIG=generic_pc_minuteia
    make PLATFORM_CONFIG=quark
    make PLATFORM_CONFIG=ti_lm3s6965
    make PLATFORM_CONFIG=fsl_frdm_k64f

Change-Id: I177608942c3e77c2f152743c862aad1d460c0e33
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:38 -05:00
Peter Mitsis 5890d1fbb4 kbuild: remove BSP+variant to defconfig mapping
Removes the BSP+BSP_VARIANT to KBUILD_DEFCONFIG mapping.  Consquently,
KBUILD_DEFCONFIG must be defined (via Makefile, or command line, or environment
variable, ...) when building any project.

Change-Id: I0a416977bc0d37419c4a6bcf40560b3b32f19f8d
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:38 -05:00
Andrew Boie 4f9a95ff1e kbuild: remove BSP_VARIANT Makefile variable
This wasn't being used anywhere and seems to be a legcy of old sanity tests.
By removing this x86 is no longer a special case.

Change-Id: I78c668a7d9e6bc7c7f60d91712c4c21c0121b7e2
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:14:37 -05:00
Anas Nashif 27603f4801 Revert "Kbuild: Tools build at TIMO_BASE directory."
This reverts commit 23da104f0dc8c6c4a768a727b564272c084aa79b.

Conflicts:
	Makefile
	Makefile.inc

Change-Id: Ia8f2efe3cd37e82c04c304f04c46d787d2265dde

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:24 -05:00
Anas Nashif b8823770d2 Rename TIMO -> ZEPHYR
Change-Id: Id44a129e275fb0cfe1fce6ec2a03c2d86ffe3995
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:16 -05:00
Allan Stephens 815c6406bc Rename VPF files to use MDEF file extension
The file extension indicates a "Microkernel DEFinitions" file,
and no longer reflects the obsolete VxMicro/Viper branding.

Change-Id: Ib95b271404a4a4737e851d603c371244fa609e4d
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:15 -05:00
Juan Manuel Cruz 52c9d87c25 Kbuild speed and target dependency improvements.
This commit improve Kbuild speed by removing the defconfig Make
call and including a direct copy of the default configuration file.

The .initconfig target is broken down in mergeconfig and defconfig
targets as well.

Change-Id: I1efadfca487a3fa8438e65e1c3da83fc46576628
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:14:14 -05:00
Juan Manuel Cruz dc2b1f1746 Kbuild: Improve verbosity on project build.
This commit allows to control the verbosity of the Makefile.inc
execution using the console parameter V=1.

Change-Id: I253332b6e33725b6cd4cd83643321278f396ed50
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:14:14 -05:00
Dirk Brandewie 6fa99f87ec kbuild: Only execute initconfig target once
There is no need to rerun the initconfig target if the current project
directory has already been configured.

Change-Id: Ifaf01d8afa88f058bd4e20ed7c3fe136dbb1a640
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
2016-02-05 20:14:12 -05:00
Juan Manuel Cruz 427fc58804 Kbuild: Fix to distclean target.
This commit fixes the distclean target.
distclean target removes the hidden files, with cmd extension,
generated by Kbuild.

Change-Id: If00c9b0ee9791abb64e29f8a9ebda454384f23af
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:14:10 -05:00
Juan Manuel Cruz 4d7f954896 Kbuild: Tools build at TIMO_BASE directory.
This commit allows the tools build to be executed at TIMO_BASE
directory insted of being executed at the PROJECT_BASE.
This allows the sanity checks to run faster because there is no
need to recompile the tools with every test.

Change-Id: I9e9ac78695db884b44e2693029e9ea6ed96b21c8
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:14:10 -05:00
Anas Nashif 02085a3fda Kbuild: make merge_config less verbose
Change-Id: I1102f383db23fad18364f09eff6128391980637a

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:10 -05:00
Juan Manuel Cruz 988236f2b9 Kbuild: Output files at outdir directory.
This commit enables the outdir directory.
Kbuild output files will be generated at the outdir directory
inside the project directory.

Change-Id: Icec04aca1753326c9d50dea20c71850c1d8c3dd0
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:14:10 -05:00
Juan Manuel Cruz 899c1c9731 Kbuild: Enables help target from project directory.
This commit enables the help target from the project directory.

Change-Id: I124c8f8fea40a09865a18f917dd8a798dd8b45e5
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:14:10 -05:00
Juan Manuel Cruz 6ad9404883 Kbuild: Support for BSP_VARIANT
This commit adds the support for the BSP_VARIANT symbol.
This symbols is used by sanity checks to identify an specific
CPU in the generic-pc BSP.

Change-Id: Ia1d31303bc2d4bfc9c9ec5bf8da964b9707e44b0
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:14:09 -05:00
Juan Manuel Cruz dc5a457847 Kbuild: Changing build parameter CONF_OVERLAY to CONF_FILE
This commit changes the build parameter CONF_OVERLAY with the
name CONF_FILE.

Change-Id: I404a4aa87b167a9ca4e7b395d53c2f7794b232bc
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:14:09 -05:00
Juan Manuel Cruz 1548be0540 Kbuild: Fix to pristine target.
This commit fixes the pristine target and removes
the complete set of hidden files:
 - .config.old
 - .version
 - .tinymountain.cmd
 - .tmp_versions

Change-Id: I6f96248885d504cb2a0f53849672c51b2d56e69a
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:14:09 -05:00
Anas Nashif a6fc21ed5e Kbuild: add alias pristine to distclean
Change-Id: Ifb21c78f0772e1a4bde61dc8b3e9198fc13a0279
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:09 -05:00
Juan Manuel Cruz 1537c24789 Kbuild: Fix for the parallel building problem.
This commit fixes an issue with the parallel building problem.
Note: When calling $(MAKE) from a function call or from inside
another variable, instead of calling directly in target,
make cannot identify the make calls to distribute the process
load across processes. This makes the parallel building to
ommit the $(MAKE) calls in these situations from the parallelism.

Change-Id: I42ed5127a99a1a461c47edb4b4f8511e4b6e7e8d
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:14:08 -05:00
Juan Manuel Cruz 5fbb5f6420 Kbuild: Adding bluetooth sanity checks.
This commit adds the Makefiles to add sanity checks for
the bluetooth driver.

Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Change-Id: Iadfe6eb2662347a981393ffeb3e343f32c5f67f0
2016-02-05 20:14:08 -05:00
Juan Manuel Cruz 638fb2c181 Kbuild: Bluetooth driver support.
This commit adds the Makefile and Kconfig files
to support the bluetooth driver in the Kbuild system.

Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Change-Id: I1f72b13aca8fb098eece04c4f0e1b680639b520f
2016-02-05 20:14:08 -05:00
Anas Nashif 28e8db6e93 Kbuild: also remove qemu.pid
Change-Id: Ie0b3e16564d9beb7f10f09f267f80e8e13c1bc39
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:08 -05:00
Anas Nashif 0fb0a0249b Kbuild: add distclean target
Change-Id: Ic782f5f27b70867a83cdee0ff5b066f12c111530

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:08 -05:00
Anas Nashif 0f9fea0eaa Kbuild: use local CFLAGS
Change-Id: I498fa7846bc84b146540f639753b71a724ec8fdb
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:08 -05:00
Anas Nashif eeccfcd250 Kbuild: export SOURCE_DIR
Change-Id: I67d0faf891446bce3c96d2e0cfdcfda955624548

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:07 -05:00
Anas Nashif 4acde800b0 Kbuild: User kernel instead of TiMo
TiMo is very ambigous, be generic and call it kernel.

Change-Id: I66b3e436afbc89e874f31a89b98cc04aa821c787
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:07 -05:00
Anas Nashif da4a29b09d Kbuild: clean removes modules.order from src/
Change-Id: I6968fa91944271256dba78caaf9a7927cbae01ed
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:07 -05:00
Juan Manuel Cruz 2bd1e5b2dd Kbuild: Fix for the clean target.
This commit fixes the clean target.
The issue is that clean target was not cleaning
the file inside the source tree.

Change-Id: I12b41e28591121a167734428132c4bd9021bccd9
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:07 -05:00
Anas Nashif 5c8ff0fe26 Kbuild: support sources in different directory
In some cases you might want to compile sources in a
customer location, for example share code for samples
that runs in nano and micro kernels.

Set SOURCE_DIR  in the project Makefile to achieve this.

Change-Id: Iaa4d0fe701b30499b903b64ddf816a678074a176
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:07 -05:00
Juan Manuel Cruz 0b7946ba73 Kbuild: Additions to Makefile.inc
This commit adds the following features to Makefile.inc:
 - The location of the project (PROJECT_BASE) can be specified
   as a parameter.
 - BSP and KERNEL_TYPE parameters can be used to specify a default
   configuration.
 - The default configuration is created everytime the target all
   and qemu are invoked.
 - initconfig target creates a default configuration.
 - The name of the file for the configuration snippet can now be
   selected using the parameter CONF_OVERLAY.
 - The clean target is able to remove generated files even if a
   different PROJECT_BASE is defined.

Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Change-Id: Iabd8469465f57c222972f326fe997be58fb87f41
2016-02-05 20:14:07 -05:00
Anas Nashif 6327f45f25 run defconfig if we have no .config
Change-Id: Ic9f3eb3736721bed3434f934081704343f4d17f1

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:06 -05:00
Anas Nashif c615855ab9 Makefile: run mergeconfig only when needed
Change-Id: Ic080c1c974fde413e5f10247d130b40904838e09
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:06 -05:00
Anas Nashif e44e7ec742 mergeconfig by default
When running make in an application, always run mergeconfig

Change-Id: I811f56a0c3388cb64f6c4aa57c6b83d88f568b68
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:06 -05:00