ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Wang \(IT\)" <MW...@bordersgroupinc.com>
Subject Trick to Run Exec Task with Dir set
Date Thu, 17 Feb 2005 19:51:21 GMT
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


Mime
View raw message