Initial euclide.org release
This commit is contained in:
39
client/Makefile
Normal file
39
client/Makefile
Normal file
@@ -0,0 +1,39 @@
|
||||
# -*- mode: makefile -*-
|
||||
|
||||
PROJECTNAME := client
|
||||
GO_LDFLAGS_STATIC=-ldflags "-w $(CTIMEVAR) -extldflags -static"
|
||||
GO := go
|
||||
|
||||
all: build fmt lint test
|
||||
|
||||
.PHONY: fmt
|
||||
fmt: ## Verifies all files have been `gofmt`ed.
|
||||
@echo "+ $@"
|
||||
$(eval var = $(shell gofmt -s -l . | grep -v vendor | tee /dev/stderr))
|
||||
@if [ ! -z "${var}" ]; then exit 1; fi
|
||||
|
||||
|
||||
.PHONY: build
|
||||
build: ## Builds a static executable.
|
||||
@echo "+ $@"
|
||||
CGO_ENABLED=0 $(GO) build -mod=vendor \
|
||||
-o $(PROJECTNAME) \
|
||||
-tags "static_build netgo" \
|
||||
-installsuffix netgo ${GO_LDFLAGS_STATIC} .;
|
||||
|
||||
|
||||
.PHONY: test
|
||||
test: ## Generates test certificates & run unit tests.
|
||||
go vet -mod=vendor
|
||||
go test -v -mod=vendor
|
||||
|
||||
|
||||
.PHONY: lint
|
||||
lint: ## Verifies `golint` passes.
|
||||
@echo "+ $@"
|
||||
$(eval var = $(shell golint ./... | grep -v vendor | tee /dev/stderr))
|
||||
@if [ ! -z "${var}" ]; then exit 1; fi
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -f $(PROJECTNAME)
|
||||
Reference in New Issue
Block a user