1

Ok! I don't need people to ask why I'm using 3 different programming languages for a relatively simple task... (It's in the coursework specification)

My situation is, I have to write a program. This program is split into 3 parts. The parts of the program, won't need to directly interact with each other (I don't think). One part has to be in C one part in C++ and one in Java! A bit like a set of 3 tools packaged together.

I would like to avoid having to build each part separately and test each part separately and check for program requirements separately. So I need one tool like make, that can check for library requirements etc. for each language, build each part, perform test cases and all that jazz.

If it makes any difference, I am thinking of making a GUI for the Java part of the program. The other two parts of the program will only have a text interface.

  • 5
    Make is designed to perform arbitrary commands already. It's up to you to know what commands to perform in order to satisfy requirements, build, run tests, etc. – jonvuri Mar 11 '13 at 22:03
  • Use ant, this too build everything, write and extend it with tasks. – Roman C Mar 11 '13 at 22:08
  • Use make for C/C++, and ant or maven for Java, then have one of them kick the other when that bit needs building. – flup Mar 11 '13 at 22:10
  • You can wrap ant with make pretty easily by making the .class files the dependencies (and including them in the clean). Having them both able to call each other sounds like it could turn ugly. – jonvuri Mar 11 '13 at 22:12
  • @jrajav agreed, one of the both shall be the master that kicks the other. I phrased it like this cause I don't feel particularly strong about which of the both it should be. – flup Mar 11 '13 at 22:15
  • similar question: http://stackoverflow.com/questions/12017580/c-build-systems-what-to-use – Ray Tayek Mar 11 '13 at 22:48
  • This question will just turn into a popularity poll for the different tools. All have their proponents and each in turn will tell you to use their preferred tool. Your use case doesn't seem like it has very special requirements that really would make one tool fit much better than the next. I've voted to close. – eriktous Mar 12 '13 at 11:52

4 Answers4

2

I would agree with the commenters who suggest Ant. It's pretty universal, and can do anything, to the point of anything it can't do you can write a custom task for to make it do it. It's also portable (if that matters) and consistent across all of the installations. It's also Java friendly, which make really is not.

Will Hartung
  • 115,893
  • 19
  • 128
  • 203
2

Are you building a jar or doing anything more complicated than just compiling the Java code? If so, ant is probably the best tool for that part.

C/C++ is quite easy to drive with make.

I'd call ant using a target in the Makefile to drive the whole thing.

acarlow
  • 914
  • 1
  • 7
  • 13
1

This is generally a question of personal preference and experience. Thus the best one would be the one you know how to use. Although there is nice tool called scons which support building all java, c and c++ out of the box on different platforms. It's also made in python itself thus adding more mess to your setup ;). Here is the example SCons file

Program('c_exe', ['file1.c', 'file2.c', 'file3.c'])
Program('cpp_exe', ['file1.cpp', 'file2.cpp', 'file3.cpp'])
Java('classes', 'src') # unlike Program, Java requires you to specify output and input folder
event
  • 379
  • 1
  • 4
0

Try http://www.gradle.org/. The c++ support may be a bit premature though. Configuring cpp sources in gradle

Community
  • 1
  • 1
Ray Tayek
  • 9,841
  • 8
  • 50
  • 90