Skip to content

Commit

Permalink
Makefile: Improve dep tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
paulsc96 committed Jul 6, 2023
1 parent e44f108 commit e6f3460
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
nonfree/

# Dependency files
.deps
.chs_deps
.bender/

# Software build files
Expand Down
10 changes: 6 additions & 4 deletions cheshire.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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

######################
Expand Down

0 comments on commit e6f3460

Please sign in to comment.