Alternative to the IDE

Ok, due my troubles with the arduino java IDE, I would like to use my own development chain.

Are there some pointer explaining how I can compile the code from a comand line tool, to upload the code to the board, and to monitor the serial line?

Thanks,

There's a Makefile in hardware/cores/arduino that you can use, although it might be a bit out of date.

Thanks, I'll have a look at it.

The Makefile does not seem to work; it does not compile libraries...

How does java compile the sources? Does it use a Makefile? Where are arduino IDE sources?

Thanks.