LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Difference between make and gmake? (https://www.linuxquestions.org/questions/programming-9/difference-between-make-and-gmake-14167/)

Hubas 02-13-2002 03:28 AM

Difference between make and gmake?
 
Hi!

I've been writing a small program for a school project using g++, I ran into some difficulties when I tried to configure a simple make file. For some reason, the compiler couldn't link the files properly when I used the make command with g++. I tried the same thing on the solaris machines in school but changed compiler to CC (Solaris compiler), and then everything worked just fine. It also worked fine when I used the gmake command with the g++ compiler.

Is there some syntax you could use that would make everything build fine using the regular make command? I don't want to have to force people to use gmake for a regular small program.

This is a great forum by the way, I've been looking for a place like this ever since I installed linux two weeks ago. Hope the machine issues get resolved:)

trickykid 02-13-2002 08:45 AM

You should use gmake if you have a makefile that is specific to the GNU version of make, and will not be understood by other versions of make.

Basically, I don't think it has options that you want, and if it requires gmake, then your going to need gmake to compile.

crabboy 02-13-2002 10:44 PM

Last time I checked the two were the same on Linux:
Code:

# ls -l /usr/bin/make
-rwxr-xr-x    1 root    bin        114492 Feb  4  2001 /usr/bin/make
# ls -l /usr/bin/gmake
lrwxrwxrwx    1 root    root            4 Dec 20 00:53 /usr/bin/gmake -> make

I think your issue is more with the compiler than with make. It is possible that the Sun compiler includes some libraries by default that your linux compiler is not setup to do. What type of link error are you seeing?

Hubas 02-14-2002 01:02 AM

Thanks guys!
 
I don't really know what happened. I had such strange errors with my makefile, I saw that the gmake and make command was the same on my system as well. The problem must have had to do with the linker working differently on Solaris CC than it does on g++. Now it works as it should on both systems.

Thanks for your answers:)

kervin 02-14-2002 01:01 PM

You should post the specific error you got when you tried to build with the makefile.

If the makefile is small enough, you should post that as well.

That is, if you are still having that problem.


All times are GMT -5. The time now is 01:49 PM.