diff --git a/.gitignore b/.gitignore index 374f45e72..c878226bf 100644 --- a/.gitignore +++ b/.gitignore @@ -36,6 +36,7 @@ org-*.zip manual org_dual_license.texi ORGWEBPAGE/Changes.txt +local*.mk # aspell word and replacement lists diff --git a/Makefile b/Makefile index 7037e9a62..5f1d9bff7 100644 --- a/Makefile +++ b/Makefile @@ -8,24 +8,32 @@ .PHONY: targets help targets help: $(info ) - $(info make - show this help) + $(info make - show this help) + $(info make all - cleanly compile Org ELisp files and documentation) $(info ) - $(info make clean - clean Elisp and documentation files) - $(info make all - compile Org ELisp files and documentation) + $(info Installation) + $(info ============) + $(info make install - install Org, both ELisp and Info files) + $(info make install-lisp - install Org, only ELisp files) + $(info make install-info - install Org, only Info file) $(info ) - $(info make docs - make all documentation) - $(info make info - make Info documentation) - $(info make html - make HTML documentation) - $(info make pdf - make pdf documentation) - $(info make card - make refcards documentation) + $(info Maintenance) + $(info ===========) + $(info make docs - make all documentation) + $(info make info - make Info documentation) + $(info make html - make HTML documentation) + $(info make pdf - make pdf documentation) + $(info make card - make refcards documentation) $(info ) - $(info make install - install Org, both ELisp and Info files) - $(info make install-lisp - install Org ELisp files) - $(info make install-info - install Org Info file) + $(info make clean - clean Org ELisp and documentation files) + $(info make compile - cleanly compile Org ELisp files) + $(info make compile-dirty - compile Org ELisp without cleaning) + $(info ) + $(info make clean-install - remove installed Org ELisp and documentation files) @echo "" include default.mk --include local.mk +-include local.mk # optional local customization include maint.mk include targets.mk include maint-targets.mk diff --git a/default.mk b/default.mk index cb61ff38c..a1831feb5 100644 --- a/default.mk +++ b/default.mk @@ -20,11 +20,14 @@ infodir = $(prefix)/info # Using emacs in batch mode. -BATCH = $(EMACS) -batch -q -no-site-file -eval \ - "(setq load-path (cons (expand-file-name \".\") \ - (cons \"$(lispdir)\" load-path)))" +BATCH = $(EMACS) -batch -Q -L . -# Specify the byte-compiler for compiling org-mode files +# How to byte-compile the whole source directory +ELCDIR = $(BATCH) \ + --eval '(defconst org-release "$(ORGVERSION)")' \ + --eval '(batch-byte-recompile-directory 0)' + +# How to byte-compile a single source file ELC = $(BATCH) -f batch-byte-compile # How to make a pdf file from a texinfo file diff --git a/lisp/Makefile b/lisp/Makefile index ac3445f8a..4aa022611 100644 --- a/lisp/Makefile +++ b/lisp/Makefile @@ -1,3 +1,15 @@ +ORG-INSTALL = $(BATCH) \ + --eval "(require 'autoload)" \ + --eval '(find-file "$(LISPO)")' \ + --eval '(erase-buffer)' \ + --eval '(mapc (lambda (x) (generate-file-autoloads (symbol-name x))) (quote ($(LISPF))))' \ + --eval '(insert "\n(provide (quote org-install))\n")' \ + --eval '(insert "\n(defconst org-release \"$(ORGVERSION)\"\n \"The release version of org-mode. Inserted by installing org-mode\n or when a release is made.\")\n")' \ + --eval '(insert "\n(defconst org-git-version \"$(GITVERSION)\"\n \"The Git version of org-mode. Inserted by installing org-mode\n or when a release is made.\")\n")' \ + --eval '(save-buffer)' +-include local.mk # optional local customization + +.NOTPARALLEL: # always run this make serially .SUFFIXES: # we don't need default suffix rules ifeq ($(MAKELEVEL), 0) $(error This make needs to be started as a sub-make from the toplevel directory.) @@ -11,21 +23,13 @@ LISPC = $(LISPF:%el=%elc) all \ compile \ -compile-dirty: - $(BATCH) --eval '(batch-byte-recompile-directory 0)' +compile-dirty: cleanauto + $(ELCDIR) autoloads: $(LISPO) org-install.el: $(LISPF) - $(BATCH) \ - --eval "(require 'autoload)" \ - --eval '(find-file "$(LISPO)")' \ - --eval '(erase-buffer)' \ - --eval '(mapc (lambda (x) (generate-file-autoloads (symbol-name x))) (quote ($(LISPF))))' \ - --eval '(insert "\n(provide (quote org-install))\n")' \ - --eval '(insert "\n(defconst org-release \"$(ORGVERSION)\"\n \"The release version of org-mode. Inserted by installing org-mode\n or when a release is made.\")\n")' \ - --eval '(insert "\n(defconst org-git-version \"$(GITVERSION)\"\n \"The Git version of org-mode. Inserted by installing org-mode\n or when a release is made.\")\n")' \ - --eval '(save-buffer)' + $(ORG-INSTALL) install: $(LISPF) compile autoloads if [ ! -d $(lispdir) ]; then $(MKDIR) $(lispdir); else true; fi ; @@ -34,6 +38,9 @@ install: $(LISPF) compile autoloads clean: $(RM) *.elc +cleanauto: + $(RM) $(LISPO) $(LISPO:%el=%elc) + cleanall: $(RM) *.elc $(LISPO) diff --git a/lisp/org.el b/lisp/org.el index 13801484c..8add2f1cc 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -209,6 +209,7 @@ identifier." ;;; Version +(defvaralias 'org-version 'org-release) ;;;###autoload (defun org-version (&optional here) "Show the org-mode version in the echo area. diff --git a/targets.mk b/targets.mk index ab333a2b3..badb3524c 100644 --- a/targets.mk +++ b/targets.mk @@ -19,6 +19,7 @@ endif install info html pdf card docs $(INSTSUB) \ autoloads cleanall clean cleancontrib cleanelc cleandoc cleanrel +all \ compile:: lisp $(MAKE) -C $< clean @@ -27,7 +28,7 @@ compile-dirty:: lisp $(MAKE) -C $< $@ all \ -clean-install: $(SUBDIRS) +clean-install:: $(SUBDIRS) $(foreach dir, $?, $(MAKE) -C $(dir) $@;) up2: update