views:

83

answers:

1

While trying to install a build server I've run into a funny problem where all cygwin commands can be run from a DOS box but sometimes do not work when called from make. What's even more weird is some make targets, like 'clean', work and others, like 'all', do not.

Here's a representative makefile extract. The quoting has hosed the formatting but tabs are where they should be, trust me:

 .PHONY: all 
 all: update_autoconstants
    /usr/bin/rm -f $(OBJ_DIR)/myfile1.txt   
    rm -f  $(OBJ_DIR)/myfile2.txt   

 .PHONY: clean 
 clean:     
    rm -f $(OBJ_DIR)/*.*

Notice that in 'all' one rm call has a full path and one has no path. Also notice that clean's rm call has no path.

To this the response to a 'make -C makefile all' is:

/usr/bin/rm -f ../../obj/myfile1.txt 
rm -f ../../obj/myfile2.txt 
make: rm: Command not found 
make: *** [all] Error 127

ie. the full path works, the no-path does not. What then starts my head spinning is the 'clean' target in make with no path works fine. it's not just cygwin commands, make can't find the compiler either. It seems pretty clear that somewhere the path has been hosed, although the environment variable PATH is set, but only in make - this works fine from a DOS prompt.

C:\>cygpath --unix c:\programme\cygwin\bin\rm  
/usr/bin/rm

The machine is running Windows Server 2003 German language in a virtual machine on VMWare ESX, the cygwin install was done yesterday, installed in c:\programme\cygwin\ and everything else is clean vanilla Windows installation.

Any ideas? Thanks in advance.

A: 

Not really so much of a solution as a workaround - we made all the makefiles use absolute paths to the exe files they need which is in any case a bit nicer than searching a path and taking what you find.

To perhaps save someone some Googling commands in cygwin's bin directory can best be called:

CYGWIN_EXE_PATH = /usr/bin
RM        = $(CYGWIN_EXE_PATH)/rm.exe
.PHONY: clean
clean:
    $(RM) -f $(OBJ_DIR)/*.*

And similarly files in the program files directory like this:

COMPILER_DIR = "$(PROGRAMFILES)/TASKING/c563 v3.6r1"

Hope that helps.

Toby Martin