-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
58 lines (48 loc) · 1.64 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.PHONY: install-targets-mac-x86
install-targets-mac-x86:
rustup target add x86_64-apple-darwin
.PHONY: install-targets-mac-arm
install-targets-mac-arm:
rustup target add aarch64-apple-darwin
.PHONY: install-targets-linux
install-targets-linux:
rustup target add x86_64-unknown-linux-gnu
.PHONY: build-macos-x86
build-macos-x86:
cargo build --release --target x86_64-apple-darwin
cp target/x86_64-apple-darwin/release/caniuse ./caniuse-macos-x86
.PHONY: build-macos-arm
build-macos-arm:
cargo build --release --target aarch64-apple-darwin
cp target/aarch64-apple-darwin/release/caniuse ./caniuse-macos-arm
.PHONY: build-linux
build-linux:
cargo build --release --target x86_64-unknown-linux-gnu
cp target/x86_64-unknown-linux-gnu/release/caniuse ./caniuse-linux-x86
.PHONY: build
build:
cargo build
.PHONY: alfred-workflow
alfred-workflow:
@if [ "$(WORKFLOW_FILE_NAME)" = "" ]; then echo "WORKFLOW_FILE_NAME variable not set"; exit 1; fi
@if [ "$(CANIUSE_BIN)" = "" ]; then echo "CANIUSE_BIN variable not set"; exit 1; fi
rm -f caniuse-x86.alfredworkflow
zip -j -D $(WORKFLOW_FILE_NAME) info.plist
zip -j -D $(WORKFLOW_FILE_NAME) README.md
zip -j -D $(WORKFLOW_FILE_NAME) LICENSE
zip -j -D $(WORKFLOW_FILE_NAME) images/icon.png
# temporarily rename so it has the right name inside the zip
mv $(CANIUSE_BIN) caniuse
chmod +x caniuse
zip -j -D $(WORKFLOW_FILE_NAME) caniuse
mv caniuse $(CANIUSE_BIN)
.PHONY: publish
publish:
@if [ "$(CARGO_TOKEN)" = "" ]; then echo "CARGO_TOKEN variable not set"; exit 1; fi
cargo login $(CARGO_TOKEN)
cargo publish
.PHONY: clean
clean:
cargo clean
rm -f caniuse-x86.alfredworkflow
rm -f caniuse-arm.alfredworkflow