The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

moving to linux

I want to move a windows/mac osx project to linux.
Could someone point me a good starting point to migrate code to linux?

What tools can you suggest to create a make file and maintain projects?

I found several things with google but of course it is always good to listen to an experienced community.

The project is plain C++, would need sockets and file i/o.

Thanks for any hints
Husker Send private email
Saturday, December 02, 2006
I've only ever seen hand-coded make files, and CVS. The sockets API is similar on Windows and Linux, but you could consider wrapping them using
Christopher Wells Send private email
Saturday, December 02, 2006
There are "meta"-make tools which are helpful in this situation such as CMake and Premake, which you use instead of the windows Project files (.dsp/.dsw/.sln/.vcproj) and which are then used to generate all formats (said .dsp etc, Makefile, etc) -- this will make sure your Win and Linux makes stay in sync.

There are also make/project replacements like SCons nad Jam/BoostJam., which do not create "native" project files, but rather drive the compilation themselves.

If you insist on maintaining two project descriptions, there are files like "dsp2make" and stuff like that that will help you do a one time conversion of the project files -- and then you'll have to support both.
Ori Berger
Sunday, December 03, 2006
It is okay for me to maintain 2 project files, but it seems I need to setup up make files etc. by hand.

This is okay but I can't believe that people are really satisfied with this. I found KDevelop and Anujta, both look okay when you don't need to do much but to compile and debug a bit. The actual development would be still under windows.

It is a pitty that the culture of "just getting things done" seems no very common over there.

Thanks for the pointers.
Husker Send private email
Sunday, December 03, 2006
I'm surprised that nobody's mentioned autoconf/automake, which are used in the majority of open source projects on Linux. Those tools are also available on OS X and Windows.
Sunday, December 03, 2006
autoconf is rather overkill if you are just supporting one Unix platform.

We used a python script which read a file of standard compiler args on each platform and scanned the src directory to create a makefile on each platform.
Developers using VS kept their own .vcproj but the final build was done with the commandline compiler.
Martin Send private email
Monday, December 04, 2006
"I'm surprised that nobody's mentioned autoconf/automake, which are used in the majority of open source projects on Linux. "

Most people who had any contact with them are still trying to recover from the shock, and prefer not to bring back the memories. That's why.
Roman Werpachowski Send private email
Monday, December 04, 2006
I have just stopped working on a "multi-platform" project we supported all OSes. We had Makefiles, Makefile.vs and .vcproj files so you could compile on any platform.IT IS A NIGHTMARE,

I would strongly suggest taking the approach mentioned by Ori Berger. Do not keep two project files!!

If you insist on doing it, try Eclipse CDT, the managed C++ project type might help you with the makefiles. Hope it helps.
Monday, December 04, 2006
I'll recommend Jakarta's Ant, you'll need JRE to run Ant scripts, but it's very easy to use.
Leonardo M. Ramé Send private email
Monday, December 04, 2006
I use Qt's qmake tool. It generates makefiles/project files for multiple platforms from a single source. IIRC it is available for free without Qt.
Andy Brice Send private email
Monday, December 04, 2006
We started with the predesessor to qmake, 'tmake' it was such a mess of slightly non-standard perl scripts that didn't quite produce working .dsp files and had odd path requirments on windows. We had so many kludge fixes it was easier to just reimplement the whole thing in python.

I would look at something like ant for the final build makefiles but you might end up having to keep vcproj upto date manually.

Look at both QT and wxWdigets, they have solved many of these problems and have good communities of people building large cross platform products.
Martin Send private email
Monday, December 04, 2006
Eclipse/CDT, KDevelop if you like IDEs and not want to muck around with hand written make files etc.
Monday, December 04, 2006
Well, I managed to do first steps (little multithreaded socket server/client app on C++) including nice debugging with Eclipse 3.2 on Ubuntu. Not quite a soft cushion like VS2005, but totally okay to work.

Since the project needs also to be managed on Mac OSX, I will maintain the project files separately and when I was getting more used to the platform I will combine it. One step before the other :)

Additionally sharing the same files is a bit complicated anyway since the MS compiler does not like LF only when it comes to the preprocessor. So I need to share this over the version control anyway.
Husker Send private email
Tuesday, December 05, 2006
Why don't you set up a subversion repository and version all the source, but not the project files, that way you can have IDE project files, without breaking compatibility between the new releases?

There are svn clients for both mac and linux.

- Nate
Nate Send private email
Tuesday, December 05, 2006
+1 for ant.  It means you need a java vm (to run ant), but other than that, it works pretty much anywhere, and is not limited to use with java.

make is simply too painful for words...
BillT Send private email
Tuesday, December 05, 2006
Is this a GUI project? Or text mode ("console app" in Windows talk).

Because if it's text mode and already runs under OS X you probably won't have to do much.
dot for this one
Tuesday, December 05, 2006
Anjuta has some rather nice tools for generating and maintaining project files.  For a straight c++ program I think it would be a good fit.
Ryan Send private email
Tuesday, December 12, 2006

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
Powered by FogBugz