3

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!

5 Answers 5

5

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.

3

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...

2

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.

0

Edit the makefiles to use the mingw rm command instead?

2
  • is this possible? Please note that the makefiles are generated automatically by Eclipse.
    – Philipp
    Commented Sep 27, 2010 at 6:50
  • OK, my bad. When you spoke of makefiles I thought you were talking about a CDT Makefile project. You could always switch to one of those and write the makefiles yourself?
    – crazyscot
    Commented Sep 29, 2010 at 23:20
0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.