restream/makefile

32 lines
762 B
Makefile
Raw Normal View History

2025-01-25 16:02:47 -08:00
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):/project \
-v "/project/.cargo" \
-w "/project" \
ghcr.io/toltec-dev/rust:latest \
cargo build --release --target=armv7-unknown-linux-gnueabihf
cp "target/armv7-unknown-linux-gnueabihf/release/restream" "./build/$(BIN_NAME)"