Skip to content

Commit

Permalink
Merge pull request #2 from yelsaw/builder
Browse files Browse the repository at this point in the history
Add Makefile Builder (Tool)
  • Loading branch information
yelsaw committed Sep 6, 2024
2 parents 0da7ebe + fe801dd commit 6b94267
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
VERSION := v0.0.1
APP := gotp
GO_LDFLAGS="-s -extldflags=-static"

_: linux darwin windows
tar cfv gotp-linux_$(VERSION).tar build/linux/*
tar cfv gotp-darwin_$(VERSION).tar build/darwin/*
zip gotp-windows_$(VERSION).zip build/windows/*

clean:
rm -rf build

linux:
@echo "Building ..."
go clean
go get
@GOOS=linux CGO_ENABLED=0 go build -ldflags=$(GO_LDFLAGS) -o build/linux/$(APP)-linux
@echo "finished"

darwin:
@echo "Building ..."
go clean
go get
@GOOS=darwin go build -ldflags=$(GO_LDFLAGS) -o build/darwin/$(APP)-darwin
@echo "finished"

windows:
@echo "Building ..."
go clean
go get
@GOOS=windows go build -ldflags=$(GO_LDFLAGS) -o build/windows/$(APP).exe
@echo "finished"

0 comments on commit 6b94267

Please sign in to comment.