From 15f6d838e9f393493c3ca352b9a0d4d4f940b168 Mon Sep 17 00:00:00 2001 From: Pavel Pisa Date: Wed, 16 Sep 2015 21:05:34 +0200 Subject: [PATCH] Apply allow sources in subdirectories to rtems and sdcc rules. Signed-off-by: Pavel Pisa --- snippets/rtems.omk | 6 ++++++ snippets/sdcc.omk | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/snippets/rtems.omk b/snippets/rtems.omk index b0de048..1313f67 100644 --- a/snippets/rtems.omk +++ b/snippets/rtems.omk @@ -298,6 +298,12 @@ $(foreach lib,$(lib_LIBRARIES),$(eval $(call LIBRARY_template,$(lib)))) $(foreach lib,$(shared_LIBRARIES),$(eval $(call SOLIB_template,$(lib)))) +# Create _build directories for sources in subdirectories i.e. *_SOURCES=dir/file.c +_dirs_to_create=$(filter-out ./,$(sort $(dir $(USER_SOURCES) $(SOLIB_SOURCES)))) +ifneq ($(_dirs_to_create),) +$(shell mkdir -p $(addprefix $(LOCAL_BUILD_DIR)/,$(_dirs_to_create))) +endif + # IDL compilation USER_IDLS := $(sort $(USER_IDLS)) $(foreach src,$(filter %.idl,$(USER_IDLS)),$(eval $(call COMPILE_idl_template,$(SOURCES_DIR)/$(src),$(src:%.idl=%)))) diff --git a/snippets/sdcc.omk b/snippets/sdcc.omk index d060c50..f8c17bb 100644 --- a/snippets/sdcc.omk +++ b/snippets/sdcc.omk @@ -221,6 +221,11 @@ $(LIB_DIR)/%$(OBJ_EXT): %$(OBJ_EXT) USER_SOURCES := $(sort $(USER_SOURCES)) #$(warning USER_SOURCES = $(USER_SOURCES)) +# Create _build directories for sources in subdirectories i.e. *_SOURCES=dir/file.c +_dirs_to_create=$(filter-out ./,$(sort $(dir $(USER_SOURCES)))) +ifneq ($(_dirs_to_create),) +$(shell mkdir -p $(addprefix $(LOCAL_BUILD_DIR)/,$(_dirs_to_create))) +endif # The above generated rules produced $(USER_SOURCES) and $(SOLIB_SOURCES) # variables. Now generate rules for compilation of theese USER_SOURCES -- 2.39.2