Makefile 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. .PHONY: all autoloads compile install clean cleanall clean-install
  13. all compile: $(LISPC)
  14. autoloads: $(LISPO)
  15. org-install.el: $(LISPC)
  16. $(BATCH) \
  17. --eval "(require 'autoload)" \
  18. --eval '(find-file "$(LISPO)")' \
  19. --eval '(erase-buffer)' \
  20. --eval '(mapc (lambda (x) (generate-file-autoloads (symbol-name x))) (quote ($(LISPF))))' \
  21. --eval '(insert "\n(provide (quote org-install))\n")' \
  22. --eval '(save-buffer)'
  23. install: $(LISPF) compile autoloads
  24. if [ ! -d $(lispdir) ]; then $(MKDIR) $(lispdir); else true; fi ;
  25. $(CP) $(LISPC) $(LISPF) $(LISPO) $(lispdir)
  26. -$(SED) -e 's/^\((defconst org-git-version \).*/\1 "$(GITVERSION)"/;' org.el > $(lispdir)/org.el
  27. $(MAKE) $(lispdir)/org.elc
  28. clean:
  29. $(RM) *.elc
  30. cleanall:
  31. $(RM) *.elc $(LISPO)
  32. clean-install:
  33. if [ ! -d $(lispdir) ]; then $(MKDIR) $(lispdir); else true; fi ;
  34. $(RM) $(lispdir)/org*.el* $(lispdir)/ob*.el*
  35. .SUFFIXES: # we don't need default suffix rules
  36. .SUFFIXES: .el .elc
  37. .el.elc:
  38. $(ELC) $<