Makefile 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. compile-single compile-source compile-slint1 compile-slint2 \
  13. autoloads \
  14. install clean cleanauto cleanall cleanelc clean-install
  15. # do not clean here, done in toplevel make
  16. all compile compile-dirty:: autoloads
  17. $(MAKE) compile-$(_COMPILE_)
  18. compile-dirall:
  19. @$(ELCDIR)
  20. compile-single: $(LISPC)
  21. compile-source: cleanelc
  22. @$(foreach elc,$(LISPC),$(MAKE) $(elc) && $(RM) $(elc);)
  23. compile-slint1: compile-dirall
  24. @$(foreach elc,$(LISPC),$(RM) $(elc); $(MAKE) $(elc);)
  25. compile-slint2:
  26. $(MAKE) compile-source compile-slint1
  27. %.elc: %.el
  28. @$(info Compiling single $(abspath $<)...)
  29. -@$(ELC) $<
  30. autoloads: cleanauto $(LISPI) $(LISPV)
  31. $(LISPV): $(LISPF)
  32. @echo "org-version: $(ORGVERSION) ($(GITVERSION))"
  33. @$(RM) $(@)
  34. @$(MAKE_ORG_VERSION)
  35. $(LISPI): $(LISPV) $(LISPF)
  36. @echo "org-install: $(ORGVERSION) ($(GITVERSION))"
  37. @$(RM) $(@)
  38. @$(MAKE_ORG_INSTALL)
  39. install: $(LISPF) compile
  40. if [ ! -d $(DESTDIR)$(lispdir) ] ; then \
  41. $(MKDIR) $(DESTDIR)$(lispdir) ; \
  42. fi ;
  43. $(CP) $(LISPC) $(LISPF) $(LISPA) $(DESTDIR)$(lispdir)
  44. cleanauto clean cleanall::
  45. $(RM) $(LISPA) $(LISPA:%el=%elc)
  46. clean cleanall cleanelc::
  47. $(RM) *.elc
  48. clean-install:
  49. if [ -d $(DESTDIR)$(lispdir) ] ; then \
  50. $(RM) $(DESTDIR)$(lispdir)/org*.el* $(DESTDIR)$(lispdir)/ob*.el* ; \
  51. fi ;