During messing around with building OpenWrt from scratch I noticed that there are a ton of more charackters that breaks the build process than just spaces and that they're not catched yet. Would'nt it be better to go with something like TOPDIR:=$(shell echo \${CURDIR} | sed 's|[^/[:alnum:]._-]|\\&|g')
instead of the TOPDIR:=${CURDIR}
directive in the top Makefile and then with a ifneq ($(TOPDIR),${CURDIR})
construct instead of the $(if $(findstring
term to catch'em all? That alters the content of TOPDIR
to a form at least the shell is totally happy with but also catches all spechial characters to avoid 'cause it checks against the alternation instead of just checking if spaces are present in the variable.
The altered TOPDIR
makes it theoretically even possible to use all kinds of spechial charackters not only spaces, but that lead to all kinds of other funny failures, although Spaces seem to become feasible with it, at least the errors I get trying to invoke make menuconfig
are at first site from invoking external commands in a not space-aware manner, not from the make system itself. But that has to be proven...