sasquatch said:
I've recently started developing JAVA apps for some of my courses,
but I work on both Windows and Unix. Can somebody point me in the
direction of any good tutorials on what exactly makefiles are and
how to do them?
Makefiles are text files that the input files for a tool called make.
Actually, there are many, many versions of make out there, a lot of
them slightly incompatible when it comes to enhancements.
The original make was written by a guy called Stuard I. Feldman. He
wrote the Bell Labs Unix FORTRAN stuff and needed a build utility:
make. The name comes from the development cycle he used to build his
programs: think - edit - make - test.
A makefile consists of rules, and describes how to transform one type
of a file (e.g. a source code file) to another type (e.g. an object
module). If one (the source file) is newer than the other (the object
code) a script is triggers (e.g. running the compiler), to generate the
one from the other.
Many people have bashed heavily. IMHO this is uncalled. Make does
exactly what it is supposed to do, and a few things more. However, it
is not a general purpose scripting utility. Make has a certain rough
charme, but does not show its beauty to everyone.
Classic make and a lot of the modern enhanced version have a problem
with Java. It is easy and common to have circular references between
source files in Java. Classic make does not allow one to specify
circular references. Using such a make, you have to degrade your build
rules to "always compile everything" which results in loosing all
advantages of make. Fortunately Sun has published a version of make
that can handle this:
http://developers.sun.com/dev/coolstuff/javamake/
If you use make, you migth want to get this one. Be careful, there are
several make versions out there which are called "javamake". Get the
one from Sun.
People will suggest an alternative for make when compiling Java. This
thing is called ant. I don't like it too much. The idea of a special
purpose scripting language based on XML doesn't appeal to me. You will
find that ant fans are very religious about the tool.