diff --git a/Makefile b/Makefile index b577d443d9a953f3b7e7f22235de8cd48b9b7a5f..0365f697cd4446b4e31205c85573051326a772dc 100644 --- a/Makefile +++ b/Makefile @@ -16,22 +16,18 @@ TOOL_BIN_DIR ?= $(shell go env GOPATH)/bin TOOL_GOLINT := $(TOOL_BIN_DIR)/golint TOOL_STATICCHECK := $(TOOL_BIN_DIR)/staticcheck -GO_SOURCES = $(shell find . -name *.go) - # ============================================================================= # build # ============================================================================= -build: $(DIST_PATH)/go-httpbin - -buildtests: $(DIST_PATH)/go-httpbin.test - -$(DIST_PATH)/go-httpbin: $(GO_SOURCES) +build: mkdir -p $(DIST_PATH) CGO_ENABLED=0 go build -ldflags="-s -w" -o $(DIST_PATH)/go-httpbin ./cmd/go-httpbin +.PHONY: build -$(DIST_PATH)/go-httpbin.test: $(GO_SOURCES) +buildtests: CGO_ENABLED=0 go test -ldflags="-s -w" -v -c -o $(DIST_PATH)/go-httpbin.test ./httpbin +.PHONY: buildtests clean: rm -rf $(DIST_PATH) $(COVERAGE_PATH)