Given an integer $qge 2$ and a real number $cin [0,1)$, consider the generalized Thue-Morse sequence $(t_n^{(q;c)})_{nge 0}$ defined by $t_n^{(q;c)} = e^{2pi i c S_q(n)}$, where $S_q(n)$ is the sum of digits of the $q$-expansion of $n$. We prove that the $L^infty$-norm of the trigonometric polynomials $sigma_{N}^{(q;c)} (x) := sum_{n=0}^{N-1} t_n^{(q;c)} e^{2pi i n x}$, behaves like $N^{gamma(q;c)}$, where $gamma(q;c)$ is equal to the dynamical maximal value of $log_q left|frac{sin qpi (x+c)}{sin pi (x+c)}right|$ relative to the dynamics $x mapsto qx mod 1$ and that the maximum value is attained by a $q$-Sturmian measure. Numerical values of $gamma(q;c)$ can be computed.