Skip to content

Commit

Permalink
Let the VERSION variable in the Makefile be the single source of trut…
Browse files Browse the repository at this point in the history
…h, to reduce chance of version mismatches.
  • Loading branch information
spytheman committed Feb 3, 2019
1 parent 7c2fb11 commit d3c5d01
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
VERSION=0.5

GOBUILD?=go build -ldflags "-X main.version=$(VERSION)"
.PHONY: clean binaries release

clean:
Expand All @@ -8,25 +8,25 @@ clean:
binaries: binaries/osx_x86_64/gostamp binaries/windows_x86_64/gostamp.exe binaries/linux_x86_64/gostamp binaries/osx_x86_32/gostamp binaries/windows_x86_32/gostamp.exe binaries/linux_x86_32/gostamp

binaries/osx_x86_64/gostamp:
GOOS=darwin GOARCH=amd64 go build -o binaries/osx_x86_64/gostamp
GOOS=darwin GOARCH=amd64 $(GOBUILD) -o binaries/osx_x86_64/gostamp

binaries/osx_x86_32/gostamp:
GOOS=darwin GOARCH=386 go build -o binaries/osx_x86_32/gostamp
GOOS=darwin GOARCH=386 $(GOBUILD) -o binaries/osx_x86_32/gostamp

binaries/windows_x86_64/gostamp.exe:
GOOS=windows GOARCH=amd64 go build -o binaries/windows_x86_64/gostamp.exe
GOOS=windows GOARCH=amd64 $(GOBUILD) -o binaries/windows_x86_64/gostamp.exe

binaries/windows_x86_32/gostamp.exe:
GOOS=windows GOARCH=386 go build -o binaries/windows_x86_32/gostamp.exe
GOOS=windows GOARCH=386 $(GOBUILD) -o binaries/windows_x86_32/gostamp.exe

binaries/linux_x86_64/gostamp:
GOOS=linux GOARCH=amd64 go build -o binaries/linux_x86_64/gostamp
GOOS=linux GOARCH=amd64 $(GOBUILD) -o binaries/linux_x86_64/gostamp

binaries/linux_x86_32/gostamp:
GOOS=linux GOARCH=386 go build -o binaries/linux_x86_32/gostamp
GOOS=linux GOARCH=386 $(GOBUILD) -o binaries/linux_x86_32/gostamp

binaries/linux_arm64/gostamp:
GOOS=linux GOARCH=arm64 go build -o binaries/linux_arm64/gostamp
GOOS=linux GOARCH=arm64 $(GOBUILD) -o binaries/linux_arm64/gostamp

release: binaries
mkdir -p release/ ;
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type programSettings struct {
}

var (
version = "0.5"
version string
cmdline = ""
settings programSettings
)
Expand Down

0 comments on commit d3c5d01

Please sign in to comment.