PageRenderTime 59ms CodeModel.GetById 33ms RepoModel.GetById 1ms app.codeStats 0ms

/plugins/back-button/Makefile

https://github.com/rsuhada/.emacs.d
Makefile | 173 lines | 136 code | 25 blank | 12 comment | 19 complexity | 4c6b4ec3bb0c1ced252d9c6566a6c03a MD5 | raw file
  1. EMACS=emacs
  2. # EMACS=/Applications/Emacs.app/Contents/MacOS/Emacs
  3. # EMACS=/Applications/Emacs23.app/Contents/MacOS/Emacs
  4. # EMACS=/Applications/Aquamacs.app/Contents/MacOS/Aquamacs
  5. # EMACS=/Applications/Macmacs.app/Contents/MacOS/Emacs
  6. # EMACS=/usr/local/bin/emacs
  7. # EMACS=/opt/local/bin/emacs
  8. # EMACS=/usr/bin/emacs
  9. INTERACTIVE_EMACS=/usr/local/bin/emacs
  10. # can't find an OS X variant that works correctly for interactive tests:
  11. # INTERACTIVE_EMACS=open -a Emacs.app --new --args
  12. # INTERACTIVE_EMACS=/Applications/Emacs.app/Contents/MacOS/Emacs
  13. # INTERACTIVE_EMACS=/Applications/Emacs.app/Contents/MacOS/bin/emacs
  14. RESOLVED_EMACS=$(shell readlink `which $(EMACS)` || echo "$(EMACS)")
  15. RESOLVED_INTERACTIVE_EMACS=$(shell readlink `which "$(INTERACTIVE_EMACS)"` || echo "$(INTERACTIVE_EMACS)")
  16. EMACS_CLEAN=-Q
  17. EMACS_BATCH=$(EMACS_CLEAN) --batch
  18. # TESTS can be overridden to specify a subset of tests
  19. TESTS=
  20. WIKI_USERNAME=roland.walker
  21. CURL=curl --silent
  22. EDITOR=runemacs -no_wait
  23. WORK_DIR=$(shell pwd)
  24. PACKAGE_NAME=$(shell basename $(WORK_DIR))
  25. PACKAGE_VERSION=$(shell perl -ne 'print "$$1\n" if m{^;+ *Version: *(\S+)}' $(PACKAGE_NAME).el)
  26. AUTOLOADS_FILE=$(PACKAGE_NAME)-autoloads.el
  27. TRAVIS_FILE=.travis.yml
  28. TEST_DIR=ert-tests
  29. TEST_DEP_1=ert
  30. TEST_DEP_1_STABLE_URL=http://bzr.savannah.gnu.org/lh/emacs/emacs-24/download/head:/ert.el-20110112160650-056hnl9qhpjvjicy-2/ert.el
  31. TEST_DEP_1_LATEST_URL=https://raw.github.com/emacsmirror/emacs/master/lisp/emacs-lisp/ert.el
  32. .PHONY : build dist not-dirty pkg-version downloads downloads-latest autoloads \
  33. test-autoloads test-travis test test-prep test-batch test-interactive \
  34. test-tests clean edit run-pristine run-pristine-local upload-github \
  35. upload-wiki upload-marmalade test-dep-1 test-dep-2 test-dep-3 test-dep-4 \
  36. test-dep-5 test-dep-6 test-dep-7 test-dep-8 test-dep-9
  37. build :
  38. $(RESOLVED_EMACS) $(EMACS_BATCH) --eval \
  39. "(progn \
  40. (setq byte-compile-error-on-warn t) \
  41. (batch-byte-compile))" *.el
  42. not-dirty :
  43. @git diff --quiet '$(PACKAGE_NAME).el' || \
  44. ( git --no-pager diff '$(PACKAGE_NAME).el'; \
  45. echo "Uncommitted edits - do a git stash"; \
  46. false )
  47. pkg-version :
  48. @test -n '$(PACKAGE_VERSION)' || \
  49. ( echo "No package version"; false )
  50. test-dep-1 :
  51. @cd '$(TEST_DIR)' && \
  52. $(RESOLVED_EMACS) $(EMACS_BATCH) -L . -L .. -l '$(TEST_DEP_1)' || \
  53. (echo "Can't load test dependency $(TEST_DEP_1).el, run 'make downloads' to fetch it" ; exit 1)
  54. downloads :
  55. $(CURL) '$(TEST_DEP_1_STABLE_URL)' > '$(TEST_DIR)/$(TEST_DEP_1).el'
  56. downloads-latest :
  57. $(CURL) '$(TEST_DEP_1_LATEST_URL)' > '$(TEST_DIR)/$(TEST_DEP_1).el'
  58. autoloads :
  59. $(RESOLVED_EMACS) $(EMACS_BATCH) --eval \
  60. "(progn \
  61. (setq generated-autoload-file \"$(WORK_DIR)/$(AUTOLOADS_FILE)\") \
  62. (update-directory-autoloads \"$(WORK_DIR)\"))"
  63. test-autoloads : autoloads
  64. @$(RESOLVED_EMACS) $(EMACS_BATCH) -L . -l './$(AUTOLOADS_FILE)' || \
  65. ( echo "failed to load autoloads: $(AUTOLOADS_FILE)" && false )
  66. test-travis :
  67. @if test -z "$$TRAVIS" && test -e '$(TRAVIS_FILE)'; then travis-lint '$(TRAVIS_FILE)'; fi
  68. test-tests :
  69. @perl -ne 'if (m/^\s*\(\s*ert-deftest\s*(\S+)/) {die "$$1 test name duplicated in $$ARGV\n" if $$dupes{$$1}++}' '$(TEST_DIR)/'*-test.el
  70. test-prep : build test-dep-1 test-autoloads test-travis test-tests
  71. test-batch :
  72. @cd '$(TEST_DIR)' && \
  73. (for test_lib in *-test.el; do \
  74. $(RESOLVED_EMACS) $(EMACS_BATCH) -L . -L .. -l cl \
  75. -l '$(TEST_DEP_1)' -l "$$test_lib" --eval \
  76. "(flet ((ert--print-backtrace (&rest args) \
  77. (insert \"no backtrace in batch mode\"))) \
  78. (ert-run-tests-batch-and-exit '(and \"$(TESTS)\" (not (tag :interactive)))))" || exit 1; \
  79. done)
  80. test-interactive : test-prep
  81. @cd '$(TEST_DIR)' && \
  82. (for test_lib in *-test.el; do \
  83. $(RESOLVED_INTERACTIVE_EMACS) $(EMACS_CLEAN) --eval \
  84. "(progn \
  85. (cd \"$(WORK_DIR)/$(TEST_DIR)\") \
  86. (setq dired-use-ls-dired nil) \
  87. (setq frame-title-format \"TEST SESSION $$test_lib\") \
  88. (setq enable-local-variables :safe))" \
  89. -L . -L .. -l cl -l '$(TEST_DEP_1)' -l "$$test_lib" \
  90. --visit "$$test_lib" --eval \
  91. "(progn \
  92. (when (> (length \"$(TESTS)\") 0) \
  93. (push \"\\\"$(TESTS)\\\"\" ert--selector-history)) \
  94. (setq buffer-read-only t) \
  95. (setq cursor-in-echo-area t) \
  96. (call-interactively 'ert-run-tests-interactively) \
  97. (ding) \
  98. (when (y-or-n-p \"PRESS Y TO QUIT THIS TEST SESSION\") \
  99. (with-current-buffer \"*ert*\" \
  100. (kill-emacs \
  101. (if (re-search-forward \"^Failed:[^\\n]+unexpected\" 500 t) 1 0)))))" || exit 1; \
  102. done)
  103. test : test-prep test-batch
  104. run-pristine :
  105. @cd '$(TEST_DIR)' && \
  106. $(RESOLVED_EMACS) $(EMACS_CLEAN) --eval \
  107. "(progn \
  108. (setq package-enable-at-startup nil) \
  109. (setq package-load-list nil) \
  110. (when (fboundp 'package-initialize) \
  111. (package-initialize)) \
  112. (cd \"$(WORK_DIR)/$(TEST_DIR)\") \
  113. (setq dired-use-ls-dired nil) \
  114. (setq frame-title-format \"PRISTINE SESSION $(PACKAGE_NAME)\") \
  115. (setq enable-local-variables :safe))" \
  116. -L .. -l '$(PACKAGE_NAME)' .
  117. run-pristine-local :
  118. @cd '$(TEST_DIR)' && \
  119. $(RESOLVED_EMACS) $(EMACS_CLEAN) --eval \
  120. "(progn \
  121. (cd \"$(WORK_DIR)/$(TEST_DIR)\") \
  122. (setq dired-use-ls-dired nil) \
  123. (setq frame-title-format \"PRISTINE-LOCAL SESSION $(PACKAGE_NAME)\") \
  124. (setq enable-local-variables :safe))" \
  125. -L . -L .. -l '$(PACKAGE_NAME)' .
  126. clean :
  127. @rm -f '$(AUTOLOADS_FILE)' *.elc *~ */*.elc */*~ .DS_Store */.DS_Store *.bak */*.bak && \
  128. cd '$(TEST_DIR)' && \
  129. rm -f './$(TEST_DEP_1).el' './$(TEST_DEP_2).el' './$(TEST_DEP_3).el' './$(TEST_DEP_4).el' './$(TEST_DEP_5a).el' \
  130. './$(TEST_DEP_5).el' './$(TEST_DEP_6).el' './$(TEST_DEP_7).el' './$(TEST_DEP_8).el' './$(TEST_DEP_9).el'
  131. edit :
  132. @$(EDITOR) `git ls-files`
  133. upload-github :
  134. @git push origin master
  135. upload-wiki : not-dirty
  136. @$(RESOLVED_EMACS) $(EMACS_BATCH) --eval \
  137. "(progn \
  138. (setq package-load-list '((yaoddmuse t))) \
  139. (when (fboundp 'package-initialize) \
  140. (package-initialize)) \
  141. (require 'yaoddmuse) \
  142. (setq yaoddmuse-username \"$(WIKI_USERNAME)\") \
  143. (yaoddmuse-post-file \
  144. \"$(PACKAGE_NAME).el\" \
  145. yaoddmuse-default-wiki \
  146. \"$(PACKAGE_NAME).el\" \
  147. \"updated version\") \
  148. (sleep-for 5))"