2
0
mirror of https://github.com/koreader/koreader synced 2024-11-10 01:10:34 +00:00

make: improve fetchthirdparty rule

- fix running `make` from new checkout
- fetch all submodules recursively (don't defer to base), including luajit-launcher
This commit is contained in:
Benoit Pierre 2024-08-08 22:07:51 +02:00 committed by Frans de Jonge
parent 466971c0e2
commit ede4ca8b36

View File

@ -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)