help-make
[Top][All Lists]
Advanced

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

Re: Filenames with spaces in Makefiles


From: Paul D. Smith
Subject: Re: Filenames with spaces in Makefiles
Date: Thu, 30 Jan 2003 18:48:26 -0500

%% Bradford Chamberlain <address@hidden> writes:

  bc> I am porting some code tonight from linux to windows.

The best place to ask Windows questions is on the address@hidden
mailing list.

  bc> Some of the rules in my Makefiles depend on a user-supplied path
  bc> via an environment variable.  For example:

  bc> foo.o: $(ROOTDIR)/foo.c
  bc>   ...

  bc> I am finding that when the ROOTDIR path has spaces in it, I cannot
  bc> coerce make into treating it as a single unit rather than breaking
  bc> it up at each space.

The short answer is that you can't use whitespace in pathnames in GNU
make.

You will have to either:

 1) Rename the path so it doesn't have a space

 2) As someone else suggested, use 8.3 format for the name instead of
    the long format.  This is annoying because the 8.3 format may change
    as more files are added to the directory the 8.3 name is in, though,
    so be aware.

 3) Create a virtual drive (I don't know the right Windows lingo), so
    you'd create a drive like Q: which would map to the pathname
    ROOTDIR, then you could use Q: in your makefiles.

The only other options are things like using "_" in place of " " all
over inside the makefile, then at the last second (inside all the rules)
translating it back.  These are very messy.

Or, of course, you can switch to another build control tool that doesn't
have such severe whitespace issues... cook, for example, I think manages
this type of thing better than make.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.paulandlesley.org
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist




reply via email to

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