Author Topic: Problem about makefiles  (Read 3443 times)

goodwood

  • Guest
Problem about makefiles
« on: November 16, 2005, 02:01:39 am »
Hi all, as the first post, I'd like to say this is a great software.
I recently changed from DEV C++ to codeblocks . Everything is fine, and I'm most happy that I can choose different compilers. But later, I met one trouble.
When I'm using DEV in windows, it will automatically create a makefile (Makefile.win). After debugging under windows, I can simply transfer all the files/directories into Linux,  cp the Makefile.win to makefile, and change the g++.exe to g++ in makefile. Then just make under linux, no problems at all.
But now with codeblocks, I have exported a makefile (seems more complicated than what DEV created). When I transfer it with the sources to the Linux, either make or gmake will report tons of errors ( probably the fatal one is some dependecy file XX.d cannot be found). This prevent me to debug under windows and running jobs under Linux Servers. Any solutions to this problem?

Thanks in advance.

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Problem about makefiles
« Reply #1 on: November 16, 2005, 05:51:47 am »
Well, unfortunately, the generated makefiles are OS-dependant. If you're using Codeblocks-win, you'll generate windows makefiles, if you're using Codeblocks-linux, you'll generate unix makefiles. This fault  is due to legacy code that we plan to revamp for version 2.0.

Try using the linux-version of codeblocks to generate the makefiles based on the .cbp. If you find an incompatibility, change the compiler settings and save the .cbp as "yourproject-linux.cbp" or something.

If you can do WITHOUT makefiles at all, the better. Most of us have dumped the usage of makefiles for the direct-compilation method. But if you prefer, just generate the linux makefile using linux.
Hope that helps.

Oh, if you want to know the differences between linux and windows makefiles, check this file and search for the ifdefs, but I'm sure Yiannis can be of much more help (he's the one who designed that part of the program).
« Last Edit: November 16, 2005, 05:55:40 am by rickg22 »

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Problem about makefiles
« Reply #2 on: November 16, 2005, 08:48:09 am »
The Makefile generation is a little outdated, compared with the latest changes in the normal build system (PCH, dependencies, ect). It is planned to be brought up to speed, though...
Be patient!
This bug will be fixed soon...