I have a folder structure in my src
folder, which I want to preserve in my obj
folder, where all the .o
files go. I don not want to use mkdir
, since many problems arise with cross-platform use. Instead I did
$(OBJECTS) := $(patsubst %,obj/%,$(subst /,_,$(SOURCES)))
The problem now is, that the input and output file names of the rule that creates those files are different, which means doing
$(OBJECTS): obj/%.o: %.cpp
# whatever compile command
no longer works, because for an example output of obj/Core_Graphics_Window.o
the input is Core/Graphics/Window.cpp
.
Can this still be done?