Philipp
Philipp

Reputation: 11813

Eclipse CDT created makefile cannot "clean" on Windows

I have a makefile project with makefiles generated by Eclipse CDT (Helios, MinGW). The "clean" command does not work because the "del" command is executed with arguments like ./src/myfile.o, but on Windows this doesn't work (should be .\src\myfile.o).

How can I either tell Eclipse to use the Windows Path Separator or otherwise maybe replace the command "del" by something different (I could easily write a batch script which replaces the forward-slashes by backslashes)?

Thanks for any hints!

Upvotes: 3

Views: 7407

Answers (5)

Marcin Tarsier
Marcin Tarsier

Reputation: 192

There is simple solution, create a makefile.defs file in your project's main directory with the following content:

RM := rm -rf

Basically this file lets you override variables from auto-generated makefile and RM is wrapper for remove command.

Upvotes: 5

max
max

Reputation: 1

Before you rename rm.exe to del.exe, check the path in Eclipse. The path has to have Unix path separators (forward slash, /) and not the Windows path separator (backslash, \). This has fixed the problem on my side.

Upvotes: 0

hariharan
hariharan

Reputation: 31

The best option is to download and install GnuUtils http://sourceforge.net/projects/gnuwin32/files/coreutils/5.3.0/coreutils-5.3.0.exe/download and add the installed directory (C:\ProgramFile???\GnuWin32\bin)to your windows path and restart eclipse.Eclipse should execute rm-rf now...if it still doesnt ...restart windows and check your path again to see if it has \GnuWin32\bin ...then restart eclipse...

Upvotes: 3

johnjamesmiller
johnjamesmiller

Reputation: 730

in your msys bin directory (C:\msys\1.0\bin on my machine) create a copy of rm.exe and rename it del.exe.

this is a hack. i am not familiar with the differences between the rm and del arguments. the base functionality is there. (delete file1 file2 filen)

in windows there is no del.exe, the delete functionality is built into CMD.exe. eclipse runs the commands in the msys shell which does not have the del functionality. this prevents you from adding a path to eclipse in which to search for del.exe.

i tried many different things to get the managed make to put "RM := rm" in the makefile but failed.

Upvotes: 2

crazyscot
crazyscot

Reputation: 11999

Edit the makefiles to use the mingw rm command instead?

Upvotes: 0

Related Questions