Bernd Kreimeier <[EMAIL PROTECTED]> writes:
> It seems that javac recurses through all dependencies
> for a given app.java, and creates *.class as needed.
> However, it does not seem to check whether the *.java
> file is more recent?
Yep, javac (with or without -depend) isn't perfect.
>
> If that's the case (might be worth submitting a
> JDC Bug Parade Entry), is there any way to tweak
> GNU make to handle this? You obviously can't use
> gcc/CPP, and I would like to avoid manually listing
> dependencies that might change. There is also the
> issue of the wildcard based "import overkill" that
> creates dependencies that are not real.
>
> For larger projects, javac execution time might be
> an issue. I am using a Makefile as simple as I
> haven't seen it in years (just a few implicit
> rules), but w/o said check for modified sources,
> it won't do.
>
> Any suggestions? Am I missing a JDK tool?
>
Some people have written tools for generating dependencies, but most
of them generate dependencies on class files, e.g. A.java as to be
recompiled if B.class has changed. But what I really want are
dependencies on source files (java depends on B.java).
Currently I'm playing with javac's secret -xdepend option:
110> javac -xdepend GraphTest.java
CLASS:/home/kreilede/test/GraphTest.java,4,173,GraphTest
CLDEP:GraphTest,java.lang.Object
CLDEP:GraphTest,GraphTest. GraphListener
CLDEP:GraphTest,java.io.PrintStream
CLDEP:GraphTest,java.lang.System
CLDEP:GraphTest,GraphModel
CLDEP:GraphTest,JGraph
CLASS:/home/kreilede/test/GraphTest.java,81,172,GraphTest. GraphListener
CLDEP:GraphTest. GraphListener,java.lang.Object
CLDEP:GraphTest. GraphListener,java.io.PrintStream
CLDEP:GraphTest. GraphListener,java.lang.System
CLDEP:GraphTest. GraphListener,GraphModelEvent
CLDEP:GraphTest. GraphListener,GraphTest
After removing the dependencies on java.* (and on other foreign
packages) it should be no big deal to generate a dependency file.
Bye,
Jürgen.
--
Juergen Kreileder, Universitaet Dortmund, Lehrstuhl Informatik V
Baroper Strasse 301, D-44221 Dortmund, Germany
Phone: ++49 231/755-5806, Fax: ++49 231/755-5802