NEARLY 29 years ago, Donald Trump was flattered when he made his first appearance in “Doonesbury.”

For more than 28 years now, the presumptive GOP presidential nominee hasn’t felt so complimented.

Garry Trudeau, creator of the Pulitzer-winning comic strip, has been satirizing the real-estate mogul since 1987, when the world of “Doonesbury” first envisioned Trump as a presidential contender. The Donald since then has often come under the cartoon microscope, skewered over his treatment of wives and other women, employees and other underlings — and, in general, most anyone (everyone?) he deemed beneath him.

“He’s always been impossible to ignore,” Trudeau tells The Post’s Comic Riffs. “It’s like having a big, clanking cowbell installed in your head. I’ve just written four Sundays in a row about Trump, which is insane.”

Reflecting those decades of big, clanking Trump cartoons, Trudeau’s new book, “Yuge! 30 Years of Doonesbury on Trump” (Andrews McMeel) arrives today. Ahead of the book’s release, Comic Riffs caught up with Trudeau to talk all things Donald:

MICHAEL CAVNA: Do you recall when Trump first really came on to your radar, and whether the urge to satirize him emerged immediately or gradually?

GARRY TRUDEAU: Hard to say. It’s like the onset of flu — at what point do you realize you have it? Sometime in the mid-’80s, probably after Trump’s starter project — the Grand Hyatt — typesetters citywide started putting his name in boldface. By the time he started taking out full-page ads in 1987, he’d been on enough magazine covers to justify introducing him to a larger national audience. Trump initially said he was flattered [by his appearance in “Doonesbury”]. That changed.

MC: What was it about Trump’s actions or antics in 1987 that compelled you to spoof him as an imagined candidate? … Looking back at those “Doonesbury” strips, he seems like almost irresistible fodder in your eyes.

GT: By 1987, he’d already made himself a risible figure in New York. But he was completely harmless, fodder for Spy magazine. The ads were the first “uh-oh” moment and my response was a kind of reflexive, prophylactic slap-down. The grandiosity was so over the top that it would have been comedy malpractice to ignore it. Of course, now we know he was playing the long game. I’m sorry I missed that.

MC: In the introduction of “Yuge!,” you show a news clipping of Trump responding to you and “Doonesbury.” What was your reaction at the time — was it a form of affirmation that you knew you’d hit your satiric mark?

GT: Of course. The cover blurbs on my books are all uniformly negative. You know that a comic strip has bite if someone says ouch. But that’s only a small part of what I do, and I don’t pick targets for the blowback. Doonesbury is primarily a character-driven strip, but because of some high-profile controversies through the years, it’s often misunderstood as a political project.

MC: You call Trump an “a–hole.” Are a–holes any easier to satirize — kind of like how good actors are drawn to playing villains? 

GT: Absolutely. “A–hole” has a very particular meaning, one that is universally understood. The a–hole is a demeaning, abrasive bully who takes all the credit and assigns all the blame to others. In my lifetime, we’ve had several presidents who’ve disappointed us; we’ve had a crook, a warmonger, some philanderers, but we’ve never actually had a president who’s a total a–hole. This is where I fundamentally got it wrong; I assumed that the body politic would reject such a toxic personality. It’s also why I thought Chris Christie would fail to get traction. Now we face the distinct possibility of having not just one, but two a–holes on the same ticket. That’s how I much I know about politics.

MC: Looking back over the past three decades, you seemed to grasp the unchanged essence of Trump so quickly. Why was that? Was it because he registered as [cartoon] stereotype — a greedy scion in Boss Tweed clothing — or because so much coverage was devoted to him beginning in the ’80s that you had a wealth of all his very best words to mine? What was your secret, beyond your long-honed satirist’s gift?

GT: Well, thank you, but you’re right — early on, it was Trump’s insatiable appetite for attention that laid down the grooves, however unwelcome. He’s always been impossible to ignore. It’s like having a big, clanking cowbell installed in your head. I’ve just written four Sundays in a row about Trump, which is insane. I have dozens of other characters and story arcs to serve, with lots of other fish to fry. Of course, commentators of all stripes have had the same problem.

