Skip to content

Instantly share code, notes, and snippets.

@jroehl
Created February 16, 2018 10:26
Show Gist options
  • Save jroehl/497f919a5466c4bb90f8bd55a47d149f to your computer and use it in GitHub Desktop.
Save jroehl/497f919a5466c4bb90f8bd55a47d149f to your computer and use it in GitHub Desktop.
Run a (remote) make file with arguments (make run [target] ...args)
.PHONY: run
SHELL := /bin/bash
# If the first argument is "run"
ifeq (run,$(firstword $(MAKECMDGOALS)))
# use the rest as arguments for "run"
RUN_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
# turn them into blank targets
$(eval $(RUN_ARGS):;@:)
endif
REMOTE_MAKEFILE = https://gist.github.com/jroehl/9fc3c4f689e8ec8923c194339c724cee/raw/Makefile
run:
make -f <(curl -sL $(REMOTE_MAKEFILE)) $(RUN_ARGS)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment