Hi,

Make cannot handle the word or path that contains space.
Here's a sample: (tested on 3.81 and 3.82)
--------------
INC=aa/hdr bb/hdr cc\ mgr/hdr
INC_FLAG=$(addprefix -I,$(INC))
N=$(words $(INC))

all: test
                @echo INC_FLAG="$(INC_FLAG)"
                @echo N=$(N)

test: $(INC)
                @echo INC="$(INC)"
                @echo INC="$^"

%: ;
--------------

Actual result:
--------------
INC="aa/hdr bb/hdr cc\ mgr/hdr"
INC="aa/hdr bb/hdr cc mgr/hdr"
INC_FLAG="-Iaa/hdr -Ibb/hdr -Icc\ -Imgr/hdr"
N=4
--------------

Expected result:
--------------
INC="aa/hdr bb/hdr cc\ mgr/hdr"
INC="aa/hdr bb/hdr cc\ mgr/hdr"
INC_FLAG="-Iaa/hdr -Ibb/hdr -Icc\ mgr/hdr"
N=3
--------------

Bug1: most internal function cannot deal with space that is escaped in the word.
Bug2: $^ loses the back-slash.

Best Regards

Liang, Jian

_______________________________________________
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make

Reply via email to