MC: When did you first get a sense that Trump could be a legitimate — or at least viable — candidate for president?

GT: Try last April. I’ve been no smarter than anyone else on this.

MC: Has anything about Trump’s rise as a candidate changed your sense of much of the electorate?

GT: Yes. I never imagined they could be so easily conned. Here’s what the people who love Trump don’t understand: He doesn’t love them back. I figured they’d be on to him by now. These are folks who feel anxious and left behind by the new economy. Many are struggling. Trump has a word for such people: losers. And he’s never had time for losers. He doesn’t have time to sit in their kitchens and go to their barbecues and listen to their problems. True, losers in the aggregate — say 12,000 at a time — get him to where he wants to be. But he’s always one squirt of Purell away from getting back on his plane so he can sleep in his penthouse. Never has an electorate been held in more contempt by its putative champion.

MC: What is your single favorite aspect about Trump for cartoon skewering?

GT: Probably his use of language. An analysis by USA Today concluded that he uses a fourth-grade vocabulary in his speeches, but that doesn’t mean he isn’t inventive. Who else uses phrases like “nasty with lies” or “win with the military” or “that I can tell you”? I don’t do much to tweak his speech mannerisms — I’m more of a stenographer — but there is some art to reconfiguring it for satiric purposes.

MC: Do you ever think he’s become impervious to satire?

GT: He didn’t used to be, but now he has every major media outlet in the world to preoccupy him. I would never make his tweet hit list today.

MC: Your “Trump” has gone through very distinct visual shifts over the decades — from a lean, dark figure to a slightly jowly character to, now, a full-on multi-colored comb-over topping a large, slightly hunched frame. Could you speak some to the evolution of Trump in “Doonesbury” and how consciously you have altered him in different decades?

GT: Drawing Trump is a journey, not a destination. I’ve been trying to reverse-engineer his hair ever since it was brown, well before he set it on fire to run for president. All cartoonists draw Trump differently because we each have a different understanding of how he achieves his effects, especially now that he’s of a certain age. He’s been melting for some time now, so we’re now down to hulking, gilded bloat and it ain’t pretty. But someone has to draw it.

MC: You seemed to foresee his move toward reality shows and his on-the-stump fixation with size and sexual prowess, among other aspects. Is there any seemingly prescient “Doonesbury” Trump storyline or arc or aspect that you’re particularly proud of — or surprised by [its eventual similarity to reality]?

GT: In working out Trump stories, I usually took my cue from whatever harebrained enterprise he was actually engaged in at the time, so I don’t want to be blamed for any of this. Since I do the strip every day, I occasionally get lucky with timing, but I can’t say in good faith I was trying to warn anybody. After the three head-fakes in 1987, 2000 and 2012, I figured he’d eventually run, especially after he got a taste of double-digit poll numbers with his birther campaign. But I also assumed he’d quickly drop out after he’d maximized the promotional value.

MC: Among the many political candidates you’ve covered and mocked over 46 years, where does Trump rank in that illustrious field? 

GT: I can’t really compare Trump to other political figures, because they’re all relatively normal human beings. Trump, on the other hand, is an actual toon, and I’ve always treated him as such. He’s just another character in my strip, and the rest of the cast regard him as a peer. I didn’t have to change a thing.

MC: If Trump wins in November, are you moving to Canada — not so far from [your family roots of] Saranac Lake — or perhaps digging in to relish satirizing The Donald for at least four more years?

GT: Now that the primaries are over, the election has become very simple and binary. Stripping away the usual party labels and philosophies, as one must, it’s a stark choice between a sane person and a person with a severe personality disorder. If we chose the latter, it would be tempting to return to the land of my people — the French immigrants who snuck into Montreal — but I think I’ll stick it out, at least until the libel laws get “loosened up.”