Makefile 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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 install uninstall upgrade show-versions $(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. upgrade: ## Update external files to latest versions.
  19. @./bin/dotfiles-upgrade
  20. show-versions: ## List versions of installed software.
  21. @./bin/show-versions
  22. # Setup Tasks {{{
  23. prep:
  24. @mkdir -p $(XDG_CONFIG_HOME)
  25. XDG_CONFIG_HOME ?= $(HOME)/.config
  26. submodules:
  27. @cd ~/dotfiles && git submodule sync && git submodule update --init
  28. git:
  29. git config --global color.ui true
  30. git config --global core.editor vim
  31. git config --global core.excludesFile ~/dotfiles/git/globalignore
  32. git config --global diff.mnemonicPrefix true
  33. rm-git:
  34. git config --global --unset color.ui true
  35. git config --global --unset core.editor vim
  36. git config --global --unset core.excludesFile ".*/dotfiles/git/globalignore"
  37. git config --global --unset diff.mnemonicPrefix true
  38. bash:
  39. @./bin/linkup ~/dotfiles/shell/bash_profile ~/.bash_profile
  40. @./bin/linkup ~/dotfiles/shell/bashrc ~/.bashrc
  41. rm-bash:
  42. rm ~/.bash_profile
  43. rm ~/.bashrc
  44. zsh:
  45. @./bin/linkup ~/dotfiles/shell/env ~/.zshenv
  46. @./bin/linkup ~/dotfiles/shell/zshrc ~/.zshrc
  47. rm-zsh:
  48. rm ~/.zshenv
  49. rm ~/.zshrc
  50. tmux: submodules
  51. @./bin/linkup ~/dotfiles/tmux/tmux.conf ~/.tmux.conf
  52. rm-tmux:
  53. rm ~/.tmux.conf
  54. ack:
  55. @./bin/linkup ~/dotfiles/ack/ackrc ~/.ackrc
  56. rm-ack:
  57. rm ~/.ackrc
  58. vimperator:
  59. @./bin/linkup ~/dotfiles/vimperator ~/.vimperator
  60. @./bin/linkup ~/dotfiles/vimperator/vimperatorrc ~/.vimperatorrc
  61. rm-vimperator:
  62. rm ~/.vimperator
  63. rm ~/.vimperatorrc
  64. vim:
  65. @./bin/linkup ~/dotfiles/vim ~/.vim
  66. @./bin/linkup ~/dotfiles/vim/vimrc ~/.vimrc
  67. @./bin/linkup ~/dotfiles/vim $(XDG_CONFIG_HOME)/nvim
  68. @# Use barebones config to avoid vimrc errors on fresh dotfiles installs.
  69. @vim -N -u ~/dotfiles/vim/plugins.vim +PlugClean! +PlugUpdate! +quitall!
  70. rm-vim:
  71. rm ~/.vim
  72. rm ~/.vimrc
  73. rm $(XDG_CONFIG_HOME)/nvim
  74. # }}}