Dead Aim
(1975)

A woman, with an infant, is running off with her lover. The husband catches up to them in the desert. In the shoot out, all 3 adults die, leaving the orphan alone in the desert. The infant is found by a wandering grave digger, who names him Johnny. They follow the army, and have booming business after each battle. However, when the war ends business drops. Johnny, older now, rides ahead into towns, shooting random strangers. The grave digger follows to bury them.

Johnny spies on a prostitute, Maria, and becomes obsessed with her.  Maria and Poggin, her boyfriend rob a pay wagon. Poggin planned things badly. They end up stuck in the desert, with a chest full of gold and no way to open or transport it.  Fed up with Poggin, Maria runs off with Lucius, a black deserter from the army.  Lucius leaves Maria at her hideout, while he heads into town for supplies. Lucius is arrested by the sheriff. Johnny comes along. Johnny and the sheriff have an argument which ends with Johnny killing the sheriff. Johnny gives Lucius the keys to free himself. Meanwhile, Poggin finally gets the gold.

Johnny, Lucius and Poggin are all heading separately back to Maria. Each man is dreaming of a future life with her.  When they all get there, Poggin is enraged that Maria wants nothing to do with him.  Poggin shoots Maria. Johnny shoots Poggin. Poggin shoots Johnny. All 3 die, leaving Lucius with all the gold. (Lucius was the only decent character in the whole movie, and the only one who never killed anybody.)

Thanks Joseph C!