I have a Makefile, to which I have added the following two targets that run Symfony commands inside a Docker container:
amqp-poll: ## Start amqp polling
@$(DOCKER_COMPOSE) exec -it $(SERVICE_CONTAINER) /bin/bash -c "php /code/backend/app-new/console amqp:poll"
amqp-purge: ## Purge amqp queues
@$(DOCKER_COMPOSE) exec -it $(SERVICE_CONTAINER) /bin/bash -c "php /code/backend/app-new/console amqp:poll --purge"
Is it possible to pass in a flag so that I am, for example, running make amqp-poll --purge
rather than make amqp-purge
?
In other words, I would like to merge these two targets, with the use of a double-dash flag selectively triggering the logic in the second target.
(I looked into ifdef
, but it looks like that requires a value, right? I'm more interested in a simple flag.)
Is this possible?