ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Frank Jacobs <>
Subject Using apply to Link an Executable
Date Mon, 25 Nov 2002 18:39:19 GMT
I'm having some trouble automating the linking of .o files into an
executable. I would like Ant to link together my executable only if the
executable is not up-to-date. I'm trying to do it with apply and a mapper.
However, I think my understanding of mappers is a bit off.

I've tried two methods. The first will correctly link the application
together, but (as expected) does not take the up-to-date status of files
into account. In other words, the command will run everytime even if no
files have been touched.

	<target name="nativec">
	  <apply executable="gcj" parallel="true">
	   <arg line="--main=${executable}"/>
	   <arg line="-o ${executable}"/>
	   <fileset dir="." includes="**/*.o"/>
The next example does not work, but will take into account the up-to-date
status of files:

	<target name="nativec">
	  <apply executable="gcj" dest="." parallel="true">
	   <arg line="--main=${executable}"/>
	   <arg line="-o ${executable}"/>
	   <fileset dir="." includes="**/*.o"/>
	   <mapper type="merge" to="Main.exe"/>
Basically, I want to tell Ant: "If any .o files have changed, relink and
include all .o files (changed or unchanged); otherwise do nothing." Does
anyone have any ideas?



Do you Yahoo!?
Yahoo! Mail Plus  Powerful. Affordable. Sign up now.

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

View raw message