LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   problem with makefile (https://www.linuxquestions.org/questions/programming-9/problem-with-makefile-512914/)

killer_instinct 12-22-2006 12:30 PM

problem with makefile
 
hi i made 3 files which are
project.c
lib.c
lib.h


in project.c i write

#include <studio.h>
main()
{
printf("hello",dosomething(5));
}




in lib.c i write
#include "lib.h"


int dosomething( int x )
{
return (x*3);
}




in lib.h i write
int dosomething( int ) ;




and in the makefile i write
project.exe:project.o lib.o
cc -o project project.o lib.o
lib.o : lib.c
cc -c lib.o lib.c
project.o : project.c lib.h
cc -c project.o project.c lib.h

and thenn i go to the shell and i taped make
it said erreur:missing seperate

theNbomr 12-22-2006 12:35 PM

It is a complaint about the format of your makefile. Please repost your makefile in CODE tags to preserve the formatting.

--- rod.

Nylex 12-22-2006 01:18 PM

Quote:

Originally Posted by killer_instinct
cc -c lib.o lib.c

That "lib.o" shouldn't be there.

killer_instinct 12-22-2006 01:31 PM

where so can any body help me i guess it's a simple program !!!!

jlliagre 12-22-2006 01:36 PM

As already asked for, please post your Makefile between code tags.

Something like:

Code:

project: project.o lib.o
  cc -o project project.o lib.o
lib.o : lib.c
  cc -c lib.c
project.o : project.c lib.h
  cc -c project.c lib.h

I fixed two lines there, as Nylex suggested, and the main target too.

killer_instinct 12-22-2006 02:12 PM

thank you very much now i must tape make right
i mean i save what u tagged in a file called makefile then i tape make in the shell

jlliagre 12-22-2006 02:26 PM

Glad to know.
The reason it failed is likely missing spaces (or tab) before the cc commands in your original Makefile.

killer_instinct 12-22-2006 03:22 PM

my god it's the space so
really windows is more good than this unix
all of that because of space
merci pour ton aide mon ami(je parle aussi francais)

jlliagre 12-22-2006 03:51 PM

Quote:

Originally Posted by killer_instinct
my god it's the space so
really windows is more good than this unix

:tisk:
Windows is certainly not "more good" than Unix because of this particular spacing issue.

At the opposite, breaking conventions like this one is commonly described as the obnoxious "Embrace and Extend" behaviour. http://en.wikipedia.org/wiki/Embrace...and_extinguish

killer_instinct 12-23-2006 03:49 AM

still not working i stay all day trying fix it but the same problem

Quote:

makefile:2:*** missing spepartors .stop

jlliagre 12-23-2006 04:26 AM

What system are you running ?

jschiwal 12-23-2006 04:51 AM

Quote:

Originally Posted by jlliagre
At the opposite, breaking conventions like this one is commonly described as the obnoxious "Embrace and Extend" behaviour. http://en.wikipedia.org/wiki/Embrace...and_extinguish

Now you understand why IExplorer adds so many odd querks and didn't support CSS properly until Firefox posed a threat. If the IE browser was standards compliant, then web apps could become as useful as desktop apps, so applications could become desktop neutral threatening their main product.

killer_instinct 12-23-2006 08:46 AM

i use fedora fc4
what's the matter with that makefile
did you test that makefile

jlliagre 12-23-2006 10:48 AM

Again, can you post the makefile you are using, and between code tags.

And make sure the indented lines start with a tab, as POSIX standard requires.

killer_instinct 12-23-2006 11:11 AM

i use this one i write it and it's the same problem

Quote:

project: project.o lib.o
cc -o project project.o lib.o
lib.o : lib.c
cc -c lib.c
project.o : project.c lib.h
cc -c project.c lib.h


All times are GMT -5. The time now is 10:59 PM.