LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Solaris / OpenSolaris (https://www.linuxquestions.org/questions/solaris-opensolaris-20/)
-   -   Issue with GMAKE (https://www.linuxquestions.org/questions/solaris-opensolaris-20/issue-with-gmake-4175442788/)

btk1985@gmail.com 12-24-2012 07:46 AM

Issue with GMAKE
 
Hi,

I just have a query,In my project im using GCC Compiler for compilation which uses Solaris DMAKE.
Now im migrating this to GMAKE. But Normally GMAKE by default picks g++ Compiler for compilation.
Im getting lot of errors since my code based out of GCC
Anybody help me out how to resolve this issue, So that my makefile based out of GMAKE should pick GCC Compiler for compilation.

Thanks in advance!!

smallpond 12-25-2012 09:41 AM

Make sure your source files are named correctly.
The default gnu make rules compile *.c with gcc, *.cc, *.C and *.cpp with g++.
The compiler changes if you change the value of predefined variables CC and CXX, so don't do that.

btk1985@gmail.com 12-25-2012 11:57 PM

Hello Pond im not changing the predefined variables. My intention is i want to change the default compiler that gmake uses that is g++ to gcc compiler.

jlliagre 12-28-2012 02:27 PM

Quote:

Originally Posted by btk1985@gmail.com (Post 4856835)
My intention is i want to change the default compiler that gmake uses that is g++ to gcc compiler.

That doesn't make sense.
C and C++ are different programming languages which use different compilers. As smallpond already stated, gmake (and dmake or make for that matter) pick the correct compiler depending on the source code extension.

pan64 12-28-2012 02:59 PM

anyway, if you want to change the compiler you must modify those predefined variables, not the make utility itself. Using g++ instead of gcc is not a good idea, because gcc is a c compiler, g++ is a c++ compiler (as it was mentioned). replacing the make system will not solve this issue and also you may get additional problems because of the differences (incompatibilities) between them


All times are GMT -5. The time now is 01:23 AM.