-
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.
build: add builds for windows, linux & darwin
- add bare and full featured builds for: - darwin/amd64 - darwin/arm64 - linux/i386 - linux/amd64 - linux/arm - linux/arm64 - windows/i386 - windows/amd64 - windows/arm - windows/arm64 - update build steps to remove out dir before rebuild - omit symbol table and debug information in final build - omit DWARF symbol table - replace the following variables in the source files with values: - VERSION: is replaced with the current version defined in the makefile, e.g.: 0.0.0-pre+1 - BUILD_AT: is replaced with the date the build occured - BUILD_BY: is replaced with the 'user.name' and the 'user.email', both values are aquired using the 'git config --global' command and therefore depend on the currently building machine and its git user. - the bare build now prints the above variables on start - the full featured build prints these if invoked with '--version'
- Loading branch information
Showing
3 changed files
with
91 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,13 +1,79 @@ | ||
ver := "0.1.0" | ||
opt := "" | ||
ver := 0.0.0-pre | ||
build_at := $(shell date +"%Y-%m-%dT%H:%M:%S%z") | ||
build_by := $(shell git config --global user.name)-$(shell git config --global user.email) | ||
feat := 1 | ||
opt := -ldflags="-w -s -X main.VERSION=$(ver)+$(feat) -X main.BUILD_AT=$(build_at) -X main.BUILD_BY=$(build_by)" | ||
|
||
dev: pre | ||
mkdir -p ./out/dev | ||
go build -o ./out/dev/ | ||
release: build_linux build_darwin build_windows | ||
|
||
release: pre | ||
mkdir -p ./out/release | ||
go build -o ./out/release/ | ||
build_linux: pre | ||
env = CGO_ENABLED=0 GOOS=linux GOARCH=386 | ||
$(env) go build -o ./out/linux/fleck_$(ver)+$(feat)_linux-i386 $(opt) | ||
|
||
pre: | ||
env = CGO_ENABLED=0 GOOS=linux GOARCH=386 | ||
$(env) go build -tags=bare -o ./out/linux/fleck-bare_$(ver)+$(feat)_linux-i386 $(opt) | ||
|
||
env = CGO_ENABLED=0 GOOS=linux GOARCH=amd64 | ||
$(env) go build -o ./out/linux/fleck_$(ver)+$(feat)_linux-x86_64 $(opt) | ||
|
||
env = CGO_ENABLED=0 GOOS=linux GOARCH=amd64 | ||
$(env) go build -tags=bare -o ./out/linux/fleck-bare_$(ver)+$(feat)_linux-x86_64 $(opt) | ||
|
||
env = CGO_ENABLED=0 GOOS=linux GOARCH=arm | ||
$(env) go build -o ./out/linux/fleck_$(ver)+$(feat)_linux-arm $(opt) | ||
|
||
env = CGO_ENABLED=0 GOOS=linux GOARCH=arm | ||
$(env) go build -tags=bare -o ./out/linux/fleck-bare_$(ver)+$(feat)_linux-arm $(opt) | ||
|
||
env = CGO_ENABLED=0 GOOS=linux GOARCH=arm64 | ||
$(env) go build -o ./out/linux/fleck_$(ver)+$(feat)_linux-arm64 $(opt) | ||
|
||
env = CGO_ENABLED=0 GOOS=linux GOARCH=arm64 | ||
$(env) go build -tags=bare -o ./out/linux/fleck-bare_$(ver)+$(feat)_linux-arm64 $(opt) | ||
|
||
build_windows: pre | ||
env = CGO_ENABLED=0 GOOS=windows GOARCH=386 | ||
$(env) go build -o ./out/windows/fleck_$(ver)+$(feat)_windows-i386.exe $(opt) | ||
|
||
env = CGO_ENABLED=0 GOOS=windows GOARCH=386 | ||
$(env) go build -tags=bare -o ./out/windows/fleck-bare_$(ver)+$(feat)_windows-i386.exe $(opt) | ||
|
||
env = CGO_ENABLED=0 GOOS=windows GOARCH=amd64 | ||
$(env) go build -o ./out/windows/fleck_$(ver)+$(feat)_windows-amd64.exe $(opt) | ||
|
||
env = CGO_ENABLED=0 GOOS=windows GOARCH=amd64 | ||
$(env) go build -tags=bare -o ./out/windows/fleck-bare_$(ver)+$(feat)_windows-amd64.exe $(opt) | ||
|
||
env = CGO_ENABLED=0 GOOS=windows GOARCH=arm | ||
$(env) go build -o ./out/windows/fleck_$(ver)+$(feat)_windows-arm.exe $(opt) | ||
|
||
env = CGO_ENABLED=0 GOOS=windows GOARCH=arm | ||
$(env) go build -tags=bare -o ./out/windows/fleck-bare_$(ver)+$(feat)_windows-arm.exe $(opt) | ||
|
||
env = CGO_ENABLED=0 GOOS=windows GOARCH=arm64 | ||
$(env) go build -o ./out/windows/fleck_$(ver)+$(feat)_windows-arm64.exe $(opt) | ||
|
||
env = CGO_ENABLED=0 GOOS=windows GOARCH=arm64 | ||
$(env) go build -tags=bare -o ./out/windows/fleck-bare_$(ver)+$(feat)_windows-arm64.exe $(opt) | ||
|
||
build_darwin: pre | ||
env = CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 | ||
$(env) go build -o ./out/darwin/fleck_$(ver)+$(feat)_darwin-amd64 $(opt) | ||
|
||
env = CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 | ||
$(env) go build -tags=bare -o ./out/darwin/fleck-bare_$(ver)+$(feat)_darwin-amd64 $(opt) | ||
|
||
env = CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 | ||
$(env) go build -o ./out/darwin/fleck_$(ver)+$(feat)_darwin-arm64 $(opt) | ||
|
||
env = CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 | ||
$(env) go build -tags=bare -o ./out/darwin/fleck-bare_$(ver)+$(feat)_darwin-arm64 $(opt) | ||
|
||
pre: clean | ||
mkdir -p ./out | ||
mkdir -p ./out/darwin | ||
mkdir -p ./out/linux | ||
mkdir -p ./out/windows | ||
|
||
clean: | ||
rm -fr ./out |
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
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