tags:

views:

227

answers:

1

I created a new HalloWorld Makefile Project. There is a HalloWorld.cpp with my main function. Now I have a file /src/startup.cpp that conains a main function. Now I want to use the main function from /src/startup.cpp

Where can I tell eclipse to use that one?

+1  A: 

Place the following in the file Makefile at the project root

CXXFLAGS= -g -O0
CXX=g++

all: bin bin/myprog

bin/myprog: bin/startup.o
    $(CXX) -o bin/myprog bin/startup.o

bin/startup.o: src/startup.cpp
    $(CXX) $(CXXFLAGS) -o bin/startup.o -c src/startup.cpp

bin:
    mkdir bin

clean:
    rm bin/startup.o
    rm bin/myprog
Maik Beckmann
So i relay have to write all the makefiles myself? Okay. Thanks.
Tarion