Makefile: tidy remaining LDFLAGS refs

This commit is contained in:
Paul Stemmet 2022-12-09 19:22:19 +00:00
parent c9d4347ff7
commit ea811c98eb
Signed by: Paul Stemmet
GPG Key ID: EDEA539F594E7E75
1 changed files with 8 additions and 8 deletions

View File

@ -10,7 +10,7 @@ GOARCH ?= $(shell go env GOARCH)
SRC := $(shell find . -iname "*.go" -not -iname '*_test.go') SRC := $(shell find . -iname "*.go" -not -iname '*_test.go')
TEST_SRC := $(shell find . -iname '*_test.go') TEST_SRC := $(shell find . -iname '*_test.go')
CONFIGURE := $(BUILD)/.B.configure CONFIGURE := $(BUILD)/.B.configure
LDFLAGS := $(BUILD)/.B.ldflags BUILDFLAGS := $(BUILD)/.B.buildflags
BUILDINFO := git.st8l.com/luxolus/kdnotify/buildinfo BUILDINFO := git.st8l.com/luxolus/kdnotify/buildinfo
Version ?= $(shell git describe --tags --abbrev=0) Version ?= $(shell git describe --tags --abbrev=0)
@ -85,11 +85,11 @@ $(BUILD)/$(PROJ): $(CONFIGURE) $(SRC)
-buildmode=pie \ -buildmode=pie \
-ldflags "-linkmode=external -extldflags=$$LDFLAGS $$BUILDFLAGS" -ldflags "-linkmode=external -extldflags=$$LDFLAGS $$BUILDFLAGS"
$(CONFIGURE): $(BUILD) $(LDFLAGS) $(CONFIGURE): $(BUILD) $(BUILDFLAGS)
@cat $@ >$@ @cat $@ >$@
@echo "BUILDFLAGS='$$(xargs <$(LDFLAGS))'" >>$@ @echo "BUILDFLAGS='$$(xargs <$(BUILDFLAGS))'" >>$@
$(LDFLAGS): $(BUILD) $(BUILDFLAGS): $(BUILD)
@cat $@ >$@ @cat $@ >$@
@echo '-X $(BUILDINFO).Version=$(Version)' >>$@ @echo '-X $(BUILDINFO).Version=$(Version)' >>$@
@echo '-X $(BUILDINFO).CommitHash=$(Commit)' >>$@ @echo '-X $(BUILDINFO).CommitHash=$(Commit)' >>$@