[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Troublesome filenames in a Makefile
From: |
JT Williams |
Subject: |
Troublesome filenames in a Makefile |
Date: |
Wed, 28 Aug 2002 08:32:25 -0500 |
User-agent: |
Mutt/1.4i |
Hello,
It seems that Make 3.79.1 (version info appended) has trouble with
filenames (in a Makefile) that contain "special" characters (the colon,
in particular, and perhaps other characters as well).
% cat Makefile
# Makefile
SRC = 2001\;6(2)\:126--135.pdf
all: $(SRC)
test -f "$<" && echo yes
# end of Makefile
% touch '2001;6(2):126--135.pdf'
% make all
make: *** No rule to make target `2001;6(2)\:126--135.pdf', needed by `all'.
Stop.
The semicolon is properly escaped, but the `\' used to escape the colon
survives as part of the file name. The file (with the backslash in the
name) does not exist, and `make' complains. So now do this:
% touch '2001;6(2)\:126--135.pdf'
and `make' will find it:
% make
test -f "2001;6(2)\:126--135.pdf" && echo yes
yes
If the colon is not escaped in the Makefile, `make' will
interpret $(SRC) as a munged archive member reference:
% make
Makefile:5: *** target pattern contains no `%'. Stop.
---
% make --version
GNU Make version 3.79.1, by Richard Stallman and Roland McGrath.
Built for sparc-sun-solaris2.8
Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000
Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Report bugs to <address@hidden>.
- Troublesome filenames in a Makefile,
JT Williams <=