reduce compilation cost for changing a bit in headers

Alireza Haghdoost
Thu Dec 1 18:44:00 GMT 2011

I am using simple Makefile without dep ... I am wondering if make
understand change in header files if I write dependency in Makefile ?

On Thu, Dec 1, 2011 at 12:40, Ian Lance Taylor <> wrote:
> Alireza Haghdoost <> writes:
>> When ever I change a .h file, I have to make clean and recompile whole
>> project. However only one object file need recompilation. Is there any
>> way to make this process more efficient ? I mean is there any way that
>> it find a change in a header file and only recompile it's depended
>> object files ?
> Use a Makefile and write proper dependencies?
> If you use automake it will handle the dependencies for you.
> Ian

More information about the Gcc-help mailing list