[H-GEN] gnu make command-line target ordering problems?

Martin Pool martinp at mincom.com
Mon Oct 18 03:18:22 EDT 1999


[ Humbug *General* list - semi-serious discussions about Humbug and
Unix-related topics. ]

Byron Ellacott wrote:
> > I guess the lesson from our home-grown system is that some tools (eg
> > javac) are wierd enough that it's easier to write your own scripts than
> > to try to bend make to them.
> 
> I don't know what javac does, but most compilers take source[s] and
> produce object[s], be they bytecode or machine code, or object code, or
> source in a new language.  And you can hence specify dependencies, and
> hence have make take care of them ..

javac (and clones, like Jikes) have the following differences to cc that
a make system has to worry about:

 * One source file may produce several classfiles (though their names
will usually have the same prefix as the source file, e.g.
MinecommsAdapter.java --> MinecommsAdapter.class,
MinecommsAdapter$1.class, MinecommsAdapter$EventListener.class.)

 * The compiler reads classfiles to learn about depended-upon classes,
rather than using header files.  It's hard to work out what these other
classes are without implementing a significant fraction of a compiler
(can't just grep for ^#include), so it's hard to get the dependency
rules into a makefile.

 * The compiler does its own dependency analysis: if a classfile that it
needs to read is out-of-date wrt its source it will be read and compiled
as well.  Make doesn't expect commands to take the initiative like this.

 * Starting up the compiler and loading all the classfiles is
time-consuming so we'd prefer to invoke the compiler with lots of source
files on each run.  Some of these files may fail to compile, but some of
the others may work.

 * Classfiles are stored in a directory tree: only an annoyance, but
harder to write implicit rules.

People have certainly tried, but it's never worked terribly well IMHO.

On the whole I guess it's a decent language for doing big systems.

-- 
 /\\\  Mincom | Martin Pool          | martinp at mincom.com
// \\\        | Software Engineer    | Phone: +61 7 3303-3333
\\ ///        | Mincom Ltd.          | 
 \///         | Teneriffe, Brisbane  | Speaking for myself only

--
This is list (humbug) general handled by majordomo at lists.humbug.org.au .
Postings only from subscribed addresses of lists general or general-post.



More information about the General mailing list