Makefile 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. .NOTPARALLEL: # always run this make serially
  2. .SUFFIXES: # we don't need default suffix rules
  3. ifeq ($(MAKELEVEL), 0)
  4. $(error This make needs to be started as a sub-make from the toplevel directory.)
  5. endif
  6. LISPV = org-version.el
  7. LISPI = org-loaddefs.el
  8. LISPA = $(LISPV) $(LISPI)
  9. LISPB = $(LISPA:%el=%elc) org-install.elc
  10. LISPF = $(filter-out $(LISPA),$(sort $(wildcard *.el)))
  11. LISPC = $(filter-out $(LISPB) $(LISPN:%el=%elc),$(LISPF:%el=%elc))
  12. _ORGCM_ = dirall single source slint1 slint2
  13. -include local.mk
  14. .PHONY: all compile compile-dirty \
  15. $(_ORGCM_) $(_ORGCM_:%=compile-%) \
  16. autoloads addcontrib \
  17. install clean cleanauto cleanall cleanelc clean-install
  18. # do not clean here, done in toplevel make
  19. all compile compile-dirty:: autoloads
  20. ifeq ($(filter-out $(_ORGCM_),$(ORGCM)),)
  21. $(MAKE) compile-$(ORGCM)
  22. else
  23. $(error ORGCM has illegal value $(ORGCM) (valid: $(_ORGCM_)))
  24. endif
  25. compile-dirall: dirall
  26. compile-single: single $(LISPC)
  27. compile-source: source dirall
  28. compile-slint1: dirall slint1
  29. compile-slint2: source dirall slint1
  30. # internal
  31. dirall:
  32. @$(info ==================== $@ ====================)
  33. @$(ELCDIR)
  34. single:
  35. @$(info ==================== $@ ====================)
  36. source: cleanelc
  37. @$(info ==================== $@ ====================)
  38. @$(foreach elc,$(LISPC),$(MAKE) $(elc) && $(RM) $(elc);)
  39. slint1:
  40. @$(info ==================== $@ ====================)
  41. @$(foreach elc,$(LISPC),$(RM) $(elc); $(MAKE) $(elc);)
  42. %.elc: %.el
  43. @$(info Compiling single $(abspath $<)...)
  44. -@$(ELC) $<
  45. addcontrib:
  46. ifneq ($(ORG_ADD_CONTRIB),)
  47. $(CP) $(wildcard \
  48. $(addsuffix .el, \
  49. $(addprefix ../contrib/lisp/, \
  50. $(basename \
  51. $(notdir $(ORG_ADD_CONTRIB)))))) .
  52. endif
  53. autoloads: cleanauto addcontrib $(LISPI) $(LISPV)
  54. $(LISPV): $(LISPF)
  55. @echo "org-version: $(ORGVERSION) ($(GITVERSION))"
  56. @$(RM) $(@)
  57. @$(MAKE_ORG_VERSION)
  58. $(LISPI): $(LISPV) $(LISPF)
  59. @echo "org-loaddefs: $(ORGVERSION) ($(GITVERSION))"
  60. @$(RM) $(@)
  61. @$(MAKE_ORG_INSTALL)
  62. install: $(LISPF) compile
  63. if [ ! -d $(DESTDIR)$(lispdir) ] ; then \
  64. $(MKDIR) $(DESTDIR)$(lispdir) ; \
  65. fi ;
  66. $(CP) $(LISPC) $(LISPF) $(LISPA) $(DESTDIR)$(lispdir)
  67. cleanauto clean cleanall::
  68. $(RM) $(LISPA) $(LISPB)
  69. clean cleanall cleanelc::
  70. $(RM) *.elc
  71. clean-install:
  72. if [ -d $(DESTDIR)$(lispdir) ] ; then \
  73. $(RM) $(DESTDIR)$(lispdir)/org*.el* $(DESTDIR)$(lispdir)/ob*.el* ; \
  74. fi ;