]> git.proxmox.com Git - proxmox-perl-rs.git/blame - Makefile
pve: upgrade perlmod-bin dependency to 0.2
[proxmox-perl-rs.git] / Makefile
CommitLineData
50754a46
WB
1CARGO ?= cargo
2
50754a46
WB
3ifeq ($(BUILD_MODE), release)
4CARGO_BUILD_ARGS += --release
9fcecb2c 5else
50754a46
WB
6endif
7
8.PHONY: all
9all:
10ifeq ($(BUILD_TARGET), pve)
11 $(MAKE) pve
12else ifeq ($(BUILD_TARGET), pmg)
4beb3570 13 $(MAKE) pmg
50754a46 14else
4beb3570
WB
15 @echo "Run one of"
16 @echo " - make pve"
17 @echo " - make pmg"
50754a46
WB
18endif
19
50754a46 20build:
9fcecb2c 21 rm -rf build
50754a46
WB
22 mkdir build
23 echo system >build/rust-toolchain
29181c7a 24 cp -a ./Cargo.toml ./build
4beb3570 25 cp -a ./common ./build
ec79616b 26 cp -a ./pve-rs ./build
b6274a49 27 cp -a ./pmg-rs ./build
932d602d
WB
28# Replace the symlinks with copies of the common code in pve/pmg:
29 cd build; for i in pve pmg; do \
30 rm ./$$i-rs/common ; \
31 mkdir ./$$i-rs/common ; \
32 cp -R ./common/src ./$$i-rs/common/src ; \
33 done
4beb3570
WB
34# So the common packages end up in ./build, rather than ./build/common
35 mv ./build/common/pkg ./build/common-pkg
34a00686
WB
36# Copy the workspace root into the sources
37 mkdir build/pve-rs/.workspace
38 cp -t build/pve-rs/.workspace Cargo.toml
39 sed -i -e '/\[package\]/a\workspace = ".workspace"' build/pve-rs/Cargo.toml
40# Clear the member array and replace it with ".."
41 sed -i -e '/^members = \[/,/^]$$/d' build/pve-rs/.workspace/Cargo.toml
42 sed -i -e '/^\[workspace\]/a\members = [ ".." ]' build/pve-rs/.workspace/Cargo.toml
43# Copy the cargo config
44 mkdir build/pve-rs/.cargo
45 cp -t build/pve-rs/.cargo .cargo/config