diff --git a/Makefile b/Makefile index 6ba1f2d..f9dd5b0 100644 --- a/Makefile +++ b/Makefile @@ -7,11 +7,11 @@ GO ?= $(shell command -v go) GOOS ?= $(shell go env GOOS) GOARCH ?= $(shell go env GOARCH) -SRC := $(shell find . -iname "*.go" -not -iname '*_test.go') -TEST_SRC := $(shell find . -iname '*_test.go') -CONFIGURE := $(BUILD)/.B.configure -LDFLAGS := $(BUILD)/.B.ldflags -BUILDINFO := git.st8l.com/luxolus/kdnotify/buildinfo +SRC := $(shell find . -iname "*.go" -not -iname '*_test.go') +TEST_SRC := $(shell find . -iname '*_test.go') +CONFIGURE := $(BUILD)/.B.configure +BUILDFLAGS := $(BUILD)/.B.buildflags +BUILDINFO := git.st8l.com/luxolus/kdnotify/buildinfo Version ?= $(shell git describe --tags --abbrev=0) Commit ?= $(shell git rev-parse HEAD) @@ -85,11 +85,11 @@ $(BUILD)/$(PROJ): $(CONFIGURE) $(SRC) -buildmode=pie \ -ldflags "-linkmode=external -extldflags=$$LDFLAGS $$BUILDFLAGS" -$(CONFIGURE): $(BUILD) $(LDFLAGS) +$(CONFIGURE): $(BUILD) $(BUILDFLAGS) @cat $@ >$@ - @echo "BUILDFLAGS='$$(xargs <$(LDFLAGS))'" >>$@ + @echo "BUILDFLAGS='$$(xargs <$(BUILDFLAGS))'" >>$@ -$(LDFLAGS): $(BUILD) +$(BUILDFLAGS): $(BUILD) @cat $@ >$@ @echo '-X $(BUILDINFO).Version=$(Version)' >>$@ @echo '-X $(BUILDINFO).CommitHash=$(Commit)' >>$@