Skip to content

Instantly share code, notes, and snippets.

@mgor
Created May 30, 2016 08:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mgor/f6905dd43201cceec399830cd07acd3b to your computer and use it in GitHub Desktop.
Save mgor/f6905dd43201cceec399830cd07acd3b to your computer and use it in GitHub Desktop.
.PHONY = all install reinstall uninstall test _wrapped_stow _pre_stow _stow _post_stow _stow_ignore _install_args _reinstall_args _uninstall_args _test_args
all:
$(error You probably want to run 'make test' first)
_stow_ignore:
$(foreach file,$(wildcard *),$(eval ARGS += --ignore=$(file)))
_stow: _stow_ignore
@stow -t $(HOME) -v $(ARGS) .
_pre_stow:
@true
_post_stow:
@true
_install_args:
$(eval ARGS := -S)
_reinstall_args:
$(eval ARGS := -R)
_uninstall_args:
$(eval ARGS := -D)
_test_args:
$(eval ARGS := -n -S)
_wrapped_stow: _pre_stow _stow _post_stow
install: _install_args _wrapped_stow
uninstall: _uninstall_args _wrapped_stow
reinstall: _reinstall_args _wrapped_stow
test: _test_args _stow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment