What is the meaning of "Vayachalosh Yehoshua ... "?
1.
Rashi and Targum Yonasan: It means that Yehoshua severed the heads of Amalek's strong men, keeping alive only the weak ones. He did not kill them all, due to the Divine command.
1
2.
Rashbam: It means that he completely vanquished Amalek.
2
Lev Eliyahu (p.97): This is because Hashem makes a nation fall only after its Sar (angel) falls, and the Sar of Esav will not fall as long as the Yeitzer ha'Ra is among us.
To whom is ythe Pasuk referring when it writes "Amalek"?
1.
Oznahyim la'Torah: Either Amalek the son of Elifaz the son of Eisav was still alive
1
in the time of Moshe, or all the kings of Amalek were called 'Amalek'.
2
See Ba'al ha'Turim, who maintains that Amalek informed Lavan that Ya'akov had fled and Par'oh that Yisrael had fled. See also Oznayim la'Torah, DH "Es Amalek ve'es Amo" #2