Makefile 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. LISPF = $(filter-out $(LISPA),$(sort $(wildcard *.el)))
  10. LISPC = $(filter-out $(LISPN:%el=%elc),$(LISPF:%el=%elc))
  11. _ORGCM_ = dirall single source slint1 slint2
  12. -include local.mk
  13. .PHONY: all compile compile-dirty \
  14. $(_ORGCM_) $(_ORGCM_:%=compile-%) \
  15. autoloads addcontrib \
  16. install clean cleanauto cleanall cleanelc clean-install
  17. # do not clean here, done in toplevel make
  18. all compile compile-dirty:: autoloads
  19. ifeq ($(filter-out $(_ORGCM_),$(ORGCM)),)
  20. $(MAKE) compile-$(ORGCM)
  21. else
  22. $(error ORGCM has illegal value $(ORGCM) (valid: $(_ORGCM_)))
  23. endif
  24. compile-dirall: dirall
  25. compile-single: single $(LISPC)
  26. compile-source: source dirall
  27. compile-slint1: dirall slint1
  28. compile-slint2: source dirall slint1
  29. # internal
  30. dirall:
  31. @$(info ==================== $@ ====================)
  32. @$(ELCDIR)
  33. single:
  34. @$(info ==================== $@ ====================)
  35. source: cleanelc
  36. @$(info ==================== $@ ====================)
  37. @$(foreach elc,$(LISPC),$(MAKE) $(elc) && $(RM) $(elc);)
  38. slint1:
  39. @$(info ==================== $@ ====================)
  40. @$(foreach elc,$(LISPC),$(RM) $(elc); $(MAKE) $(elc);)
  41. %.elc: %.el
  42. @$(info Compiling single $(abspath $<)...)
  43. -@$(ELC) $<
  44. addcontrib:
  45. ifneq ($(ORG_ADD_CONTRIB),)
  46. $(CP) $(wildcard \
  47. $(addsuffix .el, \
  48. $(addprefix ../contrib/lisp/, \
  49. $(basename \
  50. $(notdir $(ORG_ADD_CONTRIB)))))) .
  51. endif
  52. autoloads: cleanauto addcontrib $(LISPI) $(LISPV)
  53. $(LISPV): $(LISPF)
  54. @echo "org-version: $(ORGVERSION) ($(GITVERSION))"
  55. @$(RM) $(@)
  56. @$(MAKE_ORG_VERSION)
  57. $(LISPI): $(LISPV) $(LISPF)
  58. @echo "org-install: $(ORGVERSION) ($(GITVERSION))"
  59. @$(RM) $(@)
  60. @$(MAKE_ORG_INSTALL)
  61. install: $(LISPF) compile
  62. if [ ! -d $(DESTDIR)$(lispdir) ] ; then \
  63. $(MKDIR) $(DESTDIR)$(lispdir) ; \
  64. fi ;
  65. $(CP) $(LISPC) $(LISPF) $(LISPA) $(DESTDIR)$(lispdir)
  66. cleanauto clean cleanall::
  67. $(RM) $(LISPA) $(LISPA:%el=%elc)
  68. clean cleanall cleanelc::
  69. $(RM) *.elc
  70. clean-install:
  71. if [ -d $(DESTDIR)$(lispdir) ] ; then \
  72. $(RM) $(DESTDIR)$(lispdir)/org*.el* $(DESTDIR)$(lispdir)/ob*.el* ; \
  73. fi ;