• Create Account

### #ActualMaeriden

Posted 01 February 2013 - 04:48 PM

Mmm it's not very different from mine. To get around the issue of directories the target objects are written directly with obj/ prepended.
I wanted to avoid this solution because I didn't understand how to make make (no pun) work out the headers dependencies with a rule like $(OBJECTS): obj/%.o : src/%.cpp and thus decided to write a rule for each .o to avoid recompiling the whole project. Doing so meant that I had to manually write the directory variable in each rule, which seemed kind of dumb. From the informations I was able to gather (I couldn't find an example that explained problems with GPATH) it looks like the solutions are: writing the path manually for each rule, using the general rule and have all the sources recompiled every time an header changes, or learning to use .d files (which will wait since I got fed up with make for a while). Or use a different make system. Thank you all for your advice, I really apreciate it ### #2Maeriden Posted 01 February 2013 - 04:48 PM Mmm it's not very different from mine. To get around the issue of directories the target objects are written directly with obj/ prepended. I wanted to avoid this solution because I didn't understand how to make make (no pun) work out the headers dependencies with a rule like$(OBJECTS): obj/%.o : src/%.cpp and thus decided to write a rule for each .o to avoid recompiling the whole project. Doing so meant that I had to manually write the directory variable in each rule, which seemed kind of dumb.

From the informations I was able to gather (I couldn't find an example that explained problems with GPATH) it looks like the solutions are: writing the path manually for each rule, using the general rule and have all the sources recompiled every time an header changes, or learning to use .d files (which will wait since I got fed up with make for a while).
Or use a different make system.

### #1Maeriden

Posted 01 February 2013 - 04:16 PM

Mmm it's not very different from mine. To get around the issue of directories the target objects are written directly with obj/ prepended.

I wanted to avoid this solution because I didn't understand how to make make (no pun) work out the headers dependencies with a rule like \$(OBJECTS): obj/%.o : src/%.cpp and thus decided to write a rule for each .o to avoid recompiling the whole project. Doing so meant that I had to manually write the directory variable in each rule, which seemed kind of dumb.

From the informations I was able to gather (I couldn't  find an example that used GPATH) it looks like the solutions are: writing the path manually for each rule, using the general rule and have the whole executable recompiled every time an header changes, or learning to use .d files (which will wait since I got fed up with make for a while).

Or use a different make system.