Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'override' to all accumulating variables #1207

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

martin-g
Copy link

@martin-g martin-g commented May 9, 2024

Without override the extra values are not appended if the variable is provided by the user, e.g. make CFLAGS="my custom flags"

I didn't add override to OBJS because I think it is not supposed to be provided by the user anyway.

Without 'override' the extra values are not appended if the variable is
provided by the user, e.g. `make CFLAGS="my custom flags"`

Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
@martin-g
Copy link
Author

martin-g commented May 9, 2024

Here is a mini reproducer:

Makefile.demo:

FOO=foo

.PHONY:all

override FOO+=bar

all:
        echo $(FOO)

Execute without a custom value:

make -f Makefile.demo
echo foo bar
foo bar

Execute with a custom value:

make -f Makefile.mine FOO=baz
echo baz bar
baz bar

Without override in override FOO+=bar it will be:

make -f Makefile.mine FOO=baz
echo baz
baz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant