Brush up the go code

This commit is contained in:
2022-04-19 21:22:59 +02:00
parent b88208ba3d
commit 63875a6f59
7 changed files with 161 additions and 46 deletions

View File

@@ -1,9 +1,18 @@
.PHONY: help
help: ## Lists all commands available
# Snippet comes from: https://gist.github.com/prwhite/8168133#gistcomment-3785627
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m\033[0m\n"} /^[$$()% 0-9a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
.PHONY: build
build: ## Build the main covergen CLI for the local platform
go build -o covergen ./cmd/covergen
.PHONY: wasm
wasm: ## Generate the main WASM blob
GOOS=js GOARCH=wasm go build -o covergen.wasm ./cmd/wasm/main.go
.PHONY: build-cross-clis
build-cross-clis:
build-cross-clis: ## Builds the CLIs for all supported platforms
rm -rf ./dist && mkdir ./dist
GOOS=linux GOARCH=amd64 go build -o dist/covergen.linux-amd64 ./cmd/covergen
GOOS=darwin GOARCH=amd64 go build -o dist/covergen.darwin-amd64 ./cmd/covergen
.PHONY: wasm
wasm:
GOOS=js GOARCH=wasm go build -o covergen.wasm ./cmd/wasm/main.go