From 8a11fb9f9a06c69bdcfc04c04a7c90aa6ecf8b13 Mon Sep 17 00:00:00 2001 From: Przemyslaw Pawelczyk Date: Sat, 6 Jan 2018 01:33:13 +0100 Subject: Makefile: Treat LDFLAGS as passed to the compiler, not linker directly. --- Makefile | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index edb1dc6..dfbacac 100644 --- a/Makefile +++ b/Makefile @@ -159,9 +159,6 @@ endif CC_PARAMS = $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) CXX_PARAMS = $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -### Helpers -comma := , - ### Final flags ifneq ($(origin CFLAGS),environment) CFLAGS = $(OPTIONAL_FLAGS) @@ -173,13 +170,6 @@ override CFLAGS += $(MUSTHAVE_FLAGS) $(MUSTHAVE_CFLAGS) \ $(if $(INCS_DIR),-I$(INCS_DIR),) -I$(SRCS_DIR) override CXXFLAGS += $(MUSTHAVE_FLAGS) $(MUSTHAVE_CXXFLAGS) \ $(if $(INCS_DIR),-I$(INCS_DIR),) -I$(SRCS_DIR) -override LDFLAGS := $(subst -Wl$(comma),,$(LDFLAGS)) -ifneq ($(origin CCLDFLAGS),environment) -CCLDFLAGS := $(addprefix -Wl$(comma),$(LDFLAGS)) -endif -ifneq ($(origin CXXLDFLAGS),environment) -CXXLDFLAGS := $(addprefix -Wl$(comma),$(LDFLAGS)) -endif vpath %.h $(SRCS_DIR) $(INCS_DIR) vpath %.c $(SRCS_DIR) @@ -212,7 +202,7 @@ ifeq ($$($(1)_COMP),CC) else @echo " CXXLD $$@" endif - $$(HIDE)$$($$($(1)_COMP)LD) $$($$($(1)_COMP)LDFLAGS) $$(TARGET_ARCH) \ + $$(HIDE)$$($$($(1)_COMP)LD) $$(LDFLAGS) $$(TARGET_ARCH) \ -o $$@ $$(filter %.o,$$^) \ -Wl,-Bstatic $$($(1)_SLIBS) -Wl,-Bdynamic $$($(1)_DLIBS) @@ -256,7 +246,7 @@ ifeq ($$($(1)_COMP),CC) else @echo " CXXLD $$@" endif - $$(HIDE)$$($$($(1)_COMP)LD) $$($$($(1)_COMP)LDFLAGS) $$(TARGET_ARCH) \ + $$(HIDE)$$($$($(1)_COMP)LD) $$(LDFLAGS) $$(TARGET_ARCH) \ -shared -Wl,-soname,$$($(1)_SONAME) \ -o $$@ $$(filter %.o,$$^) \ -Wl,-Bstatic $$($(1)_SLIBS) -Wl,-Bdynamic $$($(1)_DLIBS) -- cgit v1.2.1