Let $c \in \{0,1\}^n$ denote a binary string, $sgn(c): = (-1)^{\text{#ones in the string}}$ and $s(c) := \sum_{k=1}^{n} (-1)^{c_k}k$.
Now, observe that $$P = \prod_{m=1}^{n}{\sin{mx}} = \frac{1}{2^ni^n}\underbrace{\prod_{m=1}^n {e^{ixm}-e^{-ixm}}}_{A}$$
Let $C$ be the set of all $c$, such that $c_n = 0$. Then by choosing the first term of the factor if $c_m = 0$ or the second if $c_m=1$ we can write $P$ as the sum:
$$
A = \begin{cases}
\sum_{c\in C} sgn(c) (e^{ixs(c)}+e^{-ixs(c)}) &\text{ if $n$ is even} \\
\sum_{c\in C} sgn(c) (e^{ixs(c)}-e^{-ixs(c)}) &\text{ if $n$ is odd}
\end{cases}
$$
This simplifies to
$$
A = \begin{cases}
2 \sum_{c\in C} sgn(c) \cdot \cos(s(c)x) &\text{ if $n$ is even} \\
2i \sum_{c\in C} sgn(c) \cdot \sin(s(c)x) &\text{ if $n$ is odd}
\end{cases}
$$
Substituting $A$ into $P$ gives
$$
P = \begin{cases}
\frac{(-1)^k}{2^{n-1}} \sum_{c\in C} sgn(c) \cdot \cos(s(c)x) &\text{ if $n = 2k$} \\
\frac{(-1)^k}{2^{n-1}} \sum_{c\in C} sgn(c) \cdot \sin(s(c)x) &\text{ if $n = 2k+1$}
\end{cases}
$$
Integrating this expresion, given extra care when s(c) = 0 (if $n$ is even then then the term integrates to $sgn(c) x$, if $n$ is odd the term vanishes)
$$\boxed{
\int \prod_{m=1}^{n}{\sin{mx}} \cdot dx = \begin{cases}
\frac{(-1)^k}{2^{n-1}} \sum_{c\in C} a(c) &\text{if $n = 2k$} \\
\frac{(-1)^{k+1}}{2^{n-1}} \sum_{c\in C} b(c) &\text{if $n = 2k+1$} \\
\end{cases}}
$$
where
$$
\boxed{a(c) = \begin{cases}
\frac {sgn(c)}{s(c)} \cdot \sin(s(c)x) &\text{if $s(c) \neq 0$} \\
sgn(c) \cdot x &\text{if $s(c) = 0$} \\
\end{cases} \\
b(c) = \begin{cases}
\frac {sgn(c)}{s(c)} \cdot \cos(s(c)x) &\text{if $s(c) \neq 0$} \\
0 &\text{if $s(c) = 0$} \\
\end{cases}}
$$
For example when $n=4$ the binary strings $c$ are
\begin{array}{|c|c|}
\hline
c & 0000 & 0001 & 0010 & 0011 & 0100 & 0101 & 0110 & 0111 \\ \hline
sgn(c) & 1 & -1 & -1 & 1 & -1 & 1 & 1 & -1 \\ \hline
s(c) & 10 & 8 & 6 & 4 & 4 & 2 & 0 & -2 \\ \hline
\end{array}
and $k$=2 so the integral is equal to
$$
\frac{1}{8} \left(1/10 \sin(10x) - 1/8 \sin(8x) - 1/6 \sin(6x) +\\
1/4 \sin(4x) - 1/4 \sin(4x) + 1/2 \sin(2x) +\\ x + 1/2 \sin(-2x)\right) = \\\boxed{\frac{1}{8} \left(1/10 \sin(10x) - 1/8 \sin(8x) - 1/6 \sin(6x) + x\right)}
$$