]> git.proxmox.com Git - proxmox-backup.git/blobdiff - Makefile
split out proxmox-backup-debug binary
[proxmox-backup.git] / Makefile
index 690f766403c1aa34fb13ecfdd7540f99567ce182..20a92b2eb9a53b9819401df11f67dd8ae1c64c12 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -17,7 +17,8 @@ USR_BIN := \
 
 # Binaries usable by admins
 USR_SBIN := \
-       proxmox-backup-manager
+       proxmox-backup-manager \
+       proxmox-backup-debug \
 
 # Binaries for services:
 SERVICE_BIN := \
@@ -33,10 +34,16 @@ RESTORE_BIN := \
 SUBCRATES := \
        pbs-api-types \
        pbs-buildcfg \
+       pbs-client \
        pbs-datastore \
+       pbs-fuse-loop \
        pbs-runtime \
        pbs-systemd \
-       pbs-tools
+       pbs-tools \
+       proxmox-backup-banner \
+       proxmox-backup-client \
+       proxmox-backup-debug \
+       pxar-bin
 
 ifeq ($(BUILD_MODE), release)
 CARGO_BUILD_ARGS += --release
@@ -73,7 +80,7 @@ DESTDIR=
 
 tests ?= --workspace
 
-all: cargo-build $(SUBDIRS)
+all: $(SUBDIRS)
 
 .PHONY: $(SUBDIRS)
 $(SUBDIRS):
@@ -93,7 +100,7 @@ build:
        rm -rf build
        mkdir build
        cp -a debian \
-         Cargo.toml build.rs src \
+         Cargo.toml src \
          $(SUBCRATES) \
          docs etc examples tests www zsh-completions \
          defines.mk Makefile \
@@ -130,10 +137,11 @@ $(DSC): build
 
 .PHONY: clean distclean deb clean
 distclean: clean
-clean: clean-debs
+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,13 +153,40 @@ 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:
-       $(CARGO) build $(CARGO_BUILD_ARGS)
+       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
+       $(CARGO) build $(CARGO_BUILD_ARGS) \
+           --package proxmox-backup-banner \
+           --bin proxmox-backup-banner \
+           --package proxmox-backup-client \
+           --bin proxmox-backup-client \
+           --package proxmox-backup-debug \
+           --bin proxmox-backup-debug \
+           --package pxar-bin \
+           --bin pxar \
+           --package proxmox-backup \
+           --bin dump-catalog-shell-cli \
+           --bin pmt --bin pmtx \
+           --bin proxmox-daily-update \
+           --bin proxmox-file-restore \
+           --bin proxmox-restore-daemon \
+           --bin proxmox-tape \
+           --bin pxar \
+           --bin sg-tape-cmd
+       touch "$@"
 
-$(COMPILED_BINS): cargo-build
 
 .PHONY: lint
 lint:
@@ -177,6 +212,9 @@ install: $(COMPILED_BINS)
            install -m755 $(COMPILEDIR)/$(i) $(DESTDIR)$(LIBEXECDIR)/proxmox-backup/ ;)
        $(MAKE) -C www install
        $(MAKE) -C docs install
+ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
+       $(MAKE) test # HACK, only test now to avoid clobbering build files with wrong config
+endif
 
 .PHONY: upload
 upload: ${SERVER_DEB} ${CLIENT_DEB} ${RESTORE_DEB} ${DOC_DEB}