ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <>
Subject RE: Not a FAQ? make-like build prerequisites
Date Mon, 12 Jul 2004 21:20:48 GMT
> -----Original Message-----
> From: Kendall Shaw []
> Dominique Devienne wrote:
> > Ant has a different philosophy that make, and it requires a bit of time
> to
> > 'get it' or do the mental shift compared to makefiles.
> >
> > That said, Peter Reilly developed in Ant-Contrib a task called
> <outofdate>
> > whose purpose is to emulate in Ant makefile-like dependencies between
> files.
>  From tests I did with uptodate, examples I've seen of outofdate and
> dependset so far, and from what I gather from reading their
> descriptions, they seem to be used to manually code the build
> prerequisite logic yourself.
> The point for me of having a build tool is to avoid having to do this
> manual coding, otherwise I might as well just write scripts, and it
> becomes a question of which is a more appropriate scripting language for
> this, ant or something else.
> Make exists, if what I've read is true, because people found it to be a
> hassle to reptitively write the same logic in shell scripts, so make was
> written, which takes a list of rules instead of a script which
> explicitely tests files.
> Of course, ant has other niceties, like filesets and extensibility. I'll
>   still have to weigh the difficulties and benefits.
> It might make more sense for me to use make or another tool, to handle
> the build rules, and call ant from the rules, where that is useful.

All Make-Ant mix I've seen are a mess. I think you're misunderstanding Ant.

 -- Makefile --		-- build.xml --
%.class:		<javac>
	javac ...

%.html: %.xml
	xsltproc ...	<style>


In those cases where there's no built-in task that handles automagically the
dependencies, <outofdate> allows you to do just that. Using a <fileset> for
source files and a <mapper> for the target files (inferring the target
file's name from the source), you pretty much fully emulate the
%.source functionality of a Makefile.

As Craeg wrote, you start up small, and thus build things up. For example,
you write your <outofdate> task, then maybe made a <macrodef> out of it, and
later move to writing a full blown custom task in Java. There are many
things that a custom task can check beside timestamp of files!

For example, the <cc> task automatically rebuild the C/C++ code when you
change the include path or the defines, but not when you change a comment or
the list of files to compile? Try that with a Makefile!

Make certainly is a very powerful application, but many Ant build writer
have a strong background in Makefile from past experiences, and as one of
them, I don't miss it much. Sure, I probably skimmed it's power, but I don't
regret switching to Ant. Everyone's different though...

Check out A-A-P, or CMake, or Jam (from Boost for example) for alternatives
to Makefiles from the non-Java camp. (there are others. A-A-P as a long list
of build tools). --DD

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message