I am using Fedora 15 and I'm re-learning c++ and in the process of doing
that I'm also trying to learn how to use makefiles. I have a question
regarding the first makefile that I'm experimenting with. The c++ files I'm
using are: main.cpp, add.cpp and add.h. The makefile I'm using is:
PROGRAM="headers"
add.o: add.cpp add.h
g++ -c add.cpp
main.o: main.cpp add.h add.o
g++ -c main.cpp
${PROGRAM}: main.o add.o add.h
g++ -o ${PROGRAM} main.o add.o
When I run the make file everything gets compiled properly, but I get the
following output:
./make: line 3: add.o:: command not found
./make: line 6: main.o:: command not found
./make: line 9: headers:: command not found
I was just wondering if there is something that I'm doing wrong, and if not,
then if there is a way to not have those messages.
--
You received this message because you are subscribed to the Linux Users Group.
To post a message, send email to [email protected]
To unsubscribe, send email to [email protected]
For more options, visit our group at
http://groups.google.com/group/linuxusersgroup
Please remember to abide by our list rules (http://tinyurl.com/LUG-Rules or
http://cdn.fsdev.net/List-Rules.pdf)