Here is a nice illustration in context of using cc with macrodef.

http://ant.apache.org/manual/CoreTasks/macrodef.html


definition:
    <macrodef name="call-cc">
       <attribute name="target"/>
       <attribute name="link"/>
       <attribute name="target.dir"/>
       <element name="cc-elements"/>
       <sequential>
          <mkdir dir="${obj.dir}/@{target}"/>
          <mkdir dir="@{target.dir}"/>
             <cc link="@{link}" objdir="${obj.dir}/@{target}"
                 outfile="@{target.dir}/@{target}">
                <compiler refid="compiler.options"/>
                <cc-elements/>
             </cc>
          </sequential>
    </macrodef>


usage:

    <call-cc target="unittests" link="executable"
             target.dir="${build.bin.dir}">
       <cc-elements>
          <includepath location="${gen.dir}"/>
          <includepath location="test"/>
          <fileset dir="test/unittest" includes = "**/*.cpp"/>
          <fileset dir="${gen.dir}" includes = "*.cpp"/>
          <linker refid="linker-libs"/>
       </cc-elements>
    </call-cc>

gl, Jim Fuller

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to