You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Michael Wang (IT)" <MW...@bordersgroupinc.com> on 2005/02/17 20:51:21 UTC
Trick to Run Exec Task with Dir set
Hi,
I have the following ant script.
<target ...>
<foreach target="_call.batch.proc.make_" param="proc.file">
<param name="makefile.mk" value="mymakefile"/>
<path>
<fileset id="proc.retek.file" dir="${source.dir}">
<include name="*.pc"/>
</fileset>
</path>
</foreach>
</target>
<target name="_call.batch.proc.make_">
<basename property="module.name" file="${proc.file}" suffix=".pc"/>
<dirname property="directory.name" file="${proc.file}"/>
<exec executable="make" dir="${directory.name}" failonerror="true">
<arg value="-f ${makefile.mk} ${module.name}"/>
</exec>
</target>
I have to run "make" under ${directory.name} in order to get the code compiled.
for example, if I have the following files under ${directory.name}
a.pc
b.pc
c.pc
I have to cd to that directory, and run
make -f mymakefile a
make -f mymakefile b
make -f mymakefile c
Now, I keep getting error like "make: 1254-027 Cannot open mymakefile a.". I verified under ${directory_name}, the file mymakefile is there.
Any idea? Thanks.
Mike
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org