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.

Makefile 2.0 KiB

10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. all: default
  13. tests = test-el test-sh
  14. test: $(tests)
  15. setups = setup-darwin setup-directories setup-emacs
  16. setup: $(setups)
  17. .PHONY: all default test $(tests) setup $(setups)
  18. # setups
  19. # ======
  20. # create directories
  21. # ------------------
  22. setup_directories = $(localdir) $(vardir) $(bindir)
  23. setup-directory: $(setup_directories)
  24. $(localdir) $(vardir) $(bindir):
  25. mkdir -vp $@
  26. # darwin
  27. # ------
  28. setup_darwins = setup-darwin-defaults setup-darwin-daemon
  29. setup-darwin: $(setup_darwins)
  30. .PHONY: $(setup_darwins)
  31. setup-darwin-defaults:
  32. # http://appdrill.net/60641/mac-boot-mute.html
  33. #sudo nvram SystemAudioVolume=%80
  34. # add quit entry in menu
  35. defaults write com.apple.finder QuitMenuItem -bool YES
  36. # show full path on titlebar
  37. defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES
  38. # do not show desktop icons
  39. defaults write com.apple.finder CreateDesktop -boolean false
  40. killall Finder
  41. # disable dashboard
  42. #defaults write com.apple.dashboard mcx-disabled -bool YES
  43. setup-darwin-daemon:
  44. test "`launchctl getenv LC_ALL`" = C || sudo launchctl setenv LC_ALL C
  45. if ! (launchctl list | grep com.apple.locate) >/dev/null ;\
  46. then \
  47. sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist ;\
  48. fi
  49. # emacs setup
  50. # -----------
  51. setup-emacs: emacs.el
  52. $(emacs) -q --debug-init --batch --load $< -f my-auto-install-package
  53. # test
  54. # ====
  55. test_shs = test-shrc test-profile test-setup.sh test-xinitrc test-xprograms
  56. test-sh: $(test_shs)
  57. .PHONY: $(test_shs)
  58. $(test_shs): test-%: %
  59. sh -ec 'for sh in $(shrc_loadables); do $$sh -n $<; done'
  60. test-el: emacs.el
  61. EMACS_EL_DRY_RUN=t $(emacs) -q --debug-init --batch \
  62. --eval "(setq debug-on-error t)" --load $< --kill