I found an example here showing how to implement the OR logic to check for different values for a flag.
But I just want to pass a single param without values (start
, not start=yes
) to 2 make commands: run
and run_whatever
(example names)
For the run
command I am using:
ifeq (run,$(firstword $(MAKECMDGOALS)))
# use the rest as arguments for "run"
RUN_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
# ...and turn them into do-nothing targets
$(eval $(RUN_ARGS):;@:)
endif
And
run:
./myprogram $(RUN_ARGS)
And I want to extend the ifeq condition to support:
run_whatever:
./myotherprogram $(RUN_ARGS)
And call them like: make run start
, make run_whatever start