System: Ubuntu (linux)
Compiler\IDE: g++ (yeah I know, I'm turning to the dark-side)
API: std-lib

So no Pascal related question this time, but I'm stuck with a makefile at work. And as this is such nice community I thought to give it a shot here.

First of all I have a file called Main.cpp that just prints "Hello world". So now I want to create a make file so when I type make it compiles Main.cpp to something executable ./Main or ./Test or something. How do I do that?

I tried some stuff like this (ripped form the Internets):

Code:
COMPILER = g++
CCFLAGS = -g

myprogram: Main.cpp Main.o
	${COMPILER} ${CCFLAGS} Main.cpp Main.o

subfile1.o: Main.cpp Main.o
	${COMPILER} ${CCFLAGS} -c Main.cpp Main.o

myclass.o: Main.cpp
	${COMPILER} ${CCFLAGS} -c Main.cpp

clean: 
	rm -rf *.o a.out
But it doesn't seem to do the job...
Code:
g++ -g Main.cpp Main.o
Main.o: In function `main':
Main.cpp:(.text+0x0): multiple definition of `main'
/tmp/ccUA5sxi.o:/home/michiel/Cpp/Codeblocks/TestProject/TestProject/Main.cpp:3: first defined here
collect2: ld returned 1 exit status
make: *** [myprogram] Error 1
Is this a makefile error or a compilation error? I know there are some Linux-guys here that maybe can help me.