Skip to content

Commit

Permalink
version as argument, package and checksum
Browse files Browse the repository at this point in the history
  • Loading branch information
tornikegomareli committed Sep 18, 2023
1 parent 75359a7 commit dd2aa25
Showing 1 changed file with 27 additions and 11 deletions.
38 changes: 27 additions & 11 deletions makefile
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]"

0 comments on commit dd2aa25

Please sign in to comment.