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 12-23-2006, 11:46 AM   #16
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled

You need indentation..
 
Old 12-23-2006, 11:46 AM   #17
killer_instinct
LQ Newbie
 
Registered: Dec 2006
Posts: 26

Original Poster
Rep: Reputation: 15
working now thx to my freind who helped this is the correct makefile
#makefile pour compiler Analyseur de traces

DIR = /root/Analyseurdetraces

INC = /root/Analyseurdetraces/include

OBJ = /root/Analyseurdetraces/obj

SRC = /root/Analyseurdetraces/src

OBJETS = $(OBJ)/mod1.o $(OBJ)/mod2.o

CC = gcc
CFLAGS = -g -ansi
Analtrace : ${OBJ}/mod2.o $(OBJ)/mod1.o
$(CC) $(CFLAGS) $(OBJETS) -o ${DIR}/Analtrace
${OBJ}/mod1.o : ${SRC}/mod1.c ${INC}/mod1.h
$(CC) $(CFLAGS) -c ${SRC}/mod1.c -o ${OBJ}/mod1.o
${OBJ}/mod2.o : ${SRC}/mod2.c ${INC}/mod2.h
$(CC) $(CFLAGS) -c ${SRC}/mod2.c -o ${OBJ}/mod2.o
clean :
rm $(DIR)/*~ $(OBJ)/*.o
 
Old 12-23-2006, 11:57 AM   #18
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Why are you working in /root?
 
Old 12-23-2006, 12:11 PM   #19
wmakowski
Member
 
Registered: Oct 2003
Location: Ohio
Distribution: Fedora 25, 26, RHL 5.2
Posts: 560

Rep: Reputation: 56
make requires that command lines begin with a tab. In your makefile you need to add a tab in front of the 2nd, 4th, and 6th lines. This is why your are getting the message makefile:2: *** missing separator. Stop. Notice the 2 in the message, that is pointing to line 2 of the makefile.

Other problem, but not that big a deal. lib.h should not be on line 5 and 6. Based on your code it is not a dependency for project.o and does not make sense having it on the cc line. While it won't cause an error, it is not necessary. My makefile looks similar to what jillagre posted. "Notice the tabs before the command lines."
Code:
project: project.o lib.o
        cc -o project project.o lib.o
project.o: project.c
        cc -c project.c
lib.o: lib.c lib.h
        cc -c lib.c
Bill
 
Old 12-23-2006, 01:23 PM   #20
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Quote:
Originally Posted by killer_instinct
working now thx to my freind who helped this is the correct makefile
That's quite ungrateful to the rest of us who gave the right solution to you.

Moreover, the Makefile you post is still broken, probably as you fail again to tag it correctly.
 
  


Reply

Tags
missing, stop



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
Makefile problem LuvMyKelly Linux - Newbie 2 12-09-2005 12:13 AM
Makefile Problem nelnel Programming 4 07-08-2005 02:31 AM
how to get (makefile -f makefile )output into the textview widget in Pygtk sailu_mvn Programming 3 02-28-2005 03:57 AM
Another problem with Makefile lucs Slackware 3 02-14-2005 05:06 PM
generate Makefile from Makefile.in without calling ./configure ? chris78 Programming 2 05-02-2004 12:23 PM

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

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

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