top | item 33729031

(no title)

oau123 | 3 years ago

Also known as Makefile :P

discuss

order

jonstewart|3 years ago

Tell me you’re not a C/C++ developer without telling me you’re not a C/C++ developer.

bastih|3 years ago

Gotta be one hell of a makefile.

gladiatr72|3 years ago

GNU Autotools: A beutiful thing

GNU Autotools: A hideous thing

:D

Jorengarenar|3 years ago

What? Makefile doesn't cache anything

FrostKiwi|3 years ago

The commenter was referring to having compilation and linking in separate stages, as is standard in Makefiles to enable Multi-Threaded compilation. As in

  cc -c main.c -o main.o
  cc -c init.c -o init.o
  cc init.o main.o -o final_binary
In that specific setup, ccache does indeed not provide a speedup, since those .o file are kept. The Makefile simply checks if the source file has a younger modification date than the object file and recompiles only if it's older. In that sense the Makefile does in fact cache the results. Once we go beyond single-user and onward to bigger projects, ccache starts making sense.

jason0597|3 years ago

make recompiles source code files by detecting the last modified date on a file, hence it only recompiles source files as necessary. So if you have 10 source files with 5000 lines of C in them, and you only change one of them, it will not recompile everything, it will only recompile that source file which has changed.

Which makes me agree with the parent above, I don't see how exactly Ccache is supposed to be used. Maybe for a distributed source directory with many developers working on it?