targets.mk 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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 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. all \
  25. compile:: lisp
  26. $(MAKE) -C $< clean
  27. compile \
  28. compile-dirty:: lisp
  29. $(MAKE) -C $< $@
  30. all \
  31. clean-install:: $(SUBDIRS)
  32. $(foreach dir, $?, $(MAKE) -C $(dir) $@;)
  33. check test:: all
  34. check test \
  35. test-dirty::
  36. -$(MKDIR) $(testdir)
  37. TMPDIR=$(testdir) $(BTEST)
  38. ifeq ($(TEST_NO_AUTOCLEAN),) # define this variable to leave $(testdir) around for inspection
  39. $(MAKE) cleantest
  40. endif
  41. up2: update
  42. $(SUDO) $(MAKE) install
  43. update:
  44. git remote update
  45. git pull
  46. $(MAKE) check
  47. install: $(INSTSUB)
  48. install-info: install-doc
  49. docs: info html pdf card
  50. info html pdf card:
  51. $(MAKE) -C doc $@
  52. $(INSTSUB):
  53. $(MAKE) -C $(@:install-%=%) install
  54. autoloads: lisp
  55. $(MAKE) -C $< $@
  56. cleandirs: $(SUBDIRS)
  57. $(foreach dir, $?, $(MAKE) -C $(dir) cleanall;)
  58. clean: cleanrel
  59. $(MAKE) -C lisp clean
  60. $(MAKE) -C doc clean
  61. cleanall: cleandirs cleantest
  62. -$(FIND) . -name \*~ -exec $(RM) {} \;
  63. cleancontrib:
  64. -$(FIND) contrib -name \*~ -exec $(RM) {} \;
  65. cleanrel:
  66. $(RMR) RELEASEDIR
  67. $(RMR) org-7.*
  68. $(RMR) org-7*zip org-7*tar.gz
  69. cleanelc cleanlisp:
  70. $(MAKE) -C lisp clean
  71. -$(FIND) lisp -name \*~ -exec $(RM) {} \;
  72. cleandoc cleandocs:
  73. $(MAKE) -C doc clean
  74. -$(FIND) doc -name \*~ -exec $(RM) {} \;
  75. cleantest:
  76. $(RMR) $(testdir)