From 424d2d68d34125e60fd91ad0928f9b777837f11b Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Mon, 12 Jul 2021 13:15:17 +0200 Subject: [PATCH] buildsys: try to avoid duplicate build due to "phony" docs dependency Make docs target depend directly on the some docs-only required binaries and add a new intermediate ".do-cargo-build" target that is explicitly not a PHONY target. That avoids one extra set of full builds. Signed-off-by: Thomas Lamprecht --- Makefile | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 4579d5db..5ca7c031 100644 --- a/Makefile +++ b/Makefile @@ -73,7 +73,7 @@ DESTDIR= tests ?= --workspace -all: cargo-build $(SUBDIRS) +all: $(SUBDIRS) .PHONY: $(SUBDIRS) $(SUBDIRS): @@ -134,6 +134,7 @@ clean: clean-deb $(foreach i,$(SUBDIRS), \ $(MAKE) -C $(i) clean ;) $(CARGO) clean + rm -f .do-cargo-build find . -name '*~' -exec rm {} ';' # allows one to avoid running cargo clean when one just wants to tidy up after a packgae build @@ -145,10 +146,15 @@ dinstall: ${SERVER_DEB} ${SERVER_DBG_DEB} ${CLIENT_DEB} ${CLIENT_DBG_DEB} dpkg -i $^ # make sure we build binaries before docs -docs: cargo-build +docs: $(COMPILEDIR)/dump-catalog-shell-cli $(COMPILEDIR)/docgen .PHONY: cargo-build cargo-build: + rm -f .do-cargo-build + $(MAKE) $(COMPILED_BINS) + +$(COMPILED_BINS) $(COMPILEDIR)/dump-catalog-shell-cli $(COMPILEDIR)/docgen: .do-cargo-build +.do-cargo-build: RUSTFLAGS="--cfg openid" $(CARGO) build $(CARGO_BUILD_ARGS) \ --bin proxmox-backup-api --bin proxmox-backup-proxy \ --bin proxmox-backup-manager --bin docgen @@ -163,8 +169,8 @@ cargo-build: --bin proxmox-tape \ --bin pxar \ --bin sg-tape-cmd + touch "$@" -$(COMPILED_BINS): cargo-build .PHONY: lint lint: