Merge pull request #2456 from ismaell/build-flags
Simplify build flags setup
This commit is contained in:
commit
a84b9f09d4
1 changed files with 7 additions and 10 deletions
17
Makefile
17
Makefile
|
|
@ -9,15 +9,12 @@ else
|
|||
BUILD_DATE ?= $(shell date "$(DATE_FMT)")
|
||||
endif
|
||||
|
||||
ifndef CGO_CPPFLAGS
|
||||
export CGO_CPPFLAGS := $(CPPFLAGS)
|
||||
endif
|
||||
ifndef CGO_CFLAGS
|
||||
export CGO_CFLAGS := $(CFLAGS)
|
||||
endif
|
||||
ifndef CGO_LDFLAGS
|
||||
export CGO_LDFLAGS := $(LDFLAGS)
|
||||
endif
|
||||
CGO_CPPFLAGS ?= ${CPPFLAGS}
|
||||
export CGO_CPPFLAGS
|
||||
CGO_CFLAGS ?= ${CFLAGS}
|
||||
export CGO_CFLAGS
|
||||
CGO_LDFLAGS ?= ${LDFLAGS}
|
||||
export CGO_LDFLAGS
|
||||
|
||||
GO_LDFLAGS := -X github.com/cli/cli/internal/build.Version=$(GH_VERSION) $(GO_LDFLAGS)
|
||||
GO_LDFLAGS := -X github.com/cli/cli/internal/build.Date=$(BUILD_DATE) $(GO_LDFLAGS)
|
||||
|
|
@ -27,7 +24,7 @@ ifdef GH_OAUTH_CLIENT_SECRET
|
|||
endif
|
||||
|
||||
bin/gh: $(BUILD_FILES)
|
||||
@go build -trimpath -ldflags "$(GO_LDFLAGS)" -o "$@" ./cmd/gh
|
||||
go build -trimpath -ldflags "${GO_LDFLAGS}" -o "$@" ./cmd/gh
|
||||
|
||||
clean:
|
||||
rm -rf ./bin ./share
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue