targets.mk 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. test install info html pdf card docs $(INSTSUB) \
  22. autoloads cleanall clean cleancontrib cleanrel clean-install \
  23. cleanelc cleanlisp cleandoc cleandocs
  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. test:: all
  34. test \
  35. test-dirty::
  36. $(BTEST)
  37. up2: update
  38. sudo ${MAKE} install
  39. update:
  40. git remote update
  41. git pull
  42. ${MAKE} all
  43. install: $(INSTSUB)
  44. install-info: install-doc
  45. docs: info html pdf card
  46. info html pdf card:
  47. $(MAKE) -C doc $@
  48. $(INSTSUB):
  49. $(MAKE) -C $(@:install-%=%) install
  50. autoloads: lisp
  51. $(MAKE) -C $< $@
  52. cleanall: $(SUBDIRS)
  53. $(foreach dir, $?, $(MAKE) -C $(dir) $@;)
  54. -$(FIND) . -name \*~ -exec $(RM) {} \;
  55. clean: cleanrel
  56. $(MAKE) -C lisp clean
  57. $(MAKE) -C doc clean
  58. -$(FIND) . -name \*~ -exec $(RM) {} \;
  59. cleancontrib:
  60. -$(FIND) contrib -name \*~ -exec $(RM) {} \;
  61. cleanrel:
  62. $(RMR) RELEASEDIR
  63. $(RMR) org-7.*
  64. $(RMR) org-7*zip org-7*tar.gz
  65. cleanelc cleanlisp:
  66. $(MAKE) -C lisp clean
  67. cleandoc cleandocs:
  68. $(MAKE) -C doc clean