From 607456907618bcfe14db51be3527c0376d2f4a27 Mon Sep 17 00:00:00 2001 From: Evan Pratten Date: Mon, 12 Feb 2024 10:13:37 -0500 Subject: [PATCH] Add makefile --- Makefile | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..3f0a822 --- /dev/null +++ b/Makefile @@ -0,0 +1,19 @@ +# All sources used to build the protomask binary +SRC = Cargo.toml $(shell find src/ -type f -name '*.rs') + +# Used to auto-version things +CRATE_VERSION = $(shell sed -n -r "s/^version = \"([0-9\.]+)\"/\1/p" Cargo.toml) + +all: target/x86_64-unknown-linux-musl/release/protomask target/aarch64-unknown-linux-musl/release/protomask target/x86_64-unknown-linux-musl/debian/protomask_${CRATE_VERSION}_amd64.deb target/aarch64-unknown-linux-musl/debian/protomask_${CRATE_VERSION}_arm64.deb + +target/x86_64-unknown-linux-musl/release/protomask: $(SRC) + cross build --target x86_64-unknown-linux-musl --release + +target/aarch64-unknown-linux-musl/release/protomask: $(SRC) + cross build --target aarch64-unknown-linux-musl --release + +target/x86_64-unknown-linux-musl/debian/protomask_${CRATE_VERSION}_amd64.deb: target/x86_64-unknown-linux-musl/release/protomask + cargo deb --target x86_64-unknown-linux-musl --no-build + +target/aarch64-unknown-linux-musl/debian/protomask_${CRATE_VERSION}_arm64.deb: target/aarch64-unknown-linux-musl/release/protomask + cargo deb --target aarch64-unknown-linux-musl --no-build \ No newline at end of file