Skip to content

Commit

Permalink
Merge pull request #96 from frobware/add-dbg-support
Browse files Browse the repository at this point in the history
Makefile: add Go debug support for local binaries
  • Loading branch information
openshift-merge-robot committed Oct 15, 2018
2 parents db4ac85 + 348a703 commit 812b9ab
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
DBG ?= 0
#REGISTRY ?= quay.io/openshift/
VERSION ?= $(shell git describe --always --abbrev=7)
MUTABLE_TAG ?= latest
IMAGE = $(REGISTRY)machine-api-operator

ifeq ($(DBG),1)
GOGCFLAGS ?= -gcflags=all="-N -l"
endif

.PHONY: all
all: check build test

Expand All @@ -22,18 +27,18 @@ check: lint fmt vet test
build: ## Build binary
@echo -e "\033[32mBuilding package...\033[0m"
mkdir -p bin
$(DOCKER_CMD) go build -o bin/machine-api-operator github.com/openshift/machine-api-operator/cmd/machine-api-operator
$(DOCKER_CMD) go build $(GOGCFLAGS) -o bin/machine-api-operator github.com/openshift/machine-api-operator/cmd/machine-api-operator

.PHONY: nodelink-controller
nodelink-controller:
@echo -e "\033[32mBuilding node link controller binary...\033[0m"
$(DOCKER_CMD) go build -o bin/nodelink-controller github.com/openshift/machine-api-operator/cmd/nodelink-controller
$(DOCKER_CMD) go build $(GOGCFLAGS) -o bin/nodelink-controller github.com/openshift/machine-api-operator/cmd/nodelink-controller

.PHONY: build-e2e
build-e2e: ## Build end-to-end test binary
@echo -e "\033[32mBuilding e2e test binary...\033[0m"
mkdir -p bin
$(DOCKER_CMD) go build -o bin/e2e github.com/openshift/machine-api-operator/tests/e2e
$(DOCKER_CMD) go build $(GOGCFLAGS) -o bin/e2e github.com/openshift/machine-api-operator/tests/e2e

.PHONY: test
test: ## Run tests
Expand Down

0 comments on commit 812b9ab

Please sign in to comment.