Makefile 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. _ORGCM_ = dirall single source slint1 slint2
  12. -include local.mk
  13. .PHONY: all compile compile-dirty \
  14. $(_ORGCM_) $(_ORGCM_:%=compile-%) \
  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. 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. autoloads: cleanauto $(LISPI) $(LISPV)
  45. $(LISPV): $(LISPF)
  46. @echo "org-version: $(ORGVERSION) ($(GITVERSION))"
  47. @$(RM) $(@)
  48. @$(MAKE_ORG_VERSION)
  49. $(LISPI): $(LISPV) $(LISPF)
  50. @echo "org-install: $(ORGVERSION) ($(GITVERSION))"
  51. @$(RM) $(@)
  52. @$(MAKE_ORG_INSTALL)
  53. install: $(LISPF) compile
  54. if [ ! -d $(DESTDIR)$(lispdir) ] ; then \
  55. $(MKDIR) $(DESTDIR)$(lispdir) ; \
  56. fi ;
  57. $(CP) $(LISPC) $(LISPF) $(LISPA) $(DESTDIR)$(lispdir)
  58. cleanauto clean cleanall::
  59. $(RM) $(LISPA) $(LISPA:%el=%elc)
  60. clean cleanall cleanelc::
  61. $(RM) *.elc
  62. clean-install:
  63. if [ -d $(DESTDIR)$(lispdir) ] ; then \
  64. $(RM) $(DESTDIR)$(lispdir)/org*.el* $(DESTDIR)$(lispdir)/ob*.el* ; \
  65. fi ;