With export AWS_PROFILE :=
$ cat Makefile
.PHONY: test
export AWS_PROFILE := acme
export AWS_REGION := us-west-2
test:
@echo "AWS_PROFILE=$(AWS_PROFILE) (origin: $(origin AWS_PROFILE))"
@echo "AWS_REGION=$(AWS_REGION) (origin: $(origin AWS_REGION))"
$ make
AWS_PROFILE=acme (origin: file)
AWS_REGION=us-west-2 (origin: file)
$ make AWS_PROFILE=hoge
AWS_PROFILE=hoge (origin: command line)
AWS_REGION=us-west-2 (origin: file)
$ AWS_PROFILE=fuga make
AWS_PROFILE=acme (origin: file)
AWS_REGION=us-west-2 (origin: file)
$ (export AWS_PROFILE=vaa && make)
AWS_PROFILE=acme (origin: file)
AWS_REGION=us-west-2 (origin: file)
With export AWS_PROFILE ?=
$ cat Makefile
.PHONY: test
export AWS_PROFILE ?= acme
export AWS_REGION ?= us-west-2
test:
@echo "AWS_PROFILE=$(AWS_PROFILE) (origin: $(origin AWS_PROFILE))"
@echo "AWS_REGION=$(AWS_REGION) (origin: $(origin AWS_REGION))"
$ make
AWS_PROFILE=acme (origin: file)
AWS_REGION=us-west-2 (origin: file)
$ make AWS_PROFILE=hoge
AWS_PROFILE=hoge (origin: command line)
AWS_REGION=us-west-2 (origin: file)
$ AWS_PROFILE=fuga make
AWS_PROFILE=fuga (origin: environment)
AWS_REGION=us-west-2 (origin: file)
$ (export AWS_PROFILE=vaa && make)
AWS_PROFILE=vaa (origin: environment)
AWS_REGION=us-west-2 (origin: file)
With export AWS_PROFILE =
$ cat Makefile
.PHONY: test
export AWS_PROFILE = acme
export AWS_REGION = us-west-2
test:
@echo "AWS_PROFILE=$(AWS_PROFILE) (origin: $(origin AWS_PROFILE))"
@echo "AWS_REGION=$(AWS_REGION) (origin: $(origin AWS_REGION))"
$ make
AWS_PROFILE=acme (origin: file)
AWS_REGION=us-west-2 (origin: file)
$ make AWS_PROFILE=hoge
AWS_PROFILE=hoge (origin: command line)
AWS_REGION=us-west-2 (origin: file)
$ AWS_PROFILE=fuga make
AWS_PROFILE=acme (origin: file)
AWS_REGION=us-west-2 (origin: file)
$ (export AWS_PROFILE=vaa && make)
AWS_PROFILE=acme (origin: file)
AWS_REGION=us-west-2 (origin: file)