We find by applying MacMahons partition analysis that all magic labellings of the cube are of eight types, each generated by six basis elements. A combinatorial proof of this fact is given. The number of magic labellings of the cube is thus reobtained as a polynomial in the magic sum of degree $5$. Then we enumerate magic distinct labellings, the number of which turns out to be a quasi-polynomial of period 720720. We also find the group of symmetry can be used to significantly simplify the computation.