help-make
[Top][All Lists]
Advanced

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

Re: have a problem mixing Make and java.


From: Jason Lunz
Subject: Re: have a problem mixing Make and java.
Date: Fri, 24 Feb 2006 04:04:47 +0000 (UTC)
User-agent: slrn/0.9.8.1pl1 (Debian)

address@hidden said:
> Secondly your $(classes) : $(subst...) rule is wrong.  This says that 
> each individual class file depends on every single source file.  I think 
> what you mean to say is each class file depends on the corresponding 
> source file.

That doesn't work for java. javac puts static final constants in every
.class file that uses them, not just in the one that defines them. So
things can go subtly wrong if you use a traditional 1:1 mapping makefile
for java.

It would be nice if javac could output dependency info like many C
compilers do. I know sun's javac doesn't.  There's a tool called
javamake that's supposed to calculate dependency info
(http://www.experimentalstuff.com/Technologies/JavaMake/) but a project
I work on had to abandon it because it was unreliable. 

In the end, the only safe thing to do is call javac once with *all*
.java files, and let it figure things out.

You don't really end up saving much time anyway by invoking it
separately on each .java file.  sun's javac, at least, seems to be
implemented in java itself, so it's got a hefty startup time. 

Jason





reply via email to

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