# (c) cavaliba.com - cavctl Makefile

.DEFAULT_GOAL := build

compile:
	@echo "Compiling for every OS and Platform"
	CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -tags netgo -ldflags '-w' -o bin/cavctl main.go
	CGO_ENABLED=0 GOOS=windows GOARCH=amd64  go build -a -o bin/cavctl.exe main.go
	CGO_ENABLED=0 GOOS=darwin  go build -a -tags netgo -ldflags '-w' -o bin/cavctl.darwin main.go
	#GOOS=linux go build -o bin/cavctl.linux main.go
	#GOOS=darwin go build -o bin/cavctl.darwin main.go
	#GOOS=windows go build -o bin/cavctl.exe main.go

build:
	@echo "Build for current platform"
	go build -o bin/cavctl main.go

fmt:
	@echo "Format"
	go fmt ./...

vet:
	@echo "Vet"
	go vet ./...

run:
	go run main.go

all: fmt vet build compile
