javaweb-people
[Top][All Lists]
Advanced

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

[Javaweb-people] compilation again


From: Nic Ferrier
Subject: [Javaweb-people] compilation again
Date: 26 Jan 2003 23:32:15 +0000

I've spent some time thinking about how to move my automakejar
program to an automake build system.

The problem is that my automakejar program has the following
weaknesses:

- it is only for building a jarfile, eg: not a shared lib

- it is sed based: doesn't seem to be very portable to cygwin

- it rewrites the Makefile (again!): this gets confusing


The reason for automakejar was simple. Most of the time I build java
source code into one or a few jar files. The hassle of expressing that
with Make (I prefer not to use ANT) caused me to write automakejar
which was an automake like program which rewrote rules in a
Makefile.aj into proper Make targets. It meant that you could build
Makefiles for compiling java code to jar files very quickly.

For the reasons stated above I wanted to move the idea to
automake. Automake's support for pure Java has a big limitation: only
one destination directory can be used.

Instead of trying to work round automake's limitation, I've written
the attached script. This encapsulates the idea of a jarcompiler, a
java compiler which stores compiled classes in a jar file.

In addition to that idea there are a few other tricks that make it
work well with Make:

- it takes the source files on stdin, so you can do this:

jarfiletarget.jar: ${SOURCEFILES}
    echo $? | ./jarcompiler jarfiletarget.jar

- it takes most config info from environment variables


I figure I could add a new automake "type" to utilize this
script. Does anybody have a view?




Nic

Attachment: jarcompiler
Description: jar compiler script


reply via email to

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