Created
February 16, 2018 10:26
-
-
Save jroehl/497f919a5466c4bb90f8bd55a47d149f to your computer and use it in GitHub Desktop.
Run a (remote) make file with arguments (make run [target] ...args)
This file contains 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 characters
.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