Follow-up Comment #12, bug #712 (project make): What's a pity the bug/limitation has lasted more than 10 years! I'd like to share my workaround here.
1. Replace all space by "+" before calling make functions and restore before the real procssing logic, e.g. ------------ SRC_NOSP=AA+Mgr/cpp1.cpp AA+Mgr/cpp2.cpp $(info total $(words $(SRC_NOSP)) source files!) OBJ_NOSP=$(patsubst %.cpp,$(ObjDir)/%.o,$(SRC_NOSP)) SRC=$(subst +, ,$(SRC_NOSP)) OBJ=$(subst +, ,$(OBJ_NOSP)) all: $(OBJ) ... ------------ 2. As shell supports space by quote or escape, you can choose to use shell commands. And if necessary you can write your own script to handle words. e.g. Don't use: File=AA Mgr/cpp1.cpp SrcDir=$(dir $(File)) insteads, SrcDir=$(shell dirname '$(File)') 3. use quotes when you call shell e.g. ------------ Src=AA Mgr/cpp1.cpp %.o: %.cpp c++ '$<' -o '$@' ------------ However, I wonder why supporting space breaking the compatibility if space is escaped by ''? Was '' used as common char on old system? And how about the tradeoff that making new flag/switch to keep compatibility? I'm looking forwards to the fix of this bug. Jian _______________________________________________________ Reply to this item at: <http://savannah.gnu.org/bugs/?712> _______________________________________________ Message sent via/by Savannah http://savannah.gnu.org/ _______________________________________________ Bug-make mailing list Bug-make@gnu.org https://lists.gnu.org/mailman/listinfo/bug-make