For at least GNU make, I think you should be able to change this:



java ::
        @$(MKPATH) Java/classes
"$jdk/javac" -deprecation -g -d Java/classes Java/sources/org/perl/ inline/java/*.java "$jdk/jar" cf Java/InlineJavaServer.jar -C Java/classes org -C Java/ classes InlineJava.properties "$jdk/jar" cf Java/InlineJavaUser.jar -C Java/classes InlineJavaUserClassLink.class


to this:


java :: Java/InlineJavaServer.jar Java/InlineJavaUser.jar

CLASS_FILES=$(patsubst Java/sources/%,Java/classes/%,$(wildcard Java/ sources/org/perl/inline/java/*.java))

Java/InlineJavaServer.jar: $(CLASS_FILES)
"$jdk/jar" cf Java/InlineJavaServer.jar -C Java/classes org -C Java/ classes InlineJava.properties

Java/InlineJavaUser.jar: $(CLASS_FILES)
"$jdk/jar" cf Java/InlineJavaUser.jar -C Java/classes InlineJavaUserClassLink.class

Java/classes/%.class: Java/sources/%.java:
        @$(MKPATH) Java/classes
        "$jdk/javac" -deprecation -g -d Java/classes $<

pure_all :: java



The part that might not be cross-platform is $(patsubst ...) and $ (wildcard ...). I also haven't tried any of the above, I might have made some mistakes, but the basic idea should work.

 -Ken



On May 27, 2006, at 12:03 PM, Patrick LeBoutillier wrote:

Hi all,

When one builds Inline::Java, you need to do:

 make java

before doing:

 make
 make test
 make install

in order to build a .jar file that is needed to use Inline::Java.

Does anyone know how to write dependencies for Java source files that I could
use to have the default target build the .jar?

The reason I build the .jar in a separate target is because since I
don't know how to set the dependencies right the .jar file is rebuilt
every time, which is very annoying at development time.

Any help with this would be appreciated as it prevents Inline::Java
from being installed automatically by, say, CPAN.pm.


Thanks,

Patrick

--
=====================
Patrick LeBoutillier
Laval, Québec, Canada

Reply via email to