It's a "chicken or the egg" question. Are boys attracted to guns, action figures, etc because of advertising, or do advertisers seek to sell boys guns, action figures etc because that's what they want?
I think the answer is far more boring than most pedants would like. It's both.
Biologically, men are born with hormones that give them aggressive traits, while women are born with hormones that give them nurturing traits. These are adaptive influences: male protector, female child-rearer; a partnership that works. Advertisers target their message to exploit these instincts.
None of the above implies that we cannot rise above our instinctual urges and make something different of our lives. It also does not imply that any of this is black & white. Some men are born passive and some women are born aggressive. Some women have no desire to have children. Some men prefer to stay at home and raise their children.
Humans are a complex and diverse bunch, but as with most systems, there is a distribution wherein lies a "typical" state of being. When there's money to be made, you don't make it by ignoring the facts, so advertisers target the "typical" boy and girl, and make a boat load of money doing it.