diff --git a/compile.mk b/compile.mk index 57533f01..d3e38566 100644 --- a/compile.mk +++ b/compile.mk @@ -43,14 +43,14 @@ CXXFLAGS += $(FLAGS) # Derive object files from sources and place them before user-defined objects -OBJECTS := $(patsubst %, build/%.o, $(SOURCES)) $(OBJECTS) +SOURCE_OBJECTS := $(patsubst %, build/%.o, $(SOURCES)) DEPS := $(patsubst %, build/%.d, $(SOURCES)) # Final targets -$(TARGET): $(RESOURCES) $(OBJECTS) - $(CXX) -o $@ $(OBJECTS) $(LDFLAGS) +$(TARGET): $(RESOURCES) $(OBJECTS) $(SOURCE_OBJECTS) + $(CXX) -o $@ $(SOURCE_OBJECTS) $(OBJECTS) $(LDFLAGS) -include $(DEPS)