It sounds like you need to quit and get a different job.
Maybe you should do a different kind of work. Lots of people derive happiness, even joy, from their work (including software developers; Steve Gibson [1] is a good example of that).
If you need help finding that, I recommend the book What Color Is Your Parachute?