LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 05-20-2002, 02:43 PM   #1
Winter
LQ Newbie
 
Registered: May 2002
Location: Washington State
Distribution: Red Hat 7.0
Posts: 22

Rep: Reputation: 15
makefile


I have an assignment and I am supposed to create a file called "makefile" and use the command 'make' to execute "makefile"

here is the example given..

----------------------------------
sample: main.o sort.o addone.o search.o
cc main.o sort.o addone.o search.o -o foo
main.o: main.c
sort.o: sort.c
addone.o: addone.c
search.o: search.c

(NOTE: The spaces preceding "cc main.o . . ." is really a tab. The tab character must be present!)

Now, to create the executable program called "foo", simple type "make" on the command line.
----------------------------------

I tried this

sample: main.o orderedlist.o average.o deviation.o input.o variance.o classify.o highscore.o lowscore.o testinput.o
cc main.o orderedlist.o average.o deviation.o input.o variance.o classify.o highscore.o lowscore.o testinput.o -o main
main.o: main.c
orderedlist.o: orderedlist.c
average.o: average.c
deviation.o: deviation.c
input.o: input.c
variance.o: variance.c
classify.o: classify.c
highscore.o: highscore.c
lowscore.o: lowscore.c
testinput.o: testinput.c


that gave an error..

makefile:2: *** missing separator. Stop.

I am assuming that this error was caused because of a lack of : usage in line 2.. how do I correct this?
 
Old 05-20-2002, 05:00 PM   #2
urhome
LQ Newbie
 
Registered: May 2002
Posts: 1

Rep: Reputation: 0
I ran into this problem also and I think I resolved it by creating an entirely new makefile using vi and pasting the contents of the old one on a per line basis. The error I think was because there were some unprintable characters got inserted in the makefile somehow with the editor I was using. Good luck.
 
Old 05-21-2002, 12:43 PM   #3
Winter
LQ Newbie
 
Registered: May 2002
Location: Washington State
Distribution: Red Hat 7.0
Posts: 22

Original Poster
Rep: Reputation: 15
I got it working thx!
 
  


Reply



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
How to modify makefile.in or makefile.am QiangWan Linux - Newbie 1 05-17-2005 11:07 AM
how to get (makefile -f makefile )output into the textview widget in Pygtk sailu_mvn Programming 3 02-28-2005 03:57 AM
@ in makefile m_a61 Linux - General 2 09-08-2004 07:09 AM
generate Makefile from Makefile.in without calling ./configure ? chris78 Programming 2 05-02-2004 12:23 PM
makefile pessanimahi Programming 6 09-17-2003 02:34 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

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

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