ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rosendahl Sten - stro <s...@im.se>
Subject RE: Using ANT with 'C' projects - need help
Date Sat, 21 Jun 2003 12:27:07 GMT
You can also you NAnt (.NET Ant) to compile C/C++/VB code with the
VisualStudio compilers. But I don't think you can use a cross-compiler (like
gnu) with NAnt, you'd need ant-contrib for that task (what? there is no
"nant-contrib"???).

Sten

> -----Original Message-----
> From: peter reilly [mailto:peter.reilly@corvil.com]
> Sent: Friday, June 20, 2003 6:25 PM
> To: Ant Users List
> Subject: Re: Using ANT with 'C' projects - need help
> 
> 
> you can use the <cc/> task from the
> ant-contrib cpptasks project.
> 
> http://ant-contrib.sourceforge.net/cc.html
> 
> It is still a little rough on the edges
> but it is quite powerful
> 
>   - automatic dependencies
>   - recursive source files
> 
>     <target name="probe-compile"  depends="init">
>         <mkdir dir="${build.lib.dir}"/>
>         <mkdir dir="${obj.dir}/probe"/>
>         <cc link="static" objdir="${obj.dir}/probe"
>             outfile="${build.lib.dir}/probe.a"
>             warnings="none"
>             multithreaded="true"
>             >
>             <compiler refid="compiler.options"/>
>             <fileset dir="${src.dir}/common" includes="**/*.cpp" />
>             <fileset dir="${src.dir}/qos" includes="**/*.cpp"
>                      excludes="**/main/**"/>
>             <linker name="ar"/>
>         </cc>
>     </target>
> 
> Peter.
> 
> On Fri, 2003-06-20 at 17:14, Phillip Lord wrote:
> > >>>>> "Jeff" == Faist, Jeff <Jeff.Faist@encodasystems.com>
writes:
> > 
> >   Jeff> I'm just learning ANT but have used make extensively in the
> >   Jeff> past.
> > 
> >   Jeff> ANT seems to be very Java specific as it does not 
> have default
> >   Jeff> build rules for C++ or VB like it does for java compiles.
> > 
> >   Jeff> So far it does not seem to be very hard to create a build
> >   Jeff> target with an EXEC command that calls the VC++ command line
> >   Jeff> with he proper params.  I'm still working on the nested
> >   Jeff> build/include concept to do the entire system and 
> how to deal
> >   Jeff> with my hidden dependencies and circular build issues.
> > 
> >   Jeff> So ya, it can do C++ builds, if it's better than 
> Make remains
> >   Jeff> to be seen.
> > 
> > My own feeling is that make is nicer for doing C/C++ 
> builds, while ant
> > is better for doing Java. 
> > 
> > The main advantages of using make with C/C++ is not make itself, but
> > the layer of stuff on top of make that exists, such as
> > autoconf/automake if you are developing for the unix, or similar
> > environments. 
> > 
> > For Java the advantages of ant are many...you don't have to
> > continually relaunch javac, you avoid the circular dependency issue
> > and so on. But none of these apply to ant with C. 
> > 
> > It would be nice if there were a universal build system, but there
> > isn't. make comes closer than ant, largely because of its maturity,
> > but from my perspective I use several build tools, I expect to be
> > doing so for the foreseeable future. 
> > 
> > Ho hum....
> > 
> > Phil

> 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message