Signing bonuses can get tricky also. For Example: Let's say Rookie Superstar Player, signs a 10 year contract, and gets a 10 million dollar signing bonus.
A. If he plays all 10 years of the contract, then the signing bonus is calculated at 1 million per year against the cap.
B. If he plays 8 years, then is cut (depending on when he is cut also), the first 8 years was figured at 1 million per year, but the 9th year (which he isn't playing), is figured at 2 million for that year.
C. This is the one that can kill clubs: If he just plays one season then is cut, the first season is figured at 1 million, then the second season gets a whopping 9 million cap hit - and he isn't even playing!!
There are other scenarios, where the signing bonus can get prorated, but I really don't have the time, nor the expertise to go into them into detail. Let's just say the signing bonus does go against the cap, and not usually as easy as saying the bonus was 10 million, and the cap hit is 10 million divided by the number of years of the contract.