Makefile 2.5 KB

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