Makefile 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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-install.el
  8. LISPA = $(LISPV) $(LISPI)
  9. LISPF = $(filter-out $(LISPA),$(sort $(wildcard *.el)))
  10. LISPC = $(filter-out $(LISPN:%el=%elc),$(LISPF:%el=%elc))
  11. .PHONY: all compile compile-dirty \
  12. dirall source slint1 slint3 slint4 \
  13. compile-single compile-source \
  14. compile-slint1 compile-slint2 compile-slint3 compile-slint4 \
  15. autoloads \
  16. install clean cleanauto cleanall cleanelc clean-install
  17. # do not clean here, done in toplevel make
  18. all compile compile-dirty:: autoloads
  19. $(MAKE) compile-$(_COMPILE_)
  20. compile-dirall: dirall
  21. compile-single: $(LISPC)
  22. compile-source: source dirall
  23. compile-slint1: dirall slint1
  24. compile-slint2: source dirall slint1
  25. compile-slint3: slint3 dirall
  26. compile-slint4: slint4 dirall
  27. # internal
  28. dirall:
  29. @$(info ==================== $@ ====================)
  30. @$(ELCDIR)
  31. source: cleanelc
  32. @$(info ==================== $@ ====================)
  33. @$(foreach elc,$(LISPC),$(MAKE) $(elc) && $(RM) $(elc);)
  34. slint1:
  35. @$(info ==================== $@ ====================)
  36. @$(foreach elc,$(LISPC),$(RM) $(elc); $(MAKE) $(elc);)
  37. slint3:
  38. @$(info ==================== $@ ====================)
  39. -@$(ELINTL) $(foreach el,$(LISPF),$(ELINTF))
  40. slint4:
  41. @$(info ==================== $@ ====================)
  42. -@$(foreach el,$(LISPF),$(ELINTL) $(ELINTF);)
  43. %.elc: %.el
  44. @$(info Compiling single $(abspath $<)...)
  45. -@$(ELC) $<
  46. autoloads: cleanauto $(LISPI) $(LISPV)
  47. $(LISPV): $(LISPF)
  48. @echo "org-version: $(ORGVERSION) ($(GITVERSION))"
  49. @$(RM) $(@)
  50. @$(MAKE_ORG_VERSION)
  51. $(LISPI): $(LISPV) $(LISPF)
  52. @echo "org-install: $(ORGVERSION) ($(GITVERSION))"
  53. @$(RM) $(@)
  54. @$(MAKE_ORG_INSTALL)
  55. install: $(LISPF) compile
  56. if [ ! -d $(DESTDIR)$(lispdir) ] ; then \
  57. $(MKDIR) $(DESTDIR)$(lispdir) ; \
  58. fi ;
  59. $(CP) $(LISPC) $(LISPF) $(LISPA) $(DESTDIR)$(lispdir)
  60. cleanauto clean cleanall::
  61. $(RM) $(LISPA) $(LISPA:%el=%elc)
  62. clean cleanall cleanelc::
  63. $(RM) *.elc
  64. clean-install:
  65. if [ -d $(DESTDIR)$(lispdir) ] ; then \
  66. $(RM) $(DESTDIR)$(lispdir)/org*.el* $(DESTDIR)$(lispdir)/ob*.el* ; \
  67. fi ;