xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Duncan Davidson <james.david...@eng.sun.com>
Subject Re: Makefile's
Date Thu, 25 Nov 1999 19:40:42 GMT
Dirk-Willem van Gulik wrote:
> I am looking at various makefile options, gmake vs make vs Ant. Is there
> a good reason why a lot of OS java author's seem prefer
> 
>         1.      to simply compile everything in one javac statement
>                 which has been CD's to the right output
>                 directory. Regardless of wether all java files need
>                 to be recompiled.

actually, no CD required, just javac -d [dest]

>         3.      defined dependencies and do it file by file
>                 instead of all, and only when needed
> 
> Is there a good reason ? Are dependencies too hard ? Or do (some)
> compiler's work this out themselfes well enough ?

Compilers can work this stuff out for themselves. I've found the only
check that saves any amount of time is just to compare a source file
time against a class file time and if it's out of date, put it on the
update list. This works even in multiple classes being compiled out of
the same .java file.

And, as has been raised, calling javac many times (or even jikes) in a
row is ***Slow***. Letting the compiler have everything at once is a
huge save no matter if you are using Sun's compiler or Jikes or
whatever.

> And secondly, why is there such a strong desire to move the *.class
> file's far away from the source ?

Usually because 1) you don't want to have all those .java files sitting
around on your classpath, 2) you typically jar the classpath up and you
don't want the .java files going along for the ride, and 3) CVS doesn't
see all those files when doing an update -- keeps the messages down. :)

Why keep them together?

-- 
James Davidson                                     duncan@eng.sun.com 
Java + XML / Portable Code + Portable Data                 !try; do()

Mime
View raw message