Makefile 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. # vim: set sw=2 ts=2 sts=2 et tw=80 fmr={{{,}}} fdl=0 fdm=marker:
  2. # dotfiles setup. Run `make install` to perform all setup tasks.
  3. # Groups of targets
  4. all = git bash zsh tmux ack vimperator vim
  5. rm-all = rm-git rm-bash rm-zsh rm-tmux rm-ack rm-vimperator rm-vim
  6. # Auto-Documenting Section. Displays a target list with `##` descriptions.
  7. help:
  8. @echo "Available tasks:"
  9. @grep -E '^[a-zA-Z_-]+:.*## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "%-16s %s\n", $$1, $$2}'
  10. @echo ""
  11. @echo "Individual setup tasks:"
  12. @echo "$(all)"
  13. .PHONY: help uninstall install $(all) $(rm-all)
  14. install: prep $(all) ## Set up all configurations.
  15. @echo "Install complete!"
  16. uninstall: $(rm-all) ## Remove all configurations.
  17. @echo "Uninstalled!"
  18. show-versions: ## List versions of installed software.
  19. @./bin/show-versions
  20. # Setup Tasks {{{
  21. prep:
  22. @mkdir -p $(XDG_CONFIG_HOME)
  23. XDG_CONFIG_HOME ?= $(HOME)/.config
  24. submodules:
  25. @cd ~/dotfiles && git submodule sync && git submodule update --init
  26. git:
  27. git config --global color.ui true
  28. git config --global core.editor vim
  29. git config --global core.excludesFile ~/dotfiles/git/globalignore
  30. git config --global diff.mnemonicPrefix true
  31. rm-git:
  32. git config --global --unset color.ui true
  33. git config --global --unset core.editor vim
  34. git config --global --unset core.excludesFile ".*/dotfiles/git/globalignore"
  35. git config --global --unset diff.mnemonicPrefix true
  36. bash:
  37. @./bin/linkup ~/dotfiles/shell/bash_profile ~/.bash_profile
  38. @./bin/linkup ~/dotfiles/shell/bashrc ~/.bashrc
  39. rm-bash:
  40. rm ~/.bash_profile
  41. rm ~/.bashrc
  42. zsh:
  43. @./bin/linkup ~/dotfiles/shell/env ~/.zshenv
  44. @./bin/linkup ~/dotfiles/shell/zshrc ~/.zshrc
  45. rm-zsh:
  46. rm ~/.zshenv
  47. rm ~/.zshrc
  48. tmux: submodules
  49. @./bin/linkup ~/dotfiles/tmux/tmux.conf ~/.tmux.conf
  50. rm-tmux:
  51. rm ~/.tmux.conf
  52. ack:
  53. @./bin/linkup ~/dotfiles/ack/ackrc ~/.ackrc
  54. rm-ack:
  55. rm ~/.ackrc
  56. vimperator:
  57. @./bin/linkup ~/dotfiles/vimperator ~/.vimperator
  58. @./bin/linkup ~/dotfiles/vimperator/vimperatorrc ~/.vimperatorrc
  59. rm-vimperator:
  60. rm ~/.vimperator
  61. rm ~/.vimperatorrc
  62. vim:
  63. @./bin/linkup ~/dotfiles/vim ~/.vim
  64. @./bin/linkup ~/dotfiles/vim/vimrc ~/.vimrc
  65. @./bin/linkup ~/dotfiles/vim $(XDG_CONFIG_HOME)/nvim
  66. @# Use barebones config to avoid vimrc errors on fresh dotfiles installs.
  67. @vim -N -u ~/dotfiles/vim/plugins.vim +PlugClean! +PlugUpdate! +quitall!
  68. rm-vim:
  69. rm ~/.vim
  70. rm ~/.vimrc
  71. rm $(XDG_CONFIG_HOME)/nvim
  72. # }}}