Steps to reproduce:
1. Use a path with a space in it.
2. Build RegexKit.
3. Clean and build it again. PCRE should be fetched even though it already exists.
Sadly, I have to mark this as 'Wont fix'. I've given it a go a few times, but it's one of those things that's /so/ deeply ingrained in the way Makefiles, and the syntax of Makefiles, that it's well nigh impossible to get file names with spaces in them to work reliably under all corner cases inside a Makefile. To this day Xcode's release notes still contain a warning about file names with spaces, or paths to files with spaces in them, can still cause problems... and they've been trying to excise these daemons for a long, long time.
One of the problems that I remember trying to tackle was that the Makefile will internally and dynamically 'rewrite' itself.. but in the process, it will strip off a layer of 'escape guards' when performing a round of variable substitutions. Then, once the escape guards pop off, it treats the result as two separate files. This cascades in complex and almost impossible ways to predict because it's one huge directed graph of interdependencies... which is changing dynamically on the fly... so you literally plug one hole only to have it appear somewhere else in such a way that makes your original fix unnecessary because the 'new' graph no longer has dependencies you've fixed up.. :(
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I realize this is a pain to solve but I'd still like you to give it a try :) I'd change the folder names, but the space is actually in the partition's name which is apparently somewhat difficult to change.
I spent a little time with this and made the following patch. Please see if it's acceptable. I only tested the tarball target and not others that have file names as their names or their requirements.
Index: Makefile.pcre
--- Makefile.pcre (revision 51)
+++ Makefile.pcre (working copy)
@@ -199,8 +199,12 @@
#
# Fetches the pcre tarball if it doesn't exist and untars it. Makes a timestamp so if the tarball is updated it causes an untaring of the newer tarball.
#
+empty:=
+s1:= $(empty) $(empty)
+s2:= \$(empty) $(empty)
+tarball_target:= $(subst $(s1),$(s2),$(PCRE_TARBALL_FILE_PATH))
-${PCRE_TARBALL_FILE_PATH}:
+$(tarball_target):
@echo "${MAKEFILE_PCRE}:204: note: The pcre library distribution file '${PCRE_TARBALL_FILE_NAME}' does not exist. Downloading from '${PCRE_TARBALL_URL}'."; \
mkdir -p '${PCRE_TARBALL_DISTRIBUTIONS_DIR}'; \
${PCRE_FETCH_COMMAND} || \
@@ -213,7 +217,7 @@
exit 1; \
fi;
Sadly, I have to mark this as 'Wont fix'. I've given it a go a few times, but it's one of those things that's /so/ deeply ingrained in the way Makefiles, and the syntax of Makefiles, that it's well nigh impossible to get file names with spaces in them to work reliably under all corner cases inside a Makefile. To this day Xcode's release notes still contain a warning about file names with spaces, or paths to files with spaces in them, can still cause problems... and they've been trying to excise these daemons for a long, long time.
One of the problems that I remember trying to tackle was that the Makefile will internally and dynamically 'rewrite' itself.. but in the process, it will strip off a layer of 'escape guards' when performing a round of variable substitutions. Then, once the escape guards pop off, it treats the result as two separate files. This cascades in complex and almost impossible ways to predict because it's one huge directed graph of interdependencies... which is changing dynamically on the fly... so you literally plug one hole only to have it appear somewhere else in such a way that makes your original fix unnecessary because the 'new' graph no longer has dependencies you've fixed up.. :(
I realize this is a pain to solve but I'd still like you to give it a try :) I'd change the folder names, but the space is actually in the partition's name which is apparently somewhat difficult to change.
I spent a little time with this and made the following patch. Please see if it's acceptable. I only tested the tarball target and not others that have file names as their names or their requirements.
Index: Makefile.pcre
--- Makefile.pcre (revision 51)
+++ Makefile.pcre (working copy)
@@ -199,8 +199,12 @@
#
# Fetches the pcre tarball if it doesn't exist and untars it. Makes a timestamp so if the tarball is updated it causes an untaring of the newer tarball.
#
+empty:=
+s1:= $(empty) $(empty)
+s2:= \$(empty) $(empty)
+tarball_target:= $(subst $(s1),$(s2),$(PCRE_TARBALL_FILE_PATH))
-${PCRE_TARBALL_FILE_PATH}:
+$(tarball_target):
@echo "${MAKEFILE_PCRE}:204: note: The pcre library distribution file '${PCRE_TARBALL_FILE_NAME}' does not exist. Downloading from '${PCRE_TARBALL_URL}'."; \ mkdir -p '${PCRE_TARBALL_DISTRIBUTIONS_DIR}'; \ ${PCRE_FETCH_COMMAND} || \ @@ -213,7 +217,7 @@
exit 1; \ fi;
-${PCRE_TEMP_DIR}: ${PCRE_TARBALL_FILE_PATH}
+${PCRE_TEMP_DIR}: ${tarball_target}
@echo "${MAKEFILE_PCRE}:217: note: Untaring '${PCRE_TARBALL_FILE_NAME}'."; \ cd '${PCRE_TEMP_ROOT}' && \ ${PCRE_UNTAR_COMMAND};