-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert build script to a Makefile. (#24)
* Convert build script to a Makefile. * Oops I forgot to delete build.sh
- Loading branch information
1 parent
5495346
commit 733e179
Showing
2 changed files
with
35 additions
and
20 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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
.PHONY: build build-linux build-mac build-windows release clean | ||
|
||
ROOT := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) | ||
|
||
build: ## Build Slack Advanced Exporter for the current platform and architecture | ||
go build . | ||
|
||
build-linux: ## Build Slack Advanced Exporter for Linux | ||
@mkdir -p ${ROOT}build | ||
cd ${ROOT}build && GOOS=linux GOARCH=amd64 go build .. | ||
|
||
build-mac: ## Build Slack Advanced Exporter for Mac | ||
@mkdir -p ${ROOT}build | ||
cd ${ROOT}build && GOOS=darwin GOARCH=amd64 go build .. | ||
|
||
build-windows: ## Build Slack Advanced Exporter for Windows | ||
@mkdir -p ${ROOT}build | ||
cd ${ROOT}build && GOOS=windows GOARCH=amd64 go build .. | ||
|
||
release: clean ## Build and package the release artefacts | ||
@mkdir -p ${ROOT}build | ||
@mkdir -p ${ROOT}release | ||
cd ${ROOT}build && GOOS=linux GOARCH=amd64 go build .. | ||
cd ${ROOT}build && tar -czf ../release/slack-advanced-exporter.linux-amd64.tar.gz slack-advanced-exporter | ||
cd ${ROOT}build && GOOS=darwin GOARCH=amd64 go build .. | ||
cd ${ROOT}build && tar -czf ../release/slack-advanced-exporter.darwin-amd64.tar.gz slack-advanced-exporter | ||
cd ${ROOT}build && GOOS=windows GOARCH=amd64 go build .. | ||
cd ${ROOT}build && zip -q ../release/slack-advanced-exporter.windows-amd64.zip slack-advanced-exporter.exe | ||
cd ${ROOT}release && sha256sum ./slack-advanced-exporter.* | ||
|
||
clean: ## Remove all build and release artefacts | ||
rm -rf build | ||
rm -rf release | ||
rm -rf slack-advanced-exporter | ||
rm -rf slack-advanced-exporter.exe |