added makefile
This commit is contained in:
parent
ccd25535db
commit
f317f9365a
32
makefile
Normal file
32
makefile
Normal file
@ -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)"
|
Loading…
x
Reference in New Issue
Block a user