Page 1 of 1

[cygwin] Codelite Makefile

Posted: Sat Oct 30, 2010 8:23 pm
by smt96
Hello,

I am a new user of CodeLite and was trying to set it up with CYGWIN.

I am getting the following error while trying to build my very first project.

----------Build Started--------
C:\Windows\system32\cmd.exe /c ""make.exe" -j 2 -f "CodeLite_wsp.mk""
----------Building project:[ lab - Debug ]----------
make[1]: warning: -jN forced in submake: disabling jobserver mode.
make[1]: Entering directory `/cygdrive/e/CodeLite/lab'
cygwin warning:
MS-DOS style path detected: E:/CodeLite/lab/main.c
Preferred POSIX equivalent is: /cygdrive/CodeLite/lab/main.c
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.h ... -pathnames
makedir: cannot create directory `./Debug': File exists
make[1]: *** [makeDirStep] Error 1
make[1]: Leaving directory `/cygdrive/e/CodeLite/lab'
make: *** [All] Error 2
----------Build Ended----------
0 errors, 0 warnings
make[1]: Leaving directory `/cygdrive/e/CodeLite/lab'
----------Build Ended----------
0 errors, 0 warnings

I will really appreciate any help to get over this problem.

Thanks,
Sumit

Re: Codelite Makefile

Posted: Sun Oct 31, 2010 10:03 pm
by smt96
i have tried multiple times but can't get it to work right.

Is Codelite compatible with CYGWIN w/o installing MSYS/MINGW?

-Sumit

Re: Codelite Makefile

Posted: Mon Nov 01, 2010 12:10 am
by eranif
I can't really answer that without installing cygwin on my machine.
Never tried it, but i think that with the correct configuration it should be feasible

I will try to install it tomorrow and test it
Eran

Re: Codelite Makefile

Posted: Sun Nov 07, 2010 6:41 pm
by smt96
did anyone got Codelite working with Cygwin?

Re: Codelite Makefile

Posted: Sun Nov 07, 2010 7:27 pm
by eranif
Hi,

I just installed make / g++ / gcc and I managed to made codelite to work with cygwin,

This is how I managed to do it:
  • Added the following environment variables line to "Settings | Environment Variables"

    Code: Select all

    PATH=C:\cygwin\bin;$(PATH)
    MakeDirCommand=/usr/bin/mkdir -p
    RM=/usr/bin/rm -f
    This will make sure that the cygwin toolchain is selected (in case you are not using full paths in the compiler toolchain options)
    Note: C:\cygwin\bin obvisouly should be replaced with the path to your cygwin bin directory :)
  • There is one limitation that can not be override from the configuration:
    codelite generates dependencies files (*.o.d) those file are using full path (C:\path\to\source...), this will break the makefile.
    You can temporarily fix this by disabling this dependencies file generation from:

    Settings | Build Settings | Compilers | g++ (or gcc) | Adavnced tab
    and un-tick the option that says:
    use compiler -MT switch to generate source dependencies files (*.o.d)
  • Manually delete the Debug / Release directory from previous attempts
And it should be working fine.

[*] Also: from 'Settings | Build Settings | Build system' change mingw32-make into make
I will commit a fix for the dependencies files hopefully tomorrow / tonight

Eran

Re: [cygwin] Codelite Makefile

Posted: Sun Nov 07, 2010 9:24 pm
by smt96
Awesome! It works!

Really appreciate the time and help provided! Thank you so much!

Re: [cygwin] Codelite Makefile

Posted: Mon Nov 08, 2010 3:22 am
by eranif
smt96 wrote:Really appreciate the time and help provided! Thank you so much!
No problem.

Note that the dependencies files are very important. These are the files that tell the makefile whether a source file needs to be re-compile due to modification of a header file

For example:

Assume that a file "a.cpp" has the following include statement:

Code: Select all

#include "a.h"
Now, if you modify "a.h" you expect that "a.cpp" will be re-compiled, when the dependencies files are disabled it will not work as expected.
I will fix it tomorrow
Eran

Re: [cygwin] Codelite Makefile

Posted: Tue Nov 09, 2010 10:57 pm
by eranif
here is an update:

First let me explain where the problem exists:
codelite uses the -MT flag of gcc to generate a dependencies rules which are included in the main makefile.

however, some of the dependencies might include full paths in them which under windows often includes the 'drive' letter followed by colon (e.g. C:)
This causes an issue with cygwin's make since the ':' is a keyword for the makefile. I cant seem to change this output.

Since the dependencies are really important, my only recommendation for you is:
- Use the cygwin toolchain
- Use mingw32-make as the 'build' tool (Settings | Build Settings | Build Systems)

The mingw32-make comes with codelite installation under windows (assuming you installed the one which contains mingw in the installer)
I tested it and it seems to run without any problem

Eran

Re: [cygwin] Codelite Makefile

Posted: Wed Nov 17, 2010 8:23 am
by smt96
Thanks for the reply.

As per your suggestions I downloaded mingw32-make and have got it going as the default build tool.

mingw32-make works great for me, i also prefer to have the dependencies working over going for a specific make tool.

Thanks again.
Smt96