You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

99 lines
2.0 KiB

  1. home ?= $(HOME)
  2. dotfiles_dir ?= $(home)/10sr_dotfiles
  3. dotfiles_url_base=https://raw.githubusercontent.com/10sr/dotfiles/master/
  4. localdir = $(home)/.local
  5. vardir = $(home)/.var
  6. bindir = $(localdir)/bin
  7. current = $(shell date)
  8. ostype = $(shell uname)
  9. shrc_loadables = sh bash zsh
  10. shrc_common_tpl =
  11. emacs ?= emacs
  12. tests = test_el test_sh
  13. test: $(tests)
  14. test_shs = test_shrc test_profile
  15. test_sh: $(test_shs)
  16. setups = setup_darwin setup_directories setup_emacs
  17. setup: $(setups)
  18. setup_darwins = setup_darwin_defaults setup_darwin_daemon
  19. setup_darwin: $(setup_darwins)
  20. setup_directories = $(localdir) $(vardir) $(bindir)
  21. setup_directory = $(setup_directories)
  22. .PHONY: all default test $(tests) $(test_shs) \
  23. setup $(setups) $(setup_darwins) emacs
  24. all: default
  25. # setups
  26. # ======
  27. # create directories
  28. # ------------------
  29. $(localdir) $(vardir) $(bindir):
  30. mkdir -vp $@
  31. # darwin
  32. # ------
  33. setup_darwin_defaults:
  34. # http://appdrill.net/60641/mac-boot-mute.html
  35. #sudo nvram SystemAudioVolume=%80
  36. # add quit entry in menu
  37. defaults write com.apple.finder QuitMenuItem -bool YES
  38. # show full path on titlebar
  39. defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES
  40. # do not show desktop icons
  41. defaults write com.apple.finder CreateDesktop -boolean false
  42. killall Finder
  43. # disable dashboard
  44. #defaults write com.apple.dashboard mcx-disabled -bool YES
  45. setup_darwin_daemon:
  46. test "`launchctl getenv LC_ALL`" = C || sudo launchctl setenv LC_ALL C
  47. if ! (launchctl list | grep com.apple.locate) >/dev/null ;\
  48. then \
  49. sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist ;\
  50. fi
  51. # emacs setup
  52. # -----------
  53. setup_emacs: emacs.el
  54. $(emacs) -q --debug-init --batch --load $< -f my-auto-install-package
  55. # test
  56. # ====
  57. test_profile: profile
  58. sh -exc 'for sh in $(shrc_loadables); do $$sh -n $<; done'
  59. test_shrc: shrc
  60. sh -exc 'for sh in $(shrc_loadables); do $$sh -n $<; done'
  61. test_el: emacs.el
  62. $(emacs) -q --debug-init --batch --eval "(setq debug-on-error t)" \
  63. --load $< --kill