Example using makefile with ansible(but question is for any command):
deploy:
ansible-playbook ansible/playbook-deploy.yml \
-i ansible/environments/$(ENV)/inventory \
-e "$(ARGS)" \
--tags="$(TAGS)" \
--skip-tags="$(SKIP_TAGS)" \
$2 2>&1 | tee -a ${LOG_PATH}
Now I want to skip adding -e , --tags, --skip-tags flags if the variables are correspondingly empty ARGS/TAGS/SKIP_TAGS
Something like this will not work
ifdef ARGS -e "$(ARGS)" \ endif
I am begginer to makefiles so errors are expected, so please advise me for resources how to implement this case, thanks
I don't want to add \ then in next line --tags=... if TAGS variable is not defined, same for the others