summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Belt <andrewpbelt@gmail.com>2024-05-02 07:58:02 -0400
committerAndrew Belt <andrewpbelt@gmail.com>2024-05-02 08:00:50 -0400
commit1fb9af25dc93d2ea7651c6f71f45653f452308f5 (patch)
tree772f34c6c2d1882294ffd19676110b77517bb4ed
parent7c0941777f6ea1889c6ba78c558cf7296cdf230b (diff)
Include CXXFLAGS in build command for target.
-rw-r--r--compile.mk5
-rw-r--r--dep.mk7
2 files changed, 5 insertions, 7 deletions
diff --git a/compile.mk b/compile.mk
index c26cd4f2..be6332c9 100644
--- a/compile.mk
+++ b/compile.mk
@@ -23,7 +23,6 @@ CXXFLAGS += -std=c++11
# Define compiler/linker target if cross-compiling
ifdef CROSS_COMPILE
FLAGS += --target=$(MACHINE)
- LDFLAGS += --target=$(MACHINE)
endif
# Architecture-independent flags
@@ -39,10 +38,8 @@ ifdef ARCH_LIN
endif
ifdef ARCH_MAC
CXXFLAGS += -stdlib=libc++
- LDFLAGS += -stdlib=libc++
MAC_SDK_FLAGS := -mmacosx-version-min=10.9
FLAGS += $(MAC_SDK_FLAGS)
- LDFLAGS += $(MAC_SDK_FLAGS)
endif
ifdef ARCH_WIN
FLAGS += -D_USE_MATH_DEFINES
@@ -69,7 +66,7 @@ DEPENDENCIES := $(patsubst %, build/%.d, $(SOURCES))
# Final targets
$(TARGET): $(OBJECTS)
- $(CXX) -o $@ $^ $(LDFLAGS)
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^
-include $(DEPENDENCIES)
diff --git a/dep.mk b/dep.mk
index 41fe5896..292b18a1 100644
--- a/dep.mk
+++ b/dep.mk
@@ -13,7 +13,6 @@ DEP_FLAGS += -fPIC
# Define compiler/linker target if cross-compiling
ifdef CROSS_COMPILE
DEP_FLAGS += --target=$(MACHINE)
- DEP_LDFLAGS += --target=$(MACHINE)
endif
ifdef ARCH_X64
@@ -25,12 +24,14 @@ endif
ifdef ARCH_MAC
DEP_MAC_SDK_FLAGS := -mmacosx-version-min=10.9
- DEP_FLAGS += $(DEP_MAC_SDK_FLAGS) -stdlib=libc++
- DEP_LDFLAGS += $(DEP_MAC_SDK_FLAGS) -stdlib=libc++
+ DEP_FLAGS += $(DEP_MAC_SDK_FLAGS)
+ DEP_CXXFLAGS += -stdlib=libc++
+ DEP_LDFLAGS += -stdlib=libc++
endif
DEP_CFLAGS += $(DEP_FLAGS)
DEP_CXXFLAGS += $(DEP_FLAGS)
+DEP_LDFLAGS += $(DEP_FLAGS)
# Commands
WGET := wget -c