Im currently learning how to code without an IDE and so Im learning how to write makefiles. Here is my current test-project:
\\__ /CoDstructor/
|\\__ Makef
Your $(OBJS): $(SOURCES)
rule is not what you think it is. As a result, you're building both main.o
and types.o
from the same main.cpp
file ($<
param in command line). Hence you have two identical files which are conflicting, while types.cpp
wasn't even built.
Correct rule would be $(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp