targets.mk 2.1 KB

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