Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » CDT clean in makefile not working
CDT clean in makefile not working [message #1697741] Mon, 08 June 2015 02:45 Go to next message
Dominic Veconi is currently offline Dominic VeconiFriend
Messages: 1
Registered: June 2015
Junior Member
I've just downloaded eclipse CDT and I'm writing programs in C++ using eclipse. My toolchain is MinGW GCC. Here's my makefile:

all: sunnymountains.exe

clean:
rm -f main.o sunnymountains.exe

sunnymountains.exe: main.o
g++ -g -o sunnymountains main.o

main.o:
g++ -c -g main.cpp

sunnymountains.exe is the name of the application I'm writing. The issue is, if I edit main.cpp (the source code for sunnymountains) and then build the program, the old main.o and sunnymountains.exe files remain, and the application runs as if it had never been edited. Shouldn't my "clean" statement in the makefile take care of that? What do I have to write in the makefile to ensure that eclipse will clear out the old main.o and sunnymountains.exe files before building a new edit of the application?
Re: CDT clean in makefile not working [message #1697835 is a reply to message #1697741] Mon, 08 June 2015 18:46 Go to previous message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 742
Registered: August 2014
Senior Member
You should tell that main.o depends on main.cpp:

main.o: main.cpp


--

Tauno Voipio
Previous Topic:Build Failure when trying Linux Kernel debugging using Eclipse CDT
Next Topic:[Solved] Linux Kernel module build "make modules" error
Goto Forum:
  


Current Time: Fri Apr 26 22:21:01 GMT 2024

Powered by FUDForum. Page generated in 0.03023 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top