Skip to content

Commit

Permalink
Merge pull request openshift#70 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 authored Oct 16, 2018
2 parents 17df0c7 + 09b438f commit 2e21063
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.

DBG ?= 0

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

VERSION ?= $(shell git describe --always --abbrev=7)
MUTABLE_TAG ?= latest
IMAGE = origin-libvirt-machine-controllers
Expand Down Expand Up @@ -64,12 +70,12 @@ bin:
@mkdir $@

.PHONY: build
build: | bin ## build binary
$(DOCKER_CMD) go install -ldflags '-extldflags "-static"' sigs.k8s.io/cluster-api-provider-aws/cmd/cluster-controller
$(DOCKER_CMD) go install -ldflags '-extldflags "-static"' sigs.k8s.io/cluster-api-provider-aws/cmd/machine-controller
build: ## build binary
$(DOCKER_CMD) go install $(GOGCFLAGS) -ldflags '-extldflags "-static"' sigs.k8s.io/cluster-api-provider-aws/cmd/cluster-controller
$(DOCKER_CMD) go install $(GOGCFLAGS) -ldflags '-extldflags "-static"' sigs.k8s.io/cluster-api-provider-aws/cmd/machine-controller

aws-actuator:
$(DOCKER_CMD) go build -o bin/aws-actuator sigs.k8s.io/cluster-api-provider-aws/cmd/aws-actuator
$(DOCKER_CMD) go build $(GOGCFLAGS) -o bin/aws-actuator sigs.k8s.io/cluster-api-provider-aws/cmd/aws-actuator

.PHONY: images
images: ## Create images
Expand Down

0 comments on commit 2e21063

Please sign in to comment.