I wouldn't use makefiles for that, nor raw commans typed into the command line. If you need a build that can be executed without a GUI (a useful thing to have, IMO), my preferred tool of choice is
Ant, which has a built-in "war" task you can use for this purpose.