Skip to content

Instantly share code, notes, and snippets.

@shinypb
Created April 12, 2016 20:16
Show Gist options
  • Save shinypb/a2aad926e4e8a42f8b61cbcc808904d4 to your computer and use it in GitHub Desktop.
Save shinypb/a2aad926e4e8a42f8b61cbcc808904d4 to your computer and use it in GitHub Desktop.
Makefile with example install_deps task
#
# To use this Makefile with your version of magic-cli, change the value of
# PREFIX to whatever you have renamed the main command to.
#
PREFIX = magic-cli
#
# Where to install the tools
#
DESTINATION_DIR = /usr/local/bin
#
# Files to install
#
FILES = \
${PREFIX} \
${PREFIX}-*
#
# Rules
#
install: install_quiet announce_installation
announce_installation:
@echo "OK, ${PREFIX} command line tools have been installed. 🎉 Here's what's available:\n" && ${PREFIX} --list
install_quiet: install_deps install_tools
install_deps:
sudo gem install foogem
install_tools:
@install -m 755 -p $(FILES) ${DESTINATION_DIR}
uninstall:
sh -c "cd ${DESTINATION_DIR} && rm ${PREFIX} && rm ${PREFIX}-*"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment