If I were conscripted by the state to kill Amalekite children, I would kill my commanders, and I would have moral justification for doing so.
The Amalekites were not extirpated, though.
Although you are begging the question as to what you would do against an enemy that has slaughtered the children of your nation.