gandalfcode / gandalf

GANDALF (Graphical Astrophysics code for N-body Dynamics And Lagrangian Fluids)
GNU General Public License v2.0
44 stars 12 forks source link

Added dependency resolution to make files. #29

Closed rbooth200 closed 8 years ago

rbooth200 commented 8 years ago

Add header dependency resolution by generating extra rules using gcc's header resolution options.

giovanni-rosotti commented 8 years ago

Ok, works for me on the mac too. Two last points before merging (I'm being very picky just because the makefile is such an important part of the interface with the user): The dependency files contain also system header files - is that we want? I suppose it shouldn't be a problem, just make will take a bit longer because it needs to check also those timestamps (hardly a problem). I wonder if we should use the CPP variable rather than g++ (but checking if g++ is part of the name) in case the user does not have a command called g++. Or maybe we should just add a warning in this case informing the user that we were not able to compute the dependencies.

rbooth200 commented 8 years ago

In which case, replace -M with -MM

On 02/11/15 13:01, giovanni-rosotti wrote:

Ok, works for me on the mac too. Two last points before merging (I'm being very picky just because the makefile is such an important part of the interface with the user): The dependency files contain also system header files - is that we want? I suppose it shouldn't be a problem, just make will take a bit longer because it needs to check also those timestamps (hardly a problem). I wonder if we should use the CPP variable rather than g++ (but checking if g++ is part of the name) in case the user does not have a command called g++. Or maybe we should just add a warning in this case informing the user that we were not able to compute the dependencies.

— Reply to this email directly or view it on GitHub https://github.com/gandalfcode/gandalf/pull/29#issuecomment-153010379.

rbooth200 commented 8 years ago

It only reports files included using "" and not <>

On 02/11/15 13:01, giovanni-rosotti wrote:

Ok, works for me on the mac too. Two last points before merging (I'm being very picky just because the makefile is such an important part of the interface with the user): The dependency files contain also system header files - is that we want? I suppose it shouldn't be a problem, just make will take a bit longer because it needs to check also those timestamps (hardly a problem). I wonder if we should use the CPP variable rather than g++ (but checking if g++ is part of the name) in case the user does not have a command called g++. Or maybe we should just add a warning in this case informing the user that we were not able to compute the dependencies.

— Reply to this email directly or view it on GitHub https://github.com/gandalfcode/gandalf/pull/29#issuecomment-153010379.