It is not possible to specify the same pattern matching rule twice with different actions. How is make supposed to known which one to use? All that is happening is that the second .c.o rule overrides the first, leading to the first having no effect.
If you want a specific rule for compiling main.c, then specify it fully without using patterns which will conflict with other rules. Changing the main.c compile rule to this:
I tried this and while it did succeed in creating main.c.o without errors, it just immediately stopped after doing so. None of the other compiling rules followed.
I only changed that one line, so I’m not sure what the reason for that is…
Presumably you have a target which contains all the object you are tryibg to compile and then links them into an application or library? Or is what you posted the entire makefile?
but it appears to go to the else case no matter what - even on main.c. I’ve checked the makefile documentation, but this - and all other forms of it (such as ifeq(,), ifeq"" “”, etc) - have the same effect of not working. Now I’m really confused…