Here's the reason. BTW, I can get around in Makefiles, but I'm not an expert, and my terminology may be slightly off, but I think you'll get the idea.
Your $(target) depends on $(objects). So, in order to start building $(target), all of the .o files need to be generated before line 24 is executed.
Since you did not define a rule to convert *.cpp to *.o, make will use a default rule which knows nothing about your $(includes) variable. So, the -I directives you think you are passing are really not being passed in.
You need a rule template (I forget what they are officially called in make) to generate your object files. It should be something like this:
1 2
|
%.o : %.cpp
$(cxx) $(includes) $(flags) -o $@ $<
| |
$@ is the left-hand side of the rule, $< is the first string in the right-hand side of the rule.
You will need a separate rule for .cpp files found int D:/Libraries/imgui. Or, better yet, build them into a library where they are and link the library.
Next, change your $(target) rule to simply link the objects into an executable:
1 2
|
$(target) : $(objects)
$(cxx) -o $@ $^ $(libs)
| |
$^ is all strings on the right-hand side of the rule