Skip to content

Instantly share code, notes, and snippets.

View Julio-Guerra's full-sized avatar
👾

Julio Guerra Julio-Guerra

👾
View GitHub Profile
@chadrien
chadrien / Makefile
Created June 3, 2015 12:21
Proxy commands in Makefile (useful for docker for instance)
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: