  By means of particle-in-cell numerical simulations, we investigate the
emission of high-energy photons in laser-plasma interactions under
ultrahigh-intensity conditions relevant to multi-petawatt laser systems. We
first examine the characteristics of synchrotron radiation from laser-driven
plasmas of varying density and size. In particular, we show and explain the
dependence of the angular distribution of the radiated photons on the
transparency or opacity of the plasma. We then study the competition of the
synchrotron and Bremsstrahlung emissions in copper foil targets irradiated by
$10^{22}\,\rm W\,cm^{-2}$, $50 \, \rm fs$ laser pulses. Synchrotron emission is
observed to be maximized for target thicknesses of a few $10 \, \rm nm$, close
to the relativistic transparency threshold, and to be superseded by
Bremsstrahlung in targets a few $\mu$m thick. At their best efficiency, both
mechanisms are found to radiate about one percent of the laser energy into
photons with energies above $10\,\rm keV$. Their energy and angular spectra are
thoroughly analyzed in light of the ultrafast target dynamics.
