Sun Studio 12 Update 1: C++ User's Guide

A.2.146 -xMD

Generates makefile dependencies like -xM but includes compilation. -xMD generates an output file for the makefile-dependency information based on the input filename but with the addition of a .d suffix. If you specify -xMD and -xMF, the preprocessor appends all makefile dependency information to the file specified with -xMF.