Makefile 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. -include local.mk
  7. LISPV = org-version.el
  8. LISPI = org-install.el
  9. LISPA = $(LISPV) $(LISPI)
  10. LISPF = $(filter-out $(LISPA),$(sort $(wildcard *.el)))
  11. LISPC = $(filter-out $(LISPN:%el=%elc),$(LISPF:%el=%elc))
  12. _ORGCM_ = dirall single source slint1
  13. .PHONY: all compile compile-dirty \
  14. $(_ORGCM_) $(_ORGCM_:%=compile-%) compile-slint2 \
  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-$(ORGCM)
  20. compile-dirall: dirall
  21. compile-single: single $(LISPC)
  22. compile-source: source dirall
  23. compile-slint1: dirall slint1
  24. compile-slint2: source dirall slint1
  25. # internal
  26. dirall:
  27. @$(info ==================== $@ ====================)
  28. @$(ELCDIR)
  29. single:
  30. @$(info ==================== $@ ====================)
  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. %.elc: %.el
  38. @$(info Compiling single $(abspath $<)...)
  39. -@$(ELC) $<
  40. autoloads: cleanauto $(LISPI) $(LISPV)
  41. $(LISPV): $(LISPF)
  42. @echo "org-version: $(ORGVERSION) ($(GITVERSION))"
  43. @$(RM) $(@)
  44. @$(MAKE_ORG_VERSION)
  45. $(LISPI): $(LISPV) $(LISPF)
  46. @echo "org-install: $(ORGVERSION) ($(GITVERSION))"
  47. @$(RM) $(@)
  48. @$(MAKE_ORG_INSTALL)
  49. install: $(LISPF) compile
  50. if [ ! -d $(DESTDIR)$(lispdir) ] ; then \
  51. $(MKDIR) $(DESTDIR)$(lispdir) ; \
  52. fi ;
  53. $(CP) $(LISPC) $(LISPF) $(LISPA) $(DESTDIR)$(lispdir)
  54. cleanauto clean cleanall::
  55. $(RM) $(LISPA) $(LISPA:%el=%elc)
  56. clean cleanall cleanelc::
  57. $(RM) *.elc
  58. clean-install:
  59. if [ -d $(DESTDIR)$(lispdir) ] ; then \
  60. $(RM) $(DESTDIR)$(lispdir)/org*.el* $(DESTDIR)$(lispdir)/ob*.el* ; \
  61. fi ;