Makefile 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. ifeq ($(MAKELEVEL), 0)
  2. $(error This make needs to be started as a sub-make from the toplevel directory.)
  3. endif
  4. GITVERSION = $(shell git describe --abbrev=6 HEAD)
  5. GITSTATUS = $(shell git status -uno --porcelain)
  6. ifneq ("$(GITSTATUS)", "")
  7. GITVERSION := $(GITVERSION).dirty
  8. endif
  9. LISPO = org-install.el
  10. LISPF = $(subst $(LISPO),,$(wildcard *.el))
  11. LISPC = $(LISPF:%el=%elc)
  12. include dependencies.mk
  13. .PHONY: all autoloads compile install clean cleanall clean-install
  14. all compile: $(LISPC)
  15. autoloads: $(LISPO)
  16. org-install.el: $(LISPC)
  17. $(BATCH) \
  18. --eval "(require 'autoload)" \
  19. --eval '(find-file "$(LISPO)")' \
  20. --eval '(erase-buffer)' \
  21. --eval '(mapc (lambda (x) (generate-file-autoloads (symbol-name x))) (quote ($(LISPF))))' \
  22. --eval '(insert "\n(provide (quote org-install))\n")' \
  23. --eval '(save-buffer)'
  24. install: $(LISPF) compile autoloads
  25. if [ ! -d $(lispdir) ]; then $(MKDIR) $(lispdir); else true; fi ;
  26. $(CP) $(LISPC) $(LISPF) $(LISPO) $(lispdir)
  27. -$(SED) -e 's/^\((defconst org-git-version \).*/\1 "$(GITVERSION)"/;' org.el > $(lispdir)/org.el
  28. $(MAKE) $(lispdir)/org.elc
  29. clean:
  30. $(RM) *.elc
  31. cleanall:
  32. $(RM) *.elc $(LISPO)
  33. clean-install:
  34. if [ ! -d $(lispdir) ]; then $(MKDIR) $(lispdir); else true; fi ;
  35. $(RM) $(lispdir)/org*.el* $(lispdir)/ob*.el*
  36. $(LISPC): dependencies.mk
  37. .SUFFIXES: # we don't need default suffix rules
  38. .SUFFIXES: .el .elc
  39. .el.elc:
  40. $(info in subdir lisp)
  41. $(ELC) $<