summaryrefslogtreecommitdiff
path: root/make
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2018-02-24 11:48:02 +0000
committerPeter Powell <petpow@saberuk.com>2018-02-24 11:48:02 +0000
commit7e5e4a5ae2321b1db3fbcf252dc8c71c4316e9a3 (patch)
treed4f354bf719f425d28496effa4289406f39da01c /make
parent0858015761ffdffdc93f90da27c2b4ced19f074a (diff)
Append LDFLAGS at the same time as CPPFLAGS and CXXFLAGS.
This deduplicates the addition of these flags.
Diffstat (limited to 'make')
-rw-r--r--make/template/main.mk14
1 files changed, 8 insertions, 6 deletions
diff --git a/make/template/main.mk b/make/template/main.mk
index 077084280..346989086 100644
--- a/make/template/main.mk
+++ b/make/template/main.mk
@@ -36,8 +36,8 @@ BUILDPATH ?= $(PWD)/build
SOCKETENGINE = @SOCKETENGINE@
CORECXXFLAGS = -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -pipe -Iinclude -Wall -Wextra -Wfatal-errors -Wno-unused-parameter -Wshadow
LDLIBS = -lstdc++
-CORELDFLAGS = -rdynamic -L. $(LDFLAGS)
-PICLDFLAGS = -fPIC -shared -rdynamic $(LDFLAGS)
+CORELDFLAGS = -rdynamic -L.
+PICLDFLAGS = -fPIC -shared -rdynamic
BASE = "$(DESTDIR)@BASE_DIR@"
CONPATH = "$(DESTDIR)@CONFIG_DIR@"
MANPATH = "$(DESTDIR)@MANUAL_DIR@"
@@ -78,8 +78,8 @@ ifeq ($(SYSTEM), solaris)
endif
ifeq ($(SYSTEM), darwin)
LDLIBS += -ldl
- CORELDFLAGS = -dynamic -bind_at_load -L. $(LDFLAGS)
- PICLDFLAGS = -fPIC -shared -twolevel_namespace -undefined dynamic_lookup $(LDFLAGS)
+ CORELDFLAGS = -dynamic -bind_at_load -L.
+ PICLDFLAGS = -fPIC -shared -twolevel_namespace -undefined dynamic_lookup
endif
ifndef INSPIRCD_DEBUG
@@ -119,9 +119,11 @@ ifdef INSPIRCD_STATIC
CORECXXFLAGS += -DINSPIRCD_STATIC
endif
-# Add the users CPPFLAGS/CXXFLAGS to the base ones to allow them to
-# override things like -Wfatal-errors if they wish to.
+# Append any flags set in the environment after the base flags so
+# that they can be overridden if necessary.
CORECXXFLAGS += $(CPPFLAGS) $(CXXFLAGS)
+CORELDFLAGS += $(LDFLAGS)
+PICLDFLAGS += $(LDFLAGS)
export BUILDPATH
export CORECXXFLAGS