help-make
[Top][All Lists]
Advanced

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

Filenames with spaces in Makefiles


From: Bradford Chamberlain
Subject: Filenames with spaces in Makefiles
Date: Thu, 30 Jan 2003 01:03:37 -0800 (PST)

I am porting some code tonight from linux to windows.  Some of the rules
in my Makefiles depend on a user-supplied path via an environment
variable.  For example:

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

I am finding that when the ROOTDIR path has spaces in it, I cannot coerce
make into treating it as a single unit rather than breaking it up at each
space.  For example, if ROOTDIR="/cygdrive/c/Documents and Settings/brad"  
I get:

make: *** No rule to make target `/cygdrive/c/Documents', needed by `foo.o`.

Normal tricks to quote the filename (as I would in a shell script) don't
seem to work.

I'm curious if anyone has any suggestions for this problem.  If it helps,
the Makefile is being called from a shell script that can massage the
pathname before sending it in (though handling it within the Makefile
would be preferable, if possible, for simplicity).

I'm doing this work using cygwin and am using version 3.79.1 of make.

Thanks for any help,
-Brad






reply via email to

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