-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
42 lines (31 loc) · 760 Bytes
/
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
prog := releasecraftsman
version ?= latest
debug ?=
ifdef debug
release :=
target := debug
extension := debug
else
release := --release
target := release
extension :=
endif
os := $(shell uname -s | tr '[:upper:]' '[:lower:]')
# need to change this in future
arch := x86_64
tar_name := $(prog)-$(version)-$(arch)-$(os).tar.gz
$(info debug is $(debug))
$(info version is $(version))
$(info OS is $(os))
$(info Arch is $(arch))
build:
cargo build $(release)
install:
cp target/$(target)/$(prog) /usr/local/bin/
package: build
cd target/$(target) && tar -czf $(tar_name) $(prog)
checksum: package
shasum -a 256 target/$(target)/$(tar_name)
all: build install package checksum
help:
@echo "usage: make $(prog) [debug=1] [version=x.y.z]"