This guy is a psychopath, and that's my unprofessional diagnosis as an internet love troll. I'd start looking for another job. Meanwhile, try your best to only engage him via e-mail, and keep a record of those e-mails in the event that you need them.
I know that sometimes men act like jerks to women they like. Little boys do this, pulling the pigtails of a little girl they have a secret crush on. Men don't always know how to communicate their feelings, or are frustrated by their own lack of courage. I know that personally, I have acted like I don't care around a person I care about deeply. Those insecure, lonelyhearts known as Pick-up Artists are trained to use something they call a "neg." A "neg" is a casual insult that is meant to lower a woman's self-esteem enough that she's vulnerable and less capable of rejecting a romantic advance. The idea is this: you walk up to some chick at a bar and say "Nice nails. Are they real?" She's caught off guard, she becomes defensive, the dude owns the conversation and the door is open to more drinks, bad conversation, and 30 seconds of sex. These are tricks employed by terrible, shallow human beings and they usually work pretty well on other terrible, shallow human beings.
But whatever. Men sometimes treat women like dirt to get their attention. Women sometimes respond positively to being treated negatively.
Back to your boss: this isn't a dude trying to sweat you. This is your boss. He has power over you and he's abusing it. Oh, he likes you? OMG, maybe he like-likes you! Who gives a shit. This sociopath is a lawsuit waiting to happen. His behavior is inappropriate, unprofessional, and disgusting. Why is he cruel to you, while at the same time, telling people he likes you? Is it because he's a douchebag? Sociopaths never think they're doing wrong because they can't comprehend anyones feelings but their own. Your so-called friend should be ashamed for trying to defend him by offering up his insane excuse for verbally abusing you.
I mean, let's be honest: maybe you're incompetent. I don't know. You could be. You still don't deserve this treatment. That he "likes" you is irrelevant. The economy sucks, jobs are scarce, but this dude is only going to get worse. One last thing, too. Don't ever be anywhere with him alone. Ever. Cool?
You'd make a great dad, DeVore! Seriously!