From 367086056dc556111e5fc6d008a60cd10795be99 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Wed, 21 Mar 2018 07:47:50 -0400 Subject: [PATCH] Fix Makefile variable name collision --- compile.mk | 6 +++--- dep.mk | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/compile.mk b/compile.mk index 57533f01..2891b7b1 100644 --- a/compile.mk +++ b/compile.mk @@ -43,8 +43,8 @@ CXXFLAGS += $(FLAGS) # Derive object files from sources and place them before user-defined objects -OBJECTS := $(patsubst %, build/%.o, $(SOURCES)) $(OBJECTS) -DEPS := $(patsubst %, build/%.d, $(SOURCES)) +OBJECTS += $(patsubst %, build/%.o, $(SOURCES)) +DEPENDENCIES := $(patsubst %, build/%.d, $(SOURCES)) # Final targets @@ -52,7 +52,7 @@ DEPS := $(patsubst %, build/%.d, $(SOURCES)) $(TARGET): $(RESOURCES) $(OBJECTS) $(CXX) -o $@ $(OBJECTS) $(LDFLAGS) --include $(DEPS) +-include $(DEPENDENCIES) build/%.c.o: %.c @mkdir -p $(@D) diff --git a/dep.mk b/dep.mk index 9a5e1d0a..8c462830 100644 --- a/dep.mk +++ b/dep.mk @@ -22,7 +22,6 @@ else CMAKE := cmake -DCMAKE_INSTALL_PREFIX="$(realpath $(DEP_LOCAL))" endif - # Export environment for all dependency targets $(DEPS): export CFLAGS = $(DEP_CFLAGS) $(DEPS): export CXXFLAGS = $(DEP_CXXFLAGS)