cp-tools-discuss
[Top][All Lists]
Advanced

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

[Cp-tools-discuss] Re: Automakejar - make install


From: Julian Scheid
Subject: [Cp-tools-discuss] Re: Automakejar - make install
Date: Fri, 07 Mar 2003 13:08:47 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.2) Gecko/20021126



Nic Ferrier wrote:
What I want to be able to do is say to automake "here is an object
file target called fred.jar and here is the source for fred.jar and
here is how it translates from one to the other".

fred_JARSOURCES = Smith/Fred.java Smith/Bob.java Smith/Andy.java

These sources need to be piped to the jarcompiler, along with the
jarfile name. I've thought about hacking automake but it's a bit much
for me at the moment.

Here is how I do Jar file assembly for LibxmlJ. If you substitute the
call to JAR by your "echo $? ..." line you should be there.

I agree that this is not very automatic, more like a conventional
Makefile, but I haven't found any other way to compile Java classes
and create a jar file with automake.

Julian


--- SNIP ---

JARFILE = libxmlj.jar
data_DATA = ${JARFILE}

BUILT_SOURCES = ${JARFILE}

# Assemble Libxmlj Jar file

${JARFILE}: \
                gnu/xml/libxmlj/transform/TransformerFactoryImpl.class \
                gnu/xml/libxmlj/transform/TransformerImpl.class \
                gnu/xml/libxmlj/transform/DefaultErrorListenerImpl.class \
                gnu/xml/libxmlj/transform/DefaultURIResolverImpl.class \
                gnu/xml/libxmlj/transform/JavaContext.class \
                gnu/xml/libxmlj/transform/IOToolkit.class \
                gnu/xml/libxmlj/transform/SourceLocatorImpl.class \
                gnu/xml/libxmlj/transform/TemplatesImpl.class \
                gnu/xml/libxmlj/transform/SourceWrapper.class \
                gnu/xml/libxmlj/transform/LibxsltStylesheet.class
        @JAR@ cf ${JARFILE} $^

# Remove classes and jar file

clean-local:
        rm -rf gnu
        rm -f ${JARFILE}

# Rule for compiling Java source files

gnu/%.class: @srcdir@/src/gnu/%.java
        @JAVAC@ @JAVACFLAGS@ \
                -d . \
                -classpath "${CLASSPATH}:@srcdir@/src:." \
                @srcdir@/src/gnu/xml/libxmlj/transform/*.java





reply via email to

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