1
0
Fork 0
duckycode/Makefile
2019-02-12 20:55:02 +01:00

35 lines
592 B
Makefile

CC=go
BUILD=build -v
GCFLAGS=-gcflags '-e'
LDFLAGS=-ldflags '-s -w'
PROGRAM=duckycode
ENV=CGO_ENABLED=0
all: $(PROGRAM)
$(PROGRAM): clean codeqa
$(ENV) $(CC) $(BUILD) $(LDFLAGS)
clean:
$(CC) clean -x
codeqa: generate gofmt test
generate:
$(CC) generate
gofmt:
gofmt -w pkg/ main.go
test:
ifeq ($(shell go env GOARCH), $(shell go env GOHOSTARCH))
ifeq ($(shell go env GOOS), $(shell go env GOHOSTOS))
$(CC) test ./...
else
$(info skipping tests of other platforms)
endif
else
$(info skipping tests of other platforms)
endif
.PHONY: vendor build clean codeqa generate gofmt test