restream/makefile
Mark 3d084b7543
Some checks failed
Check / formatting (push) Failing after 11s
Check / linting (push) Failing after 14s
Check / build (push) Failing after 1m26s
Move
2025-01-26 19:28:51 -08:00

32 lines
776 B
Makefile

BUILD = "./build"
PWD := $(shell pwd)
TABLET = "root@10.11.99.1"
BIN_NAME = "restream"
.PHONY: default
default: build/restream
.PHONY: clean
clean:
rm -drf target $(BUILD)
# Push built files to remarkable,
# removing old ones
.PHONY: push
push: $(BUILD)/$(BIN_NAME)
ssh "$(TABLET)" "rm -f /home/root/$(BIN_NAME)"
scp "./build/$(BIN_NAME)" "$(TABLET):/home/root/$(BIN_NAME)"
# Compile using toltec container
# TODO: self-host this
# TODO: overlay
$(BUILD)/$(BIN_NAME):
@mkdir -p $(BUILD)
docker run --rm \
-v $(PWD)/server:/project \
-v "/project/.cargo" \
-w "/project" \
ghcr.io/toltec-dev/rust:latest \
cargo build --release --target=armv7-unknown-linux-gnueabihf
cp "server/target/armv7-unknown-linux-gnueabihf/release/restream" "./build/$(BIN_NAME)"