$ cat Makefile
.PHONY: all
export AWS_PROFILE ?= acme
AWS_REGION ?= us-west-2
all:
@echo AWS_PROFILE=$(origin AWS_PROFILE)
@echo AWS_REGION=$(origin AWS_REGION)
bash test.sh
$ cat test.sh
#!/bin/bash
echo AWS_PROFILE=$AWS_PROFILE
echo AWS_REGION=$AWS_REGION
$ make
AWS_PROFILE=file
AWS_REGION=file
bash test.sh
AWS_PROFILE=acme
AWS_REGION=
$ make AWS_PROFILE=hoge AWS_REGION=fuga
AWS_PROFILE=command line
AWS_REGION=command line
bash test.sh
AWS_PROFILE=hoge
AWS_REGION=fuga
Created
December 11, 2023 06:05
-
-
Save tamakiii/e800a37c356a36cffe766cd60c185df2 to your computer and use it in GitHub Desktop.
Variable and Environment Variable in GNU Make
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment