targets.mk 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. install info html pdf card docs $(INSTSUB) \
  22. autoloads cleanall clean cleancontrib cleanelc cleandoc cleanrel
  23. all \
  24. compile:: lisp
  25. $(MAKE) -C $< clean
  26. compile \
  27. compile-dirty:: lisp
  28. $(MAKE) -C $< $@
  29. all \
  30. clean-install:: $(SUBDIRS)
  31. $(foreach dir, $?, $(MAKE) -C $(dir) $@;)
  32. up2: update
  33. sudo ${MAKE} install
  34. update:
  35. git pull
  36. ${MAKE} clean
  37. ${MAKE} all
  38. install: $(INSTSUB)
  39. install-info: install-doc
  40. docs: info html pdf card
  41. info html pdf card:
  42. $(MAKE) -C doc $@
  43. $(INSTSUB):
  44. $(MAKE) -C $(@:install-%=%) install
  45. autoloads: lisp maint.mk
  46. $(MAKE) -C $< $@
  47. cleanall: $(SUBDIRS)
  48. $(foreach dir, $?, $(MAKE) -C $(dir) $@;)
  49. -$(FIND) . -name \*~ -exec $(RM) {} \;
  50. clean: cleanrel
  51. $(MAKE) -C lisp clean
  52. $(MAKE) -C doc clean
  53. -$(FIND) . -name \*~ -exec $(RM) {} \;
  54. cleancontrib:
  55. -$(FIND) contrib -name \*~ -exec $(RM) {} \;
  56. cleanrel:
  57. $(RMR) RELEASEDIR
  58. $(RMR) org-7.*
  59. $(RMR) org-7*zip org-7*tar.gz