make: Fix 'build' and 'install' targets

Fixes #273
This commit is contained in:
Derek Parker
2015-10-09 21:39:17 -07:00
parent 5e31400a87
commit b4fd5718d4

View File

@ -13,7 +13,8 @@ ALL_PACKAGES=$(shell go list ./... | grep -v /vendor/)
# unable to execute.
# See https://github.com/golang/go/issues/11887#issuecomment-126117692.
ifeq "$(UNAME)" "Darwin"
FLAGS=-ldflags="-s" -exec=$(shell pwd)/scripts/testsign
BUILD_FLAGS=-ldflags="-s"
TEST_FLAGS=-exec=$(shell pwd)/scripts/testsign
DARWIN="true"
endif
@ -28,13 +29,13 @@ endif
endif
build: check-cert
go build $(FLAGS) github.com/derekparker/delve/cmd/dlv
go build $(BUILD_FLAGS) github.com/derekparker/delve/cmd/dlv
ifdef DARWIN
codesign -s $(CERT) ./dlv
endif
install: check-cert
go install $(FLAGS) github.com/derekparker/delve/cmd/dlv
go install $(BUILD_FLAGS) github.com/derekparker/delve/cmd/dlv
ifdef DARWIN
codesign -s $(CERT) $(GOPATH)/bin/dlv
endif
@ -44,14 +45,14 @@ ifeq "$(TRAVIS)" "true"
ifdef DARWIN
sudo -E go test -v $(ALL_PACKAGES)
else
go test $(FLAGS) $(ALL_PACKAGES)
go test $(TEST_FLAGS) $(BUILD_FLAGS) $(ALL_PACKAGES)
endif
else
go test $(FLAGS) $(ALL_PACKAGES)
go test $(TEST_FLAGS) $(BUILD_FLAGS) $(ALL_PACKAGES)
endif
test-proc-run:
go test $(FLAGS) $(PREFIX)/proc -run $(RUN)
go test $(TEST_FLAGS) $(BUILD_FLAGS) $(PREFIX)/proc -run $(RUN)
test-integration-run:
go test $(FLAGS) $(PREFIX)/service/test -run $(RUN)
go test $(TEST_FLAGS) $(BUILD_FLAGS) $(PREFIX)/service/test -run $(RUN)