[Top][All Lists]

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

Java class files, again

From: Simon Richter
Subject: Java class files, again
Date: Sat, 1 Feb 2003 02:59:00 +0100
User-agent: Mutt/1.5.3i


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.

What do you think about something like this:

----- -----
data_JARS = foo.jar

foo_jar_JAVA =
data_JAVA =

should create foo.jar (containing Foo.class) and Bar.class and put them
in $datadir. This is IMO compatible with current behaviour.
This should lead to

----- -----
        $(RM) $@
        mkdir -p .java/$*.java
        cd .java/$* && $(GCJ) -C `evil VPATH script here`
        $(JV_SCAN) --list-class `evil VPATH script here` >$@

foo.jar: Foo.jstamp
        mkdir -p .java/$@
        cd .java && for i in `$^`; do \
                srcdir=`echo $i | sed -e 's/jstamp$/java'` \
                for j in `cat $i`; do \
                        package=`echo $j | sed -e 'address@hidden@/@g' -e 
                        srcfile=`echo $j | sed -e 's/.*\.//g'`.class \
                        mkdir -p $@/$package
                        cp $srcdir/$srcfile $@/$package \
                done \
        cd .java/$@ && $(JAR) -cf ../../$@ *

Alternatively, if we're using Sun javac instead of gcj, the first rule
should look like

        $(RM) $@
        mkdir -p .java/$*.java
        $(JAVAC) -d .java/$*.java `evil VPATH script here`
        cd .java/$*.java && find . -type f -name \*.class | sed -e 
's@/@address@hidden' -e 's/^\.*//' >$@

This is just a idea how things could work. Of course, the "evil VPATH
script" needs to be included, a few GNUism removed from the
($* being the most prominent), install and clean rules written etc.

Questions, comments? Should I make things work like this and submit a


GPG Fingerprint: 040E B5F7 84F1 4FBC CEAD  ADC6 18A0 CC8D 5706 A4B4

Attachment: pgpMIByhkwURx.pgp
Description: PGP signature

reply via email to

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