-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
version as argument, package and checksum
- Loading branch information
1 parent
75359a7
commit dd2aa25
Showing
1 changed file
with
27 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,42 @@ | ||
prog :=releasecraftsman | ||
prog := releasecraftsman | ||
version ?= latest | ||
|
||
debug ?= | ||
|
||
$(info debug is $(debug)) | ||
|
||
ifdef debug | ||
release := | ||
target :=debug | ||
extension :=debug | ||
target := debug | ||
extension := debug | ||
else | ||
release :=--release | ||
target :=release | ||
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/ | ||
|
||
all: build install | ||
|
||
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]" | ||
@echo "usage: make $(prog) [debug=1] [version=x.y.z]" |