Share your knowledge at the LQ Wiki.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 02-13-2002, 03:28 AM   #1
LQ Newbie
Registered: Feb 2002
Location: Sweden, Uppsala
Posts: 15

Rep: Reputation: 0
Difference between make and gmake?


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
Old 02-13-2002, 08:45 AM   #2
LQ Guru
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 235Reputation: 235Reputation: 235
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.
Old 02-13-2002, 10:44 PM   #3
Senior Member
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,823

Rep: Reputation: 120Reputation: 120
Last time I checked the two were the same on Linux:
# 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?
Old 02-14-2002, 01:02 AM   #4
LQ Newbie
Registered: Feb 2002
Location: Sweden, Uppsala
Posts: 15

Original Poster
Rep: Reputation: 0
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
Old 02-14-2002, 01:01 PM   #5
Registered: Jan 2002
Location: Melbourne, FL.
Distribution: redhat
Posts: 168

Rep: Reputation: 30
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.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
difference between make bzImage and make vmlinuz? veritas Linux - Newbie 3 11-23-2011 04:45 AM
what is the difference between make distclean and make clean? alice95089 Linux - Software 3 08-28-2008 01:22 AM
zend really does make a difference! wijnands Linux - Software 0 02-23-2005 04:28 AM
What is the difference between 'make oldconfig' and 'make xconfig' davidas Linux - Newbie 2 04-07-2004 03:49 AM
difference between 'make' and 'gmake'? unholy Linux - General 2 10-26-2003 12:58 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:51 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration