  We study the conditions to have supersymmetric D-branes on general {\cal N}=1
backgrounds with Ramond-Ramond fluxes. These conditions can be written in terms
of the two pure spinors associated to the SU(3)\times SU(3) structure on
T_M\oplus T^\star_M, and can be split into two parts each involving a different
pure spinor. The first involves the integrable pure spinor and requires the
D-brane to wrap a generalised complex submanifold with respect to the
generalised complex structure associated to it. The second contains the
non-integrable pure spinor and is related to the stability of the brane. The
two conditions can be rephrased as a generalised calibration condition for the
brane. The results preserve the generalised mirror symmetry relating the type
IIA and IIB backgrounds considered, giving further evidence for this duality.
