]> git.proxmox.com Git - proxmox-backup.git/commitdiff
buildsys: try to avoid duplicate build due to "phony" docs dependency
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 12 Jul 2021 11:15:17 +0000 (13:15 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 12 Jul 2021 11:19:20 +0000 (13:19 +0200)
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 <t.lamprecht@proxmox.com>
Makefile

index 4579d5db211320a8c8c19d18290f9b45df3eb03f..5ca7c0310eef349d3a7d8564e9b56fb4a493ac54 100644 (file)
--- 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: