| Message |
OK, I see what is happening. As the documentation for ccache states, it keeps a hash of the source, and if the hash hasn't changed, uses the cached object. In particular, as they say, if you do:
make clean; make
... it will be faster.
However in a normal build environment you shouldn't have to do that. "make clean" discards all the object files forcing everything to be recompiled, which naturally takes longer. Your "touch mud.h" has the same effect.
Take a look at this thread:
http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=6069
That discusses how you can build in dependency checking, so it should be unnecessary to do "make clean" except in unusual circumstances.
In your current SMAUG FUSS makefile you have this line:
.c.o: mud.h
You probably should at least change it to:
.c.o: $(H_FILES)
That way, if you change another include file than mud.h (eg. imc.h) then the source will be rebuilt.
However a better method would be to use the dependency stuff mentioned above, that way each individual .c file has its own dependencies generated.
For example:
$ gcc -MM mccp.c
mccp.o: mccp.c mud.h color.h hotboot.h mccp.h
This shows the exact .h files that mccp.c is dependent on. Once that is done, then you should never need to do "make clean" and the speedup of caches will be irrelevant.
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|