From 19ee5efa61fe5a18b130b91fd319bf90cd717fec Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Sat, 22 Apr 2017 08:10:44 -0400 Subject: [PATCH] build: support building host tools To speed up builds, this change allows building the needed host tools that are built for every application and stores them un ${ZEPHYR_BASE}/bin. Run 'make host-tools' and then define PREBUILT_HOST_TOOLS to reuse the host tools across multiple builds. $ make host-tools HOSTCC scripts/basic/fixdep HOSTCC scripts/gen_idt/version.o HOSTCC scripts/gen_idt/gen_idt.o HOSTLD scripts/gen_idt/gen_idt HOSTCC scripts/gen_offset_header/gen_offset_header.o HOSTLD scripts/gen_offset_header/gen_offset_header HOSTCC scripts/kconfig/conf.o SHIPPED scripts/kconfig/zconf.tab.c SHIPPED scripts/kconfig/zconf.lex.c SHIPPED scripts/kconfig/zconf.hash.c HOSTCC scripts/kconfig/zconf.tab.o HOSTLD scripts/kconfig/conf $ export PREBUILT_HOST_TOOLS=${ZEPHYR_BASE}/bin $ make -C samples/hello_world Now you will notice a speedup when building the application! Change-Id: Ie0aeee7f9a60b1fd49e7e32d78601f03473d73b8 Signed-off-by: Anas Nashif --- Makefile | 15 +++++++++++++-- scripts/kconfig/Makefile | 2 ++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 2c819a822a2..2ba656f2efa 100644 --- a/Makefile +++ b/Makefile @@ -478,7 +478,7 @@ endif version_h := include/generated/version.h -no-dot-config-targets := pristine distclean clean mrproper help kconfig-help \ +no-dot-config-targets := pristine distclean clean mrproper help kconfig-help host-tools \ cscope gtags TAGS tags help% %docs check% \ $(version_h) headers_% kernelversion %src-pkg @@ -1065,7 +1065,7 @@ CLEAN_FILES += include/generated/generated_dts_board.h \ *.bin *.hex *.stat *.strip staticIdt.o linker.cmd # Directories & files removed with 'make mrproper' -MRPROPER_DIRS += include/config usr/include include/generated \ +MRPROPER_DIRS += bin include/config usr/include include/generated \ arch/*/include/generated .tmp_objdiff MRPROPER_FILES += .config .config.old .version $(version_h) \ Module.symvers tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS \ @@ -1193,6 +1193,17 @@ $(help-board-dirs): help-%: echo '') + +host-tools: + $(Q)$(MAKE) $(build)=scripts/kconfig standalone + $(Q)$(MAKE) $(build)=scripts/basic + $(Q)$(MAKE) $(build)=scripts/gen_idt + $(Q)$(MAKE) $(build)=scripts/gen_offset_header + @mkdir -p ${ZEPHYR_BASE}/bin + @cp scripts/basic/fixdep scripts/gen_idt/gen_idt scripts/kconfig/conf \ + scripts/gen_offset_header/gen_offset_header ${ZEPHYR_BASE}/bin + + # Documentation targets # --------------------------------------------------------------------------- %docs: FORCE diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index 5e0230444cb..a15068add38 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -34,6 +34,8 @@ gconfig: $(KCONFIG_BIN_PATH)/gconf menuconfig: $(KCONFIG_BIN_PATH)/mconf $< $(Kconfig) +standalone: $(obj)/conf + config: $(KCONFIG_BIN_PATH)/conf $< --oldaskconfig $(Kconfig)