diff options
-rw-r--r-- | makefiles/Makefile.subdir | 6 | ||||
-rw-r--r-- | makefiles/Makefile.top | 9 |
2 files changed, 8 insertions, 7 deletions
diff --git a/makefiles/Makefile.subdir b/makefiles/Makefile.subdir index 8e4e5e0..f81b2cc 100644 --- a/makefiles/Makefile.subdir +++ b/makefiles/Makefile.subdir @@ -55,8 +55,8 @@ ifeq ($(MAKECMDGOALS),test) sources = $(subst ;, ,$(lastword $(subst :, ,$(ITEM)))) # Append test items, prepending $(d) to each source file - TEST_ITEMS_$(d) := $(TEST_ITEMS_$(d)) $(foreach ITEM,$(TEST_ITEMS_$(d)), \ - $(binary):$(foreach TSRC,$(sources),$(addprefix $(d),$(TSRC)))); + TEST_ITEMS_$(d) := $(TEST_ITEMS_$(d)) $(foreach ITEM,$(DIR_TEST_ITEMS), \ + $(binary):$(foreach TSRC,$(sources),$(addprefix $(d),$(TSRC));)) TEST_ITEMS := $(TEST_ITEMS) $(TEST_ITEMS_$(d)) @@ -82,7 +82,7 @@ ifneq ($(DIR_INSTALL_ITEMS),) # Append items to install (along with install location), prepending $(d) # to each item in the file list INSTALL_ITEMS := $(INSTALL_ITEMS) $(foreach ITEM,$(INSTALL_ITEMS_$(d)), \ - $(dest_dir):$(foreach FILE,$(files),$(addprefix $(d),$(FILE)))); + $(dest_dir):$(foreach FILE,$(files),$(addprefix $(d),$(FILE));)) endif # Reset the inputs diff --git a/makefiles/Makefile.top b/makefiles/Makefile.top index 3935422..1bb97dd 100644 --- a/makefiles/Makefile.top +++ b/makefiles/Makefile.top @@ -127,8 +127,8 @@ $(eval $(foreach INC, $(MAKE_INCLUDES), $(call do_include,$(INC)))) # Calculate objects to build OBJECTS := $(addprefix $(BUILDDIR)/,$(subst /,_,$(subst .c,.o,$(SOURCES)))) -TEST_BINARIES := $(addprefix $(BUILDDIR)/, \ - $(foreach ITEM,$(TEST_ITEMS),$(firstword $(ITEM)))) +bin_for_test = $(addprefix $(BUILDDIR)/,$(firstword $(subst :, ,$(ITEM)))) +TEST_BINARIES := $(foreach ITEM,$(TEST_ITEMS),$(bin_for_test)) # And the output filename ifeq ($(findstring lib,$(COMPONENT_TYPE)),lib) @@ -331,9 +331,9 @@ ifeq ($(MAKECMDGOALS),test) endef - bin_for_test = $(firstword $(subst :, ,$(ITEM))) srcs_for_test = $(subst ;, ,$(lastword $(subst :, ,$(ITEM)))) - objs_for_test = $(addsuffix .o,$(basename $(srcs_for_test))) + objs_for_test = $(addprefix $(BUILDDIR)/, \ + $(subst /,_,$(addsuffix .o,$(basename $(srcs_for_test))))) $(eval $(foreach ITEM,$(TEST_ITEMS), \ $(foreach SOURCE,$(filter %.c,$(srcs_for_test)), \ @@ -345,6 +345,7 @@ ifeq ($(MAKECMDGOALS),test) $(eval $(foreach ITEM,$(TEST_ITEMS), \ $(call link_test,$(objs_for_test),$(bin_for_test),TESTLIB,TESTLDFLAGS))) + endif # Include dependency makefiles |