-
Notifications
You must be signed in to change notification settings - Fork 35
/
Makefile
44 lines (33 loc) · 1.21 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
VERSION := v1.0.0-beta.4
SRC_FILES := $(shell find src -name '*.sh' -o -name '*.png')
NEXT_WAKEUP_SRC_FILES := $(shell find src/next-wakeup/src -name '*.rs')
TARGET_FILES := $(SRC_FILES:src/%=dist/%)
dist: dist/next-wakeup dist/xh dist/local/state ${TARGET_FILES}
tarball: dist
tar -C dist -cvzf kindle-dash-${VERSION}.tgz ./
dist/%: src/%
@echo "Copying $<"
@mkdir -p $(@D)
@cp "$<" "$@"
dist/next-wakeup: ${NEXT_WAKEUP_SRC_FILES}
cd src/next-wakeup && cross build --release --target arm-unknown-linux-musleabi
cp src/next-wakeup/target/arm-unknown-linux-musleabi/release/next-wakeup dist/
dist/xh: tmp/xh
cd tmp/xh && cross build --release --target arm-unknown-linux-musleabi
docker run --rm \
-v $(shell pwd)/tmp/xh:/src \
rustembedded/cross:arm-unknown-linux-musleabi-0.2.1 \
/usr/local/arm-linux-musleabi/bin/strip /src/target/arm-unknown-linux-musleabi/release/xh
cp tmp/xh/target/arm-unknown-linux-musleabi/release/xh dist/
tmp/xh:
mkdir -p tmp/
git clone --depth 1 --branch v0.16.1 https://github.com/ducaale/xh.git tmp/xh
dist/local/state:
mkdir -p dist/local/state
clean:
rm -r dist/*
watch:
watchexec -w src/ -p -- make
format:
shfmt -i 2 -w -l src/**/*.sh
.PHONY: clean watch tarball format