Makefile 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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 tridactyl vim
  5. rm-all = rm-git rm-bash rm-zsh rm-tmux rm-ack rm-vimperator rm-tridactyl 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. @grep -E '^[a-zA-Z_-]+:.*## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "* %-16s %s\n", $$1, $$2}'
  11. @echo ""
  12. @echo "Individual setup tasks:"
  13. @echo "$(all)"
  14. install: $(all) ## Set up all configuration files.
  15. @echo "Install complete!"
  16. uninstall: $(rm-all) ## Remove all configuration files.
  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. submodules:
  24. @cd ~/dotfiles && git submodule sync && git submodule update --init
  25. xdg:
  26. @mkdir -p $(XDG_CONFIG_HOME)
  27. XDG_CONFIG_HOME ?= $(HOME)/.config
  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. tridactyl:
  65. @./bin/linkup ~/dotfiles/tridactyl/tridactylrc ~/.tridactylrc
  66. rm-tridactyl:
  67. rm ~/.tridactylrc
  68. vim: xdg
  69. @./bin/linkup ~/dotfiles/vim ~/.vim
  70. @./bin/linkup ~/dotfiles/vim/vimrc ~/.vimrc
  71. @./bin/linkup ~/dotfiles/vim $(XDG_CONFIG_HOME)/nvim
  72. @# Use barebones config to avoid vimrc errors on fresh dotfiles installs.
  73. @vim -N -u ~/dotfiles/vim/plugins.vim +PlugClean! +PlugUpdate! +quitall!
  74. rm-vim:
  75. rm ~/.vim
  76. rm ~/.vimrc
  77. rm $(XDG_CONFIG_HOME)/nvim
  78. # }}}