Created
June 3, 2015 12:21
-
-
Save chadrien/edd9167f5325821aaec5 to your computer and use it in GitHub Desktop.
Revisions
-
chadrien created this gist
Jun 3, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ SUPPORTED_COMMANDS := command1 command2 SUPPORTS_MAKE_ARGS := $(findstring $(firstword $(MAKECMDGOALS)), $(SUPPORTED_COMMANDS)) ifneq "$(SUPPORTS_MAKE_ARGS)" "" # use the rest as arguments for the command COMMAND_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS)) # ...and turn them into do-nothing targets $(eval $(COMMAND_ARGS):;@:) endif command1: @command1 $(COMMAND_ARGS) command2: @command2 --option1 --option2=foo $(COMMAND_ARGS)