the most simple makefile ever

Please support our C++ advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Sep 2008
Posts: 20
Reputation: kyosuke0 is an unknown quantity at this point 
Solved Threads: 0
kyosuke0 kyosuke0 is offline Offline
Newbie Poster

the most simple makefile ever

 
0
  #1
Apr 8th, 2009
hi, this is embarrassing, for whatever reason I am getting "Don't know how to make target driver.o" whenever i type make. There is only one file named "driver.cpp" in the directory that i have to compile. I am staring at tutorials and don't understand why this won't work.

heres whats in the make file
  1. run: driver.o
  2. CC -o run driver.o
  3. driver.o: driver.cpp
  4. CC -c driver.cpp
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 476
Reputation: nucleon has a spectacular aura about nucleon has a spectacular aura about 
Solved Threads: 91
nucleon's Avatar
nucleon nucleon is offline Offline
Posting Pro in Training

Re: the most simple makefile ever

 
0
  #2
Apr 9th, 2009
You do realize that you cannot use spaces. You must use tabs.
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 20
Reputation: kyosuke0 is an unknown quantity at this point 
Solved Threads: 0
kyosuke0 kyosuke0 is offline Offline
Newbie Poster

Re: the most simple makefile ever

 
0
  #3
Apr 9th, 2009
Originally Posted by nucleon View Post
You do realize that you cannot use spaces. You must use tabs.


yes, but you cannot use the tab key in the forum message box so i used spaces to simulate the tab. The actual make file has tabs and the newline so i know those are not the problem, also I am using sun's c++ CC compiler in linux. sorry for the confusion
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 476
Reputation: nucleon has a spectacular aura about nucleon has a spectacular aura about 
Solved Threads: 91
nucleon's Avatar
nucleon nucleon is offline Offline
Posting Pro in Training

Re: the most simple makefile ever

 
0
  #4
Apr 9th, 2009
Does this line work if you type it into a console in the proper directory?

CC -c driver.cpp

When I used unix I only used C. Is CC (as opposed to cc) the C++ compiler?
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 20
Reputation: kyosuke0 is an unknown quantity at this point 
Solved Threads: 0
kyosuke0 kyosuke0 is offline Offline
Newbie Poster

Re: the most simple makefile ever

 
0
  #5
Apr 9th, 2009
Originally Posted by nucleon View Post
Does this line work if you type it into a console in the proper directory?

CC -c driver.cpp

When I used unix I only used C. Is CC (as opposed to cc) the C++ compiler?

yes if i compile the file manually it produces an executable, and yes to your second question as well, the sun studio 12 suite i believe its called
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 1,953
Reputation: Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of 
Solved Threads: 214
Featured Poster
Duoas's Avatar
Duoas Duoas is offline Offline
Posting Virtuoso

Re: the most simple makefile ever

 
0
  #6
Apr 9th, 2009
I don't currently have access to Solaris ATM... alas, but perhaps it is something as simple as needing a blank line after each target:
  1. CC = cc
  2.  
  3. run: driver.o
  4. CC -o run driver.o
  5.  
  6. driver.o: driver.cpp
  7. CC -c driver.cpp
BTW, you can have tabs in the forum message boxes, but you have to cut and paste them in... (So you can just cut and paste this code block into a file and it would work.)

The CC is a makefile macro. Sun's compiler is "cc". (I think...)

Hope this helps.
Last edited by Duoas; Apr 9th, 2009 at 1:15 pm.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 693 | Replies: 5
Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC