Skip to content

Instantly share code, notes, and snippets.

@sebastienliu
Last active September 10, 2018 02:21
Show Gist options
  • Save sebastienliu/61a21d53b1a6078d1d62edfaa7515e1a to your computer and use it in GitHub Desktop.
Save sebastienliu/61a21d53b1a6078d1d62edfaa7515e1a to your computer and use it in GitHub Desktop.
Launch shell commands in Makefile
FILENAME_AND_PATH="./foo.txt"
filename_only=$(basename $(FILENAME_AND_PATH))
.PHONY: foo_a
foo_a:
$(eval filename_only := $(shell basename $(FILENAME_AND_PATH)))
@echo filename_only=[$(filename_only)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment