Add debug target to Makefile

The default target gets a `-gcflags=""` arg added, but that should be
neutral.
This commit is contained in:
Paul Hinze 2022-03-15 17:17:24 -05:00
parent c26d627e5a
commit 80ba98cefb
No known key found for this signature in database
GPG Key ID: B69DEDF2D55501C0

View File

@ -12,7 +12,11 @@ CGO_ENABLED?=0
.PHONY: bin
bin: # bin creates the binaries for Vagrant for the current platform
@test -s "thirdparty/proto/api-common-protos/.git" || { echo "git submodules not initialized, run 'git submodule update --init --recursive' and try again"; exit 1; }
CGO_ENABLED=$(CGO_ENABLED) go build -ldflags $(GOLDFLAGS) -tags assetsembedded -o ./vagrant ./cmd/vagrant
CGO_ENABLED=$(CGO_ENABLED) go build -ldflags $(GOLDFLAGS) -gcflags="$(GCFLAGS)" -tags assetsembedded -o ./vagrant ./cmd/vagrant
.PHONY: debug
debug: # debug creates an executable with optimizations off, suitable for debugger attachment
GCFLAGS="all=-N -l" $(MAKE) bin
.PHONY: bin/windows
bin/windows: # create windows binaries