[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Java class files, again

From: Eric Siegerman
Subject: Re: Java class files, again
Date: Fri, 31 Jan 2003 23:19:29 -0500
User-agent: Mutt/1.2.5i

On Sat, Feb 01, 2003 at 02:59:00AM +0100, Simon Richter wrote:
> for a project of mine I need support for java .class files, and as I'd
> like to do this the right way I've thought I might as well try to hack
> automake's Java support.


> foo_jar_JAVA =

Don't forget that JARs can contain other things than .class
files; it'd be nice if there was an automakish way to say
"include these other files too".

>       cd .java/$* && $(GCJ) -C `evil VPATH script here`

Java requires a dependency model beyond what make can easily
  - a "makedepend" program for Java pretty much has to be a full
    parser, to notice that any reference to some class Foo makes
    This.class depend on .../com/blarfl/Foo.class.  There was
    such a program kicking around at one point, called javadeps
    (aka jdeps).  But even that's unpleasant in practice; Java's
    dependencies change a lot more frequently than do #include's
    in C, so you have to "make depend" far too often.

  - Java can easily have circular dependencies; they require all
    .java files in the circle to be compiled by the same compiler

  - with javac anyway, the startup overhead is so huge that it's
    way faster to compile everything in one compiler process
    even if there aren't any circular dependencies

Ant's pretty painful, for those who "think" in make -- XML
*shudder* -- but it understands Java better than I believe make
(and thus automake) ever will.  So one possibility might be to
pull the code for the <javac> task out of ant, and turn it into a
standalone Java-compiler driver; then call it from a Makefile, as
the gods and Stuart Feldman intended :-) A few other ant tasks,
like <jar>, might benefit from similar treatment.

Best of luck!


|  | /\
|-_|/  >   Eric Siegerman, Toronto, Ont.        address@hidden
|  |  /
A distributed system is one on which I cannot get any work done,
because a machine I have never heard of has crashed.
        - Leslie Lamport

reply via email to

[Prev in Thread] Current Thread [Next in Thread]