Makefile 1.4 KB

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