From e6f346080d4c3d1ada67e276aa3b5e7e346d055f Mon Sep 17 00:00:00 2001 From: Paul Scheffler Date: Thu, 6 Jul 2023 20:24:38 +0200 Subject: [PATCH] Makefile: Improve dep tracking --- .gitignore | 2 +- cheshire.mk | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index f4973002f..704ab1869 100644 --- a/.gitignore +++ b/.gitignore @@ -9,7 +9,7 @@ nonfree/ # Dependency files -.deps +.chs_deps .bender/ # Software build files diff --git a/cheshire.mk b/cheshire.mk index ac437c15f..6b3463ebb 100644 --- a/cheshire.mk +++ b/cheshire.mk @@ -31,15 +31,17 @@ chs-all: chs-sw-all chs-hw-all chs-sim-all chs-xilinx-all # Dependencies # ################ +BENDER_ROOT ?= $(CHS_ROOT) + # Ensure both Bender dependencies and (essential) submodules are checked out -$(CHS_ROOT)/.deps: +$(BENDER_ROOT)/.chs_deps: $(BENDER) checkout - git submodule update --init --recursive sw/deps/printf + cd $(CHS_ROOT) && git submodule update --init --recursive sw/deps/printf @touch $@ # Make sure dependencies are more up-to-date than any targets run -ifeq ($(shell stat $(CHS_ROOT)/.deps),) -include $(CHS_ROOT)/.deps +ifeq ($(shell test -f $(BENDER_ROOT)/.chs_deps && echo 1),) +-include $(BENDER_ROOT)/.chs_deps endif ######################