Klimi's new dotfiles with stow.
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.

97 rivejä
2.3 KiB

5 vuotta sitten
  1. EMACS ?= emacs
  2. # Handle the mess when inside Emacs.
  3. unexport INSIDE_EMACS #cask not like this.
  4. ifeq ($(EMACS), t)
  5. EMACS = emacs
  6. endif
  7. emacs = $(EMACS)
  8. emacs_version = $(shell $(emacs) --batch --eval \
  9. '(princ (format "%s.%s" emacs-major-version emacs-minor-version))')
  10. $(info Using Emacs $(emacs_version))
  11. version=$(shell sed -ne 's/^;\+ *Version: *\([0-9.]\)/\1/p' lisp/pdf-tools.el)
  12. pkgname=pdf-tools-$(version)
  13. pkgfile=$(pkgname).tar
  14. .PHONY: all clean distclean bytecompile test check melpa cask-install
  15. all: $(pkgfile)
  16. # Create a elpa package including the server
  17. $(pkgfile): .cask/$(emacs_version) server/epdfinfo lisp/*.el
  18. cask package .
  19. # Compile the Lisp sources
  20. bytecompile: .cask/$(emacs_version)
  21. cask exec $(emacs) --batch -L lisp -f batch-byte-compile lisp/*.el
  22. # Run ERT tests
  23. test: all
  24. PACKAGE_TAR=$(pkgfile) cask exec ert-runner
  25. check: test
  26. # Run the autobuild script tests in docker
  27. test-autobuild: server-test
  28. # Run all tests
  29. test-all: test test-autobuild
  30. # Init cask
  31. .cask/$(emacs_version):
  32. cask install
  33. # Run the autobuild script (installing depends and compiling)
  34. autobuild:
  35. cd server && ./autobuild
  36. # Soon to be obsolete targets
  37. melpa-build: autobuild
  38. cp build/epdfinfo .
  39. install-server-deps: ;
  40. # Create a package like melpa would.
  41. melpa-package: $(pkgfile)
  42. cp $(pkgfile) $(pkgname)-melpa.tar
  43. tar -u --transform='s/server/$(pkgname)\/build\/server/' \
  44. -f $(pkgname)-melpa.tar \
  45. $$(git ls-files server)
  46. tar -u --transform='s/Makefile/$(pkgname)\/build\/Makefile/' \
  47. -f $(pkgname)-melpa.tar \
  48. Makefile
  49. tar -u --transform='s/README\.org/$(pkgname)\/README/' \
  50. -f $(pkgname)-melpa.tar \
  51. README.org
  52. -tar --delete $(pkgname)/epdfinfo \
  53. -f $(pkgname)-melpa.tar
  54. # Various clean targets
  55. clean: server-clean
  56. rm -f -- $(pkgfile)
  57. rm -f -- lisp/*.elc
  58. rm -f -- pdf-tools-readme.txt
  59. rm -f -- pdf-tools-$(version).entry
  60. distclean: clean server-distclean
  61. rm -rf -- .cask
  62. # Server targets
  63. server/epdfinfo: server/Makefile server/*.[ch]
  64. $(MAKE) -C server
  65. server/Makefile: server/configure
  66. cd server && ./configure -q
  67. server/configure: server/configure.ac
  68. cd server && ./autogen.sh
  69. server-test: server/Makefile
  70. $(MAKE) -C server check
  71. server-clean:
  72. ! [ -f server/Makefile ] || $(MAKE) -C server clean
  73. server-distclean:
  74. ! [ -f server/Makefile ] || $(MAKE) -C server distclean