From owner-freebsd-java Fri Jun 16 6:11:12 2000 Delivered-To: freebsd-java@freebsd.org Received: from c187104187.telekabel.chello.nl (c187104187.telekabel.chello.nl [212.187.104.187]) by hub.freebsd.org (Postfix) with SMTP id B86BA37BE66 for ; Fri, 16 Jun 2000 06:11:00 -0700 (PDT) (envelope-from ernst@c187104187.telekabel.chello.nl) Received: (qmail 39893 invoked by uid 1000); 16 Jun 2000 13:10:54 -0000 Date: Fri, 16 Jun 2000 15:10:54 +0200 From: Ernst de Haan To: Cliff Rowley Cc: freebsd-java@freebsd.org Subject: Re: Odd request Message-ID: <20000616151054.A39818@c187104187.telekabel.chello.nl> References: <394A24C8.24697B1B@olive.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2i In-Reply-To: <394A24C8.24697B1B@olive.co.uk>; from cliff@olive.co.uk on Fri, Jun 16, 2000 at 01:59:52PM +0100 Sender: owner-freebsd-java@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Cliff, Try ant. It is easier than makefiles, and specifically designed for Java projects. It works as follows: Instead of a Makefile, you write an XML file that describes targets, you usually call this file build.xml. The targets typically similar to the following: For a complete example see: * Orion Primer http://www.orionserver.com/ Ant is an Apache project. * Ant Homepage http://jakarta.apache.org/ant/ Good luck, and let me know if you run into trouble. Note that you should use patchset 9 (not 8 or before) with Ant. And the Linux JDK is known to cause trouble with Ant at times (creating directories with special symbols in it). Ernst Cliff Rowley wrote: > Perhaps an odd request, but could someone help me with a Makefile for > compiling a java project? As it stands, I'm using a shell script to do > it for me, but it means we have to clean every time to ensure > dependencies are built. I'm not too hot with makefiles (yet), and this > one isn't that straight forward, since 2 of the classes auto generate > some of the other classes. > > I've attached the current script. > > Basically this is the chain of events that needs to happen: > > 1. The 2 code generation classes need to be compiled > (WopFileCreate.java and WopFileData.java). > > 2. 'java WopFileCreate > .p42i.properties' must be run to produce the > output files and the properties file. > > 3. The rest of the .java files need to be compiled. > > Seems quite simple I guess, but I cant get it going at all. > > Many thanks. > -- > Cliff Rowley > Software Engineer > Olive Systems LTD > http://www.olive.co.uk > #!/bin/sh > # > # Modified make utility > # > # Arguments: > # ./make [ clean then make everything ] > # ./make clean [ clean ] > # ./make runv [ run system against Vax ] > # ./make runt [ run system against transact ] > > if [ "x$1" = "xclean" ]; then > echo Cleaning... > rm *.class > rm WopCcpdoc.java WopCcpdocSql.java WopCcpdocVax.java WopEvrEvent.java WopEvrEventSql.java WopEvrEventVax.java WopMemdoc.java WopMemdocSql.java WopMemdocVax.java WopMemfmy.java WopMemfmySql.java WopMemfmyVax.java WopMemmst.java WopMemmstSql.java WopMemmstVax.java > elif [ "x$1" = "xrunv" ]; then > echo Running against Vax > java -Djava.compiler=none WopMain Vax > elif [ "x$1" = "xrunt" ]; then > echo Running against Transact > java -Djava.compiler=none WopMain Transact > elif [ "x$1" = "x" ]; then > echo Building... > START=`date` > > `$0 clean` > > echo Compiling exception classes... > javac *Exception*.java > > echo Compiling code generation classes... > javac WopFileCreate.java > javac WopFileData.java > > echo Auto generating classes... > java WopFileCreate > .p42i.properties > > echo Compiling auto generated classes... > javac *.java > > END=`date` > > echo > echo Build started $START > echo Build finished $END > echo > else > echo Invalid argument: $1 > exit 1; > fi To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-java" in the body of the message