targets.mk 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. .NOTPARALLEL: .PHONY
  2. # Additional distribution files
  3. DISTFILES_extra= Makefile request-assign-future.txt contrib etc
  4. .EXPORT_ALL_VARIABLES:
  5. LISPDIRS = lisp
  6. SUBDIRS = doc etc $(LISPDIRS)
  7. INSTSUB = $(SUBDIRS:%=install-%)
  8. ORG_MAKE_DOC ?= info html pdf
  9. ifneq ($(wildcard .git),)
  10. GITVERSION ?= $(shell git describe --abbrev=6 HEAD)
  11. ORGVERSION ?= $(subst release_,,$(shell git describe --abbrev=0 HEAD))
  12. GITSTATUS ?= $(shell git status -uno --porcelain)
  13. else
  14. GITVERSION ?= N/A
  15. ORGVERSION ?= N/A
  16. endif
  17. DATE = $(shell date +%Y-%m-%d)
  18. ifneq ($(GITSTATUS),)
  19. GITVERSION := $(GITVERSION).dirty
  20. endif
  21. .PHONY: default all oldorg up2 update compile lisp doc etc \
  22. check test install info html pdf card doc docs $(INSTSUB) \
  23. autoloads cleanall clean cleancontrib cleanrel clean-install \
  24. cleanelc cleandirs cleanlisp cleandoc cleandocs cleantest
  25. # backwards compatibility target
  26. oldorg: compile autoloads info
  27. all \
  28. compile:: lisp
  29. $(MAKE) -C $< clean
  30. compile \
  31. compile-dirty:: lisp
  32. $(MAKE) -C $< $@
  33. all \
  34. clean-install::
  35. $(foreach dir, $(SUBDIRS), $(MAKE) -C $(dir) $@;)
  36. check test:: all
  37. check test \
  38. test-dirty::
  39. -$(MKDIR) $(testdir)
  40. TMPDIR=$(testdir) $(BTEST)
  41. ifeq ($(TEST_NO_AUTOCLEAN),) # define this variable to leave $(testdir) around for inspection
  42. $(MAKE) cleantest
  43. endif
  44. up2: update
  45. $(SUDO) $(MAKE) install
  46. update:
  47. git remote update
  48. git pull
  49. $(MAKE) check
  50. install: $(INSTSUB)
  51. install-info: install-doc
  52. doc docs: $(ORG_MAKE_DOC)
  53. info html pdf card:
  54. $(MAKE) -C doc $@
  55. $(INSTSUB):
  56. $(MAKE) -C $(@:install-%=%) install
  57. autoloads: lisp
  58. $(MAKE) -C $< $@
  59. cleandirs:
  60. $(foreach dir, $(SUBDIRS), $(MAKE) -C $(dir) cleanall;)
  61. clean: cleanrel
  62. $(MAKE) -C lisp clean
  63. $(MAKE) -C doc clean
  64. cleanall: cleandirs cleantest
  65. -$(FIND) . -name \*~ -exec $(RM) {} \;
  66. cleancontrib:
  67. -$(FIND) contrib -name \*~ -exec $(RM) {} \;
  68. cleanrel:
  69. $(RMR) RELEASEDIR
  70. $(RMR) org-7.*
  71. $(RMR) org-7*zip org-7*tar.gz
  72. cleanelc cleanlisp:
  73. $(MAKE) -C lisp clean
  74. -$(FIND) lisp -name \*~ -exec $(RM) {} \;
  75. cleandoc cleandocs:
  76. $(MAKE) -C doc clean
  77. -$(FIND) doc -name \*~ -exec $(RM) {} \;
  78. cleantest:
  79. $(RMR) $(testdir)