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

9 vuotta sitten
9 vuotta sitten
9 vuotta sitten
9 vuotta sitten
9 vuotta sitten
9 vuotta sitten
9 vuotta sitten
9 vuotta sitten
9 vuotta sitten
9 vuotta sitten
9 vuotta sitten
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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. test_shs = test_shrc test_profile
  16. test_sh: $(test_shs)
  17. setups = setup_darwin setup_directories setup_emacs
  18. setup: $(setups)
  19. setup_darwins = setup_darwin_defaults setup_darwin_daemon
  20. setup_darwin: $(setup_darwins)
  21. setup_directories = $(localdir) $(vardir) $(bindir)
  22. setup_directory = $(setup_directories)
  23. .PHONY: all default test $(tests) $(test_shs) \
  24. setup $(setups) $(setup_darwins) emacs
  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