OP-TEE/optee_os — pull request #19 by jforissier (2014-08-19 08:53:17+00:00)
Title: mk/compile.mk: simplify dependency generation; better support ccache

This commit modifies the compilation flags that are used to generate
dependency files (*.o.d). Rather than using the preprocessor's -MD flag
(-Wp,-MD,), we now use the frontend's equivalent (-MD -MF
-MT ).

There are three reasons for doing so:
1. The GCC man page recommends against using -Wp, because "the
preprocessor's direct interface is undocumented and subject to change".
2. The new flags generate the correct rule directly, including the
subdirectory in front of the object name, so scripts/fixdep is not needed
anymore.
3. ccache (3.1.9) would not handle -Wp,-MD as expected. It would preserve
the directory prefix, so that we would end up with an invalid path after
the fixdep phase, making the rules useless. With this patch, OP-TEE builds
fine with ccache:
make -j3 CROSS_COMPILE="ccache arm-linux-gnueabihf-"