-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
47 lines (38 loc) · 1.54 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
.DEFAULT_GOAL := build
ARC_VERSION := $(shell cat src/main.rs | grep 'static VERSION' | sed -e 's/.*=//g' -e 's/[" ;]//g')
ARC_NAME := mezzotint-${ARC_VERSION}
.PHONY:build
dev: man
cargo build -v
build:
cargo build -v --release
man:
pandoc --standalone --to man docs/manpages/mezzotint.8.md -o docs/manpages/mezzotint.8
tar:
# Cleanup
rm -rf package/${ARC_NAME}
cargo vendor
mkdir -p package/${ARC_NAME}/.cargo
cp .vendor.toml package/${ARC_NAME}/.cargo/config.toml
cp LICENSE package/${ARC_NAME}
cp README.md package/${ARC_NAME}
cp Cargo.lock package/${ARC_NAME}
cp Cargo.toml package/${ARC_NAME}
cp Makefile package/${ARC_NAME}
cp -a docs package/${ARC_NAME}
cp -a src package/${ARC_NAME}
cp -a vendor package/${ARC_NAME}
# Cleanup. Also https://github.com/rust-lang/cargo/issues/7058
find package/${ARC_NAME} -type d -wholename "*/target" -prune -exec rm -rf {} \;
find package/${ARC_NAME} -type d -wholename "*/vendor/winapi*" -prune -exec \
rm -rf {}/src \; -exec mkdir -p {}/src \; -exec touch {}/src/lib.rs \; -exec rm -rf {}/lib \;
find package/${ARC_NAME} -type d -wholename "*/vendor/windows*" -prune -exec \
rm -rf {}/src \; -exec mkdir -p {}/src \; -exec touch {}/src/lib.rs \; -exec rm -rf {}/lib \;
rm -rf package/${ARC_NAME}/vendor/web-sys/src/*
rm -rf package/${ARC_NAME}/vendor/web-sys/webidls
mkdir -p package/${ARC_NAME}/vendor/web-sys/src
touch package/${ARC_NAME}/vendor/web-sys/src/lib.rs
# Tar the source
tar -C package -czvf package/${ARC_NAME}.tar.gz ${ARC_NAME}
rm -rf package/${ARC_NAME}
rm -rf vendor