Problems about makefile in eclipse !

bridged with qdn.public.devtools
Post Reply
dyq

Problems about makefile in eclipse !

Post by dyq » Wed Aug 27, 2003 2:59 am

I installed the cdt in the eclipse.So now I can process the c++ file.I
programeded a simple c++ file:hello world! And I programed a make file .This
is the code:

objects = hello.o

hello : $(objects)
gcc -o hello $(objects) -L /usr/bin
$(objects) : hello.cpp
gcc -c hello.cpp

all :
${MAKE} hello

..PHONY : clean
clean :
-del hello.exe $(objects)

I use the command : /usr/bin/make -f hello.cpp to compile the makefile.

But there is a error :***commands commence before first target.Stop.
How to solve the problem? Help!

Alex Chapiro

Re: Problems about makefile in eclipse !

Post by Alex Chapiro » Wed Aug 27, 2003 12:07 pm

/usr/bin/make -f hello.cpp : this is a wrong syntax. -f should be followed
the name of make file. You should use it only if this file has a name
different from Makefile.


"dyq" <power_du@sohu.com> wrote in message news:bih65r$bke$1@inn.qnx.com...
I installed the cdt in the eclipse.So now I can process the c++ file.I
programeded a simple c++ file:hello world! And I programed a make file
..This
is the code:

objects = hello.o

hello : $(objects)
gcc -o hello $(objects) -L /usr/bin
$(objects) : hello.cpp
gcc -c hello.cpp

all :
${MAKE} hello

.PHONY : clean
clean :
-del hello.exe $(objects)

I use the command : /usr/bin/make -f hello.cpp to compile the makefile.

But there is a error :***commands commence before first target.Stop.
How to solve the problem? Help!


Post Reply

Return to “qdn.public.devtools”