In this work, the classical Prandtl relation for the skin-friction law of incompressible turbulent channel and pipe flows is generalised to compressible cases. Specifically, based on the law of the wall and asymptotic analysis, a skin-friction transformation is proposed to map the skin-friction law of compressible turbulent channel and pipe flows to the classical Prandtl relation. It has been theoretically proven that the skin-friction coefficient
$C_{\!f,i}$ and the bulk Reynolds number
$\textit{Re}_{b,i}$ for compressible turbulent channel and pipe flows, where the subscript
$i$ denotes the transformed quantity obtained from the proposed skin-friction transformation, adhere to the Prandtl relation, expressed as
$\sqrt {2/C_{\!f,i}}\propto \ln (\textit{Re}_{b,i}\sqrt {C_{\!f,i}/2})$. Moreover, it is quantitatively verified that the transformed
$C_{\!f,i}$ and
$\textit{Re}_{b,i}$, obtained from direct numerical simulations (DNS) of compressible turbulent channel flows with bulk Mach numbers ranging from
$0.2$ to
$4$, and friction Reynolds numbers from
$200$ to
$2000$, elegantly collapse into the Prandtl relation for the incompressible skin-friction law. Additionally, the transformed
$C_{\!f,i}$ and
$\textit{Re}_{b,i}$ from DNS of compressible turbulent pipe flows, with bulk Mach numbers ranging from
$1.5$ to
$3$, and friction Reynolds numbers from
$200$ to
$1000$, are also unified with the Prandtl relation for the incompressible skin-friction law.