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: Alessandro Vesely
Subject: Re: have a problem mixing Make and java.
Date: Sat, 25 Feb 2006 20:21:40 +0100
User-agent: Mozilla Thunderbird 1.0.6 (Windows/20050716)

Jason Lunz wrote:

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.

Jikes does it. It does it better with suitable patches, e.g. (old)
http://sourceforge.net/tracker/index.php?func=detail&aid=1228066&group_id=128803&atid=712762

Gcj also outputs dependencies, but its semantic is complicated by
the fact that it can both compile to native-code .o files and to
byte-code .class files.


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

That's true, but slightly draconian. Savvy developers divide their
code into packages. Since package dependencies are there by design,
it is not too hard to maintain them by hands in a makefile.

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.

In addition, you get separate funny-named class files for each tiny
subclass that you code, thus modifying an existing source file may
change the number of .class files in output.

And never forget .class files play both roles that .h and .o do in C.

BTW, Sun's javac is compiled using GNU make.




reply via email to

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