Makefile 1.2 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. ifneq ($(shell git status -uno --porcelain), '')
  6. GITVERSION := $(GITVERSION).dirty
  7. endif
  8. LISPO = org-install.el
  9. LISPF = $(subst $(LISPO),,$(wildcard *.el))
  10. LISPC = $(LISPF:%el=%elc)
  11. include dependencies.mk
  12. .PHONY: autoloads compile install clean cleanall
  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. perl -i -pe 's/^(\(defconst org-git-version ).*/\1 "$(GITVERSION)"/;' $(lispdir)/org.el
  27. $(MAKE) $(lispdir)/org.elc
  28. clean:
  29. $(RM) $(LISPC)
  30. cleanall:
  31. $(RM) $(LISPC) $(LISPO)
  32. $(LISPC): dependencies.mk
  33. .SUFFIXES: # we don't need default suffix rules
  34. .SUFFIXES: .el .elc
  35. .el.elc:
  36. $(info in subdir lisp)
  37. $(ELC) $<