]> rtime.felk.cvut.cz Git - omk.git/commitdiff
Apply allow sources in subdirectories to rtems and sdcc rules.
authorPavel Pisa <pisa@cmp.felk.cvut.cz>
Wed, 16 Sep 2015 19:05:34 +0000 (21:05 +0200)
committerPavel Pisa <pisa@cmp.felk.cvut.cz>
Wed, 16 Sep 2015 19:05:34 +0000 (21:05 +0200)
Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
snippets/rtems.omk
snippets/sdcc.omk

index b0de0480f4a5c40aa910b172510686d6ef586448..1313f6729e8dcdb13e708643255d003f2e10e389 100644 (file)
@@ -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=%))))
index d060c50db26802f036870465236fbdc17c98eef1..f8c17bb0c0abe2137d4df24892bb9b5257fa17be 100644 (file)
@@ -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