diff --git a/makefile b/makefile new file mode 100644 index 0000000..775c29a --- /dev/null +++ b/makefile @@ -0,0 +1,32 @@ +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)" \ No newline at end of file