Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help with compiling C++ code with ANT

Status
Not open for further replies.

frag

Programmer
Dec 7, 2000
321
GB
Hi everybody,

I am trying to compile an existing C++ project with the help of ANT. We are doing this with make right now and it works fine but we start to use Java for some smaller programs and I thought that it would be nice to have an ANT build.xml which can handle everything in the project.

The real problem is that I don't know where to start. :(

There are several makefiles in different folders and sub-folders which are all called via one single make. Possible targets for example are "make all", "make execs", "make config dep fast", "make clean".

I already searched the web for an example project where someone managed to compile both java and c++ within one tool but I did not find anything related to ANT.

What I found was the ant-contrib library and the cpptask.jar. But it seems that you can use this for compiling C++ code directly via ANT... I guess that is not exactly what I am looking for. I just need to be able to call the make within ANT and have a dependency on that process so that ANT will stop if the compilation of the C++ code failed.

I already managed to write a small build-file that is capable of: clean the build folder, compiling a HelloWorld.java, put it into the right directory and run the program. But I don't know where to start regarding the call of "make".

Can someone please give me a hand on this?

Cheers,
frag

real_firestorm@gmx.de
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top