`-fdirectives-only` (GCC) or `frewrite-includes` (Clang) to the compiler,
diagnostics warnings and similar will be correct.
+- An implicit `-MQ` is now passed to the preprocessor only if the object file
+ extension is non-standard. This should make it easier to use EDG-based
+ compilers (e.g. GHS) which don't understand `-MQ`.
+
Bug fixes
~~~~~~~~~
output_dep = make_relative_path(x_strdup(default_depfile_name));
}
- if (!dependency_target_specified) {
+ if (!dependency_target_specified
+ && !str_eq(get_extension(output_dep), ".o")) {
args_add(dep_args, "-MQ");
args_add(dep_args, output_obj);
}
TEST "Calculation of dependency file names"
mkdir test.dir
- for ext in .obj "" . .foo.bar; do
+ for ext in .o .obj "" . .foo.bar; do
dep_file=test.dir/`echo test$ext | sed 's/\.[^.]*\$//'`.d
+
$CCACHE_COMPILE -MD -c test.c -o test.dir/test$ext
rm -f $dep_file
$CCACHE_COMPILE -MD -c test.c -o test.dir/test$ext
if ! grep "test$ext:" $dep_file >/dev/null 2>&1; then
test_failed "$dep_file does not contain test$ext"
fi
+
+ dep_target=foo.bar
+ $CCACHE_COMPILE -MD -MQ $dep_target -c test.c -o test.dir/test$ext
+ rm -f $dep_target
+ $CCACHE_COMPILE -MD -MQ $dep_target -c test.c -o test.dir/test$ext
+ if [ ! -f $dep_file ]; then
+ test_failed "$dep_file missing"
+ fi
+ if ! grep $dep_target $dep_file >/dev/null 2>&1; then
+ test_failed "$dep_file does not contain $dep_target"
+ fi
done
- expect_stat 'files in cache' 12
+ expect_stat 'files in cache' 18
# -------------------------------------------------------------------------
TEST "-MMD for different source files"