From ede4ca8b3647582c5b27313ab311d099ea8aa324 Mon Sep 17 00:00:00 2001 From: Benoit Pierre Date: Thu, 8 Aug 2024 22:07:51 +0200 Subject: [PATCH] make: improve `fetchthirdparty` rule - fix running `make` from new checkout - fetch all submodules recursively (don't defer to base), including luajit-launcher --- Makefile | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 6979ed74c..2506c757c 100644 --- a/Makefile +++ b/Makefile @@ -145,29 +145,25 @@ coverage: $(INSTALL_DIR)/koreader/.luacov +$$(($$(grep -nm1 -e "^Summary$$" luacov.report.out|cut -d: -f1)-1)) \ luacov.report.out -ifeq (,$(wildcard $(KOR_BASE)/Makefile)) -$(KOR_BASE)/Makefile: fetchthirdparty -endif -ifeq (,$(wildcard $(KOR_BASE)/Makefile.defs)) -$(KOR_BASE)/Makefile.defs: fetchthirdparty +ifeq (,$(wildcard $(KOR_BASE)/Makefile $(KOR_BASE)/Makefile.defs)) +$(KOR_BASE)/Makefile $(KOR_BASE)/Makefile.defs: fetchthirdparty + # Need a recipe, even if empty, or make won't know how to remake `base-all`. endif fetchthirdparty: - git submodule init - git submodule sync + git submodule sync --recursive ifneq (,$(CI)) - git submodule update --depth 1 --jobs 3 + git submodule update --depth 1 --jobs 3 --init --recursive else # Force shallow clones of submodules configured as such. - git submodule update --jobs 3 --depth 1 $(shell \ + git submodule update --jobs 3 --depth 1 --init $(shell \ git config --file=.gitmodules --name-only --get-regexp '^submodule\.[^.]+\.shallow$$' true \ | sed 's/\.shallow$$/.path/' \ | xargs -n1 git config --file=.gitmodules \ ) # Update the rest. - git submodule update --jobs 3 + git submodule update --jobs 3 --init --recursive endif - $(MAKE) -C $(KOR_BASE) fetchthirdparty clean: base-clean rm -rf $(INSTALL_DIR)