One solution that I can think of: just create them in place using a simple rule, and then do the “collection phase” by moving the “.o” files to one folder.
Create a collect_objs target that depends on your $ (OBJS), and then your main goal should depend on collect_objs.
You can bypass using the shell
dirs := $(shell find ./ -type d) collect_objs: $(dirs) for d in $+; do \ mv *.o YourDestDir/*.o done
Of course, this implies using the UnxUtils package (with "find" and "mv") or Cygwin, since you are on Windows.
Another option is to create targets for each of your .c / .cpp file explicitly using some kind of tool. Grab python, navigate to the source directories and write for each .c / .cpp file
obj/file_name.o: gcc -c path/fo/file_name.c -o obj/file_name.o
source share