Skip to content

Commit

Permalink
add "make debug" target
Browse files Browse the repository at this point in the history
  • Loading branch information
coryb committed Aug 21, 2016
1 parent 062209b commit f450ed6
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,21 @@ GOBIN ?= $(CWD)

CURVER ?= $(patsubst v%,%,$(shell [ -d .git ] && git describe --abbrev=0 --tags || grep ^\#\# CHANGELOG.md | awk '{print $$2; exit}'))
LDFLAGS:=-X jira.VERSION=$(CURVER) -w
GOBUILD=go build -v -ldflags "$(LDFLAGS) -s"

# use make DEBUG=1 and you can get a debuggable golang binary
# see https://github.com/mailgun/godebug
ifneq ($(DEBUG),)
GOBUILD=go get -v github.com/mailgun/godebug && ./bin/godebug build
else
GOBUILD=go build -v -ldflags "$(LDFLAGS) -s"
endif

build:
$(GOBUILD) -o '$(BIN)' $(NAME).go

debug:
$(MAKE) DEBUG=1

vet:
@go tool vet *.go

Expand Down

0 comments on commit f450ed6

Please sign in to comment.