Ver código fonte

build: Use "relative" path for the include of all the deps

make doesn't really support relative include so we need to get the
path from the current makefile and use that ...

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Sylvain Munaut 4 anos atrás
pai
commit
7e3d71c421
2 arquivos alterados com 4 adições e 2 exclusões
  1. 2 1
      build/core-rules.mk
  2. 2 1
      build/project-rules.mk

+ 2 - 1
build/core-rules.mk

@@ -28,7 +28,8 @@ $(foreach core_dir, $(wildcard $(ROOT)/cores/*), $(eval include $(core_dir)/core
 
 # Resolve dependency tree for project and collect sources
 $(BUILD_TMP)/core-deps.mk: Makefile $(BUILD_TMP) $(BUILD_TMP)/deps-core-$(THIS_CORE)
-	@echo "include $(BUILD_TMP)/deps-core-*" > $@
+	@echo "SELF_DIR := \$$(dir \$$(lastword \$$(MAKEFILE_LIST)))" > $@
+	@echo "include \$$(SELF_DIR)deps-core-*" >> $@
 	@echo "CORE_ALL_DEPS := \$$(DEPS_SOLVE_TMP)" >> $@
 	@echo "CORE_ALL_RTL_SRCS := \$$(RTL_SRCS_SOLVE_TMP)" >> $@
 	@echo "CORE_ALL_SIM_SRCS := \$$(SIM_SRCS_SOLVE_TMP)" >> $@

+ 2 - 1
build/project-rules.mk

@@ -37,7 +37,8 @@ $(foreach core_dir, $(wildcard $(ROOT)/cores/*), $(eval include $(core_dir)/core
 
 # Resolve dependency tree for project and collect sources
 $(BUILD_TMP)/proj-deps.mk: Makefile $(BUILD_TMP) $(addprefix $(BUILD_TMP)/deps-core-,$(PROJ_DEPS))
-	@echo "include $(BUILD_TMP)/deps-core-*" > $@
+	@echo "SELF_DIR := \$$(dir \$$(lastword \$$(MAKEFILE_LIST)))" > $@
+	@echo "include \$$(SELF_DIR)deps-core-*" >> $@
 	@echo "PROJ_ALL_DEPS := \$$(DEPS_SOLVE_TMP)" >> $@
 	@echo "PROJ_ALL_RTL_SRCS := \$$(RTL_SRCS_SOLVE_TMP)" >> $@
 	@echo "PROJ_ALL_SIM_SRCS := \$$(SIM_SRCS_SOLVE_TMP)" >> $@