help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Making directories on windows XP


From: Dill, John
Subject: RE: Making directories on windows XP
Date: Fri, 11 Mar 2005 10:59:07 -0600

>Hi there,
>I'm trying to do a simple thing, make a non-existing directory, and I'm
>having great difficulty. I'm using windows XP, the standard command
>shell and I have cygwin installed. My make version is GNU Make 3.80.
>
>Here's the relevant portion of my makefile
>
>
>PLATFORM := vc02
>PRJDIR   := c:/mj/vc++
>OBJDIR   := $(PRJDIR)/build/$(PLATFORM)
>
>% : makeobjdir
>        mkdir $(OBJDIR)
>makeobjdir: ;
>
>In my directory structure, neither build, or build/vc02 exist to begin 
>with,
>I want to create the build/vc02 directory.
>
>However I get the error message
>
>mkdir c:/mj/vc++/build/vc02
>mkdir: cannot create directory `c:/mj/vc++/build/vc02': No such file or 
>directory
>make: *** [makefile] Error 1
>
>If I change the slashes to the opposite direction for windows using:-
>
>mkdir $(subst /,\,$(OBJDIR))
>
>I get this error message which seems to indicate the \ characters have
>been escaped wrongly...
>
>mkdir c:\mj\vc++\build\vc02
>mkdir: cannot create directory `c:\\mj\\vc++\\build\\vc02': No such file 
>or directory
>make: *** [makefile] Error 1
>
>
>Is there something simple I am doing wrong? Any tips appreciated.
>I've tried $(shell too, that doesn't seem to help....

I do stuff on MinGW, and I have paths that are like this.

/c/path/path2/path3

which I do

convert_path=$(shell $(ECHO) '$(1)' | $(SED) 's/\/\(.\)\//\1:\//; s/\//\\\\/g')

It converts /c/ to c:/, then replaces every '/' with backslashes.

c:\\path\\path2\\path3

In MinGW, you need double backslash for the shell to interpret it as a literal 
backslash.  You will also need to escape spaces as well if you run into those 
as well.  You'll need it if you want to pass paths to the cl compiler itself, 
such as LIBPATH:c:\\Program\ Files\\Microsoft\ Visual\ C++\ Toolkit\ 2003\\lib, 
etc.  It should work similarly for Cygwin since MinGW and Cygwin share a lot of 
similarities.

Hope this helps.
John




reply via email to

[Prev in Thread] Current Thread [Next in Thread]