I had a similar problem at a job about 10 years ago. My boss wanted to get me fired, because I was being paid out of overhead. If I was gone, it would look like he was saving a ton of profit for the company (even though I did the work of about 3 people, and actually made the company money). He'd give me taskings, but leave out important details. When I finished the project, it wouldn't be acceptable for implementation because of those missing details, and I looked like an idiot. He was also constantly threatening to fire me, and would remind me that it would ruin my life (I was about 21 at the time, going to school full time, and already working full time in my field to get ahead. Losing that job would have meant financial ruin and a ruined career before i even graduated, or so I thought).
So I kept a notebook. Whenever he said, "Mel, do this." I would write down the time and exactly what he said. I saved all his emails. During meetings, I took copious notes on what he said, how I responded, who was there, etc. Any time my boss would assign me something, then get mad at me for not doing his work (happened often), or change the details, I would say "Oh my goodness. Well, according to my notes, you told me to do XYZ on Monday, 13 October at 2pm. Sally and Roger were there in the meeting. Did I misunderstand something again?" It also started a really good factual timeline for when I made an official complain to Human Resources (which was difficult because we WERE Human Resources).
Concurrently, start looking for another job. And after you've given your notice, when they ask you why you're leaving, don't hold back. And pray for them.