Skip to content

Multi-word MAKEFLAGS doesn't work properly #89

Open

Description

@danw

We ran into this issue when upgrading Kati on AOSP, but I've solved this on our side separately by clearing MAKEFLAGS, since we don't want the MAKEFLAGS override behavior and the variables are already available in the environment.

Simple shell testcase to drop into testcase/cmdline_var_spaces.sh:

set -e

mk="$@"

cat <<EOF > Makefile
ifdef SUBMAKE
all:
       +@\$(SUBMAKE) SUBMAKE=
else
CLVAR := FAIL
CLVAR_RESULT := FAIL
ifeq (\$(CLVAR),multi word)
CLVAR_RESULT := PASS
endif
all:
       @echo \$(CLVAR_RESULT) \$(CLVAR) \$(origin CLVAR)
endif
EOF

make SUBMAKE="${mk}" CLVAR='multi word' 2> /dev/null

Which prints out:

(make)  PASS multi word command line
(ckati) FAIL multi command line

If you print out $(MAKEFLAGS), the makeflags is written as:

CLVAR=multi\ word SUBMAKE=../../ckati\ SHELL=/bin/bash

So kati's MAKEFLAGS parsing needs to handle the escaped spaces (I'm not sure if anything else can be escaped)

Activity

  1. added a commit that references this issue on Nov 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions