Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Makefile Builder (Tool) #2

Merged
merged 2 commits into from
Sep 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"