From b0ebd4365e73884f2f02dfa1b585be714e9b0be3 Mon Sep 17 00:00:00 2001 From: Achim Gratz Date: Tue, 12 Jul 2011 19:45:59 +0200 Subject: [PATCH 01/36] Split off Makefile into several parts, included from master Makefile * Makefile: just keep help target (now also default for no target) and include all other parts from here. * default.mk: user editable variables with their default values * maint.mk: definitions by maintainer, should not be touched by user * targets.mk: user callable targets * maint-targets.mk: targets for maintenance, should not be called by user * dependencies.mk: keep order during compile (could become auto-generated) This is the first in a series of patches that restructures the Makefile to achieve easier customization and separation of different concerns (mainly user vs. maintenance of the distribution). This first patch simply establishes a set of files without changing anything else to provide a clean starting point. It uses GNU make extensions since Makefile already depends on GNU make anyway. --- Makefile | 558 +---------------------------------------------- default.mk | 47 ++++ dependencies.mk | 61 ++++++ maint-targets.mk | 190 ++++++++++++++++ maint.mk | 134 ++++++++++++ targets.mk | 74 +++++++ 6 files changed, 512 insertions(+), 552 deletions(-) create mode 100644 default.mk create mode 100644 dependencies.mk create mode 100644 maint-targets.mk create mode 100644 maint.mk create mode 100644 targets.mk diff --git a/Makefile b/Makefile index 89d75d0c1..02ed3c329 100644 --- a/Makefile +++ b/Makefile @@ -6,558 +6,6 @@ # To install org-mode, edit the Makefile, type `make', then `make install'. # To create the PDF and HTML documentation files, type `make doc'. -##---------------------------------------------------------------------- -## YOU MUST EDIT THE FOLLOWING LINES -##---------------------------------------------------------------------- - -# Name of your emacs binary -EMACS=emacs - -# Where local software is found -prefix=/usr/local - -# Where local lisp files go -lispdir = $(prefix)/share/emacs/site-lisp - -# Where data files go -# $(datadir) contains auxiliary files for use with ODT exporter. -# See comments under DATAFILES. -datadir = $(prefix)/share/emacs/etc - -# Where info files go -infodir = $(prefix)/share/info - -##---------------------------------------------------------------------- -## YOU MAY NEED TO EDIT THESE -##---------------------------------------------------------------------- - -# Using emacs in batch mode. - -BATCH=$(EMACS) -batch -q -no-site-file -eval \ - "(setq load-path (cons (expand-file-name \"./lisp/\") (cons \"$(lispdir)\" load-path)))" $(BATCH_EXTRA) - -# Specify the byte-compiler for compiling org-mode files -ELC= $(BATCH) -f batch-byte-compile - -# How to make a pdf file from a texinfo file -TEXI2PDF = texi2pdf - -# How to create directories -MKDIR = mkdir -p - -# How to create the info files from the texinfo file -MAKEINFO = makeinfo - -# How to create the HTML file -TEXI2HTML = makeinfo --html --number-sections -TEXI2HTMLNOPSLIT = makeinfo --html --no-split --number-sections - -# How to copy the lisp files and elc files to their distination. -CP = cp -pr - -# Name of the program to install info files -INSTALL_INFO=install-info - -##---------------------------------------------------------------------- -## BELOW THIS LINE ON YOUR OWN RISK! -##---------------------------------------------------------------------- - -# The following variables need to be defined by the maintainer -LISPF = org.el \ - org-agenda.el \ - org-ascii.el \ - org-attach.el \ - org-archive.el \ - org-bbdb.el \ - org-beamer.el \ - org-bibtex.el \ - org-capture.el \ - org-clock.el \ - org-colview.el \ - org-colview-xemacs.el \ - org-compat.el \ - org-pcomplete.el \ - org-crypt.el \ - org-ctags.el \ - org-datetree.el \ - org-docview.el \ - org-entities.el \ - org-exp.el \ - org-exp-blocks.el \ - org-docbook.el \ - org-faces.el \ - org-feed.el \ - org-footnote.el \ - org-freemind.el \ - org-gnus.el \ - org-eshell.el \ - org-habit.el \ - org-html.el \ - org-icalendar.el \ - org-id.el \ - org-indent.el \ - org-info.el \ - org-inlinetask.el \ - org-jsinfo.el \ - org-irc.el \ - org-latex.el \ - org-list.el \ - org-lparse.el \ - org-mac-message.el \ - org-macs.el \ - org-mew.el \ - org-mhe.el \ - org-mks.el \ - org-mobile.el \ - org-mouse.el \ - org-odt.el \ - org-publish.el \ - org-plot.el \ - org-protocol.el \ - org-remember.el \ - org-rmail.el \ - org-special-blocks.el \ - org-src.el \ - org-table.el \ - org-taskjuggler.el \ - org-timer.el \ - org-vm.el \ - org-w3m.el \ - org-wl.el \ - org-xoxo.el \ - ob.el \ - ob-table.el \ - ob-lob.el \ - ob-ref.el \ - ob-exp.el \ - ob-tangle.el \ - ob-comint.el \ - ob-eval.el \ - ob-keys.el \ - ob-awk.el \ - ob-C.el \ - ob-calc.el \ - ob-ditaa.el \ - ob-haskell.el \ - ob-perl.el \ - ob-sh.el \ - ob-R.el \ - ob-dot.el \ - ob-mscgen.el \ - ob-latex.el \ - ob-lisp.el \ - ob-ledger.el \ - ob-python.el \ - ob-sql.el \ - ob-asymptote.el \ - ob-emacs-lisp.el \ - ob-matlab.el \ - ob-ruby.el \ - ob-sqlite.el \ - ob-clojure.el \ - ob-ocaml.el \ - ob-sass.el \ - ob-css.el \ - ob-gnuplot.el \ - ob-octave.el \ - ob-screen.el \ - ob-plantuml.el \ - ob-org.el \ - ob-js.el \ - ob-scheme.el \ - ob-lilypond.el \ - ob-java.el \ - ob-shen.el \ - ob-fortran.el \ - ob-picolisp.el \ - ob-maxima.el \ - ob-io.el \ - ob-scala.el - -LISPFILES0 = $(LISPF:%=lisp/%) -LISPFILES = $(LISPFILES0) lisp/org-install.el -ELCFILES0 = $(LISPFILES0:.el=.elc) -ELCFILES = $(LISPFILES:.el=.elc) -DOCFILES = doc/org.texi doc/org.pdf doc/org doc/dir \ - doc/pdflayout.sty doc/.nosearch \ - doc/orgguide.texi doc/orgguide.pdf -CARDFILES = doc/orgcard.tex doc/orgcard.pdf doc/orgcard_letter.pdf -TEXIFILES = doc/org.texi -INFOFILES = doc/org - -# etc/styles contains OpenDocument style files. These files *must* be -# installed for the ODT exporter to function. These files are -# distirbuted with GNU ELPA as well as with stock Emacs >= 24.1. - -# contrib/odt/etc/schema contains OpenDocument schema files. It is -# *desirable* but *not* mandatory that these files be installed. -# These files are not distributed with stock Emacs. This is because -# the terms under which OASIS distributes these files are not -# agreeable to FSF. - -# BasicODConverter-x.y.z.oxt is a LibreOffice extension for converting -# OpenDocument files to numerous other formats. It is similar to -# unoconv and is implemented in StarBasic. It is *desirable* but -# *not* *mandatory* that the converter be installed. It is -# distributed under the same license as GNU Emacs. This file is *not* -# part of GNU Emacs. -DATAFILES = etc/styles \ - # contrib/odt/BasicODConverter/BasicODConverter*.oxt \ - # contrib/odt/etc/schema \ - -# Package Manager (ELPA) -PKG_TAG = $(shell date +%Y%m%d) -PKG_DOC = "Outline-based notes management and organizer" -PKG_REQ = "nil" - -PKG_FILES = $(LISPFILES0) \ - doc/dir doc/org \ - doc/pdflayout.sty \ - doc/org.pdf \ - doc/orgguide.pdf \ - doc/orgcard.tex \ - doc/orgcard.pdf \ - doc/orgcard_letter.pdf \ - etc/ - -.SUFFIXES: .el .elc .texi -SHELL = /bin/sh - -# Additional distribution files -DISTFILES_extra= Makefile request-assign-future.txt contrib etc - -default: $(ELCFILES) $(ELCBFILES) - -all: $(ELCFILES) $(ELCBFILES) $(INFOFILES) - -up2: update - sudo ${MAKE} install - -update: - git pull - ${MAKE} clean - ${MAKE} all - -compile: $(ELCFILES0) $(ELCBFILES) - -install: install-lisp install-data - -doc: doc/org.html doc/org.pdf doc/orgcard.pdf doc/orgcard_letter.pdf doc/orgguide.pdf doc/orgcard.txt - -p: - ${MAKE} pdf && open doc/org.pdf - -g: - ${MAKE} pdf && open doc/orgguide.pdf - -# Always force re-compilation of org-odt -lisp/org-odt.elc: org-odt-data-dir -org-odt-data-dir: - -# Sleight of hand to "hard code" the value of $(datadir) in -# org-odt.el. See variables `org-odt-styles-dir-list' and -# `org-odt-schema-dir-list'. -install-lisp: BATCH_EXTRA = -eval "(setq org-odt-data-dir (expand-file-name \"$(datadir)\"))" - -install-lisp: $(LISPFILES) $(ELCFILES) - if [ ! -d $(DESTDIR)$(lispdir) ]; then \ - $(MKDIR) $(DESTDIR)$(lispdir); else true; fi ; - $(CP) $(LISPFILES) $(DESTDIR)$(lispdir) - $(CP) $(ELCFILES) $(DESTDIR)$(lispdir) - -install-info: $(INFOFILES) - if [ ! -d $(DESTDIR)$(infodir) ]; then \ - $(MKDIR) $(DESTDIR)$(infodir); else true; fi ; - $(CP) $(INFOFILES) $(DESTDIR)$(infodir) - $(INSTALL_INFO) --infodir=$(DESTDIR)$(infodir) $(INFOFILES) - -install-data: $(DATAFILES) - if [ ! -d $(DESTDIR)$(datadir) ]; then \ - $(MKDIR) $(DESTDIR)$(datadir); else true; fi ; - $(CP) $(DATAFILES) $(DESTDIR)$(datadir) - -autoloads: lisp/org-install.el - -lisp/org-install.el: $(LISPFILES0) Makefile - $(BATCH) --eval "(require 'autoload)" \ - --eval '(find-file "lisp/org-install.el")' \ - --eval '(erase-buffer)' \ - --eval '(mapc (lambda (x) (generate-file-autoloads (symbol-name x))) (quote ($(LISPF))))' \ - --eval '(insert "\n(provide (quote org-install))\n")' \ - --eval '(save-buffer)' - -doc/org: doc/org.texi - (cd doc && $(MAKEINFO) --no-split org.texi -o org) - -doc/org.pdf: doc/org.texi - (cd doc && $(TEXI2PDF) org.texi) - -doc/orgguide.pdf: doc/orgguide.texi - (cd doc && $(TEXI2PDF) orgguide.texi) - -doc/org.html: doc/org.texi - (cd doc && $(TEXI2HTML) --no-split -o org.html org.texi) - UTILITIES/manfull.pl doc/org.html - -doc/orgcard.pdf: doc/orgcard.tex - (cd doc && pdftex orgcard.tex) - -doc/orgcard.txt: doc/orgcard.tex - (cd doc && perl ../UTILITIES/orgcard2txt.pl orgcard.tex > orgcard.txt) - -doc/orgcard_letter.tex: doc/orgcard.tex - perl -pe 's/\\pdflayout=\(0l\)/\\pdflayout=(1l)/' \ - doc/orgcard.tex > doc/orgcard_letter.tex - -doc/orgcard_letter.pdf: doc/orgcard_letter.tex - (cd doc && pdftex orgcard_letter.tex) - -# Below here are special targets for maintenance only - -html: doc/org.html - -html_manual: doc/org.texi - rm -rf doc/manual - mkdir doc/manual - $(TEXI2HTML) -o doc/manual doc/org.texi - UTILITIES/mansplit.pl doc/manual/*.html - -html_guide: doc/orgguide.texi - rm -rf doc/guide - mkdir doc/guide - $(TEXI2HTML) -o doc/guide doc/orgguide.texi - UTILITIES/guidesplit.pl doc/guide/*.html - -info: doc/org - -pdf: doc/org.pdf doc/orgguide.pdf - -card: doc/orgcard.pdf doc/orgcard_letter.pdf doc/orgcard.txt - -testrelease: - git checkout -b testrelease origin/maint - git merge -s recursive -X theirs master - UTILITIES/set-version.pl testing - git commit -a -m "Release testing" - make distfile TAG=testversion - make cleanrel - rm -rf org-testversion* - git reset --hard - git checkout master - git branch -D testrelease - -# The following target makes a full release for the stuff that is -# currently on master. Do it like this: -# -# make release TAG=7.01 - -release: - git checkout maint - git merge -s recursive -X theirs master - UTILITIES/set-version.pl $(TAG) - git commit -a -m "Major release $(TAG) from master" - make relup TAG=$(TAG) - make cleanrel - make pushreleasetag TAG=$(TAG) - git push -f origin maint - git checkout master - git merge -s ours maint - UTILITIES/set-version.pl -a $(TAG) - git commit -a -m "Bump to version $(TAG) as current release from master" - git push - -# The following target makes a release, but from the stuff that is on -# maint, not from the stuff that is on master. The idea is that it pushes -# out a minor fix into a minor update, while development on master -# already went full steam ahead. To make a micro-relesse, cherry-pick -# the necessary changes into maint, then run (with proper version number) -# This is just like release, but we skip the step which merges master -# into maint. -# -# make fixrelease TAG=7.01.02 - -fixrelease: - git checkout maint - UTILITIES/set-version.pl $(TAG) - git commit -a -m "Bugfix release $(TAG) from maint" - make relup TAG=$(TAG) - make cleanrel - make pushreleasetag TAG=$(TAG) - git push -f origin maint - git checkout master - git merge -s ours maint - UTILITIES/set-version.pl -o $(TAG) - git commit -a -m "Bump to version $(TAG) as current release from maint" - git push - -# ~$ make relup only makes sense from orgmode.org server -# Don't call it from your computer! -relup: - ${MAKE} makerelease - ${MAKE} sync_release - ${MAKE} sync_manual - -makerelease: - @if [ "X$(TAG)" = "X" ]; then echo "*** No tag ***"; exit 1; fi - ${MAKE} distfile - ${MAKE} doc - UTILITIES/gplmanual.pl - ${MAKE} html_manual - ${MAKE} html_guide - rm -rf RELEASEDIR - $(MKDIR) RELEASEDIR - cp org-$(TAG).zip org-$(TAG).tar.gz RELEASEDIR - cp doc/org.pdf doc/orgcard.pdf doc/org.texi doc/org.html RELEASEDIR - cp doc/org_dual_license.texi RELEASEDIR - cp doc/orgguide.pdf doc/orgcard.txt RELEASEDIR - cp RELEASEDIR/org-$(TAG).zip RELEASEDIR/org.zip - cp RELEASEDIR/org-$(TAG).tar.gz RELEASEDIR/org.tar.gz - -# ~$ make sync_release only makes sense from orgmode.org server -# Don't call it from your computer! -sync_release: - rsync -avuz RELEASEDIR/ /var/www/orgmode.org/ - -# ~$ make sync_manual only makes sense from orgmode.org server -# Don't call it from your computer! -sync_manual: - rsync -avuz --delete doc/manual/ /var/www/orgmode.org/manual/ - rsync -avuz --delete doc/guide/ /var/www/orgmode.org/guide/ - -distfile: - @if [ "X$(TAG)" = "X" ]; then echo "*** No tag ***"; exit 1; fi - touch doc/org.texi doc/orgcard.tex # force update - ${MAKE} cleancontrib - ${MAKE} info - ${MAKE} doc - ${MAKE} lisp/org-install.el - rm -rf org-$(TAG) org-$(TAG).zip - $(MKDIR) org-$(TAG) - $(MKDIR) org-$(TAG)/doc - $(MKDIR) org-$(TAG)/lisp - cp -r $(LISPFILES) org-$(TAG)/lisp - cp -r $(DOCFILES) $(CARDFILES) org-$(TAG)/doc - cp -r $(DISTFILES_extra) org-$(TAG)/ - cp -r README_DIST org-$(TAG)/README - zip -r org-$(TAG).zip org-$(TAG) - tar zcvf org-$(TAG).tar.gz org-$(TAG) - -pkg: - @if [ "X$(PKG_TAG)" = "X" ]; then echo "*** No tag ***"; exit 1; fi - touch doc/org.texi doc/orgcard.tex # force update - ${MAKE} info - ${MAKE} doc - rm -rf org-$(PKG_TAG) org-$(PKG_TAG).tar - $(MKDIR) org-$(PKG_TAG) - cp -r $(PKG_FILES) org-$(PKG_TAG) - echo "(define-package \"org\" \"$(PKG_TAG)\" \"$(PKG_DOC)\" $(PKG_REQ))" > org-$(PKG_TAG)/org-pkg.el - tar cf org-$(PKG_TAG).tar org-$(PKG_TAG) --remove-files - -cleanall: - ${MAKE} clean - rm -f lisp/org-install.el - -clean: - ${MAKE} cleanelc - ${MAKE} cleandoc - ${MAKE} cleanrel - rm -f *~ */*~ */*/*~ - -cleancontrib: - find contrib -name \*~ -exec rm {} \; - -cleanelc: - rm -f $(ELCFILES) -cleandoc: - -(cd doc && rm -f org.pdf org org.html orgcard.pdf orgguide.pdf) - -(cd doc && rm -f *.aux *.cp *.cps *.dvi *.fn *.fns *.ky *.kys *.pg *.pgs) - -(cd doc && rm -f *.toc *.tp *.tps *.vr *.vrs *.log *.html *.ps) - -(cd doc && rm -f orgcard_letter.tex orgcard_letter.pdf) - -(cd doc && rm -rf manual) - -cleanrel: - rm -rf RELEASEDIR - rm -rf org-7.* - rm -rf org-7*zip org-7*tar.gz - -.el.elc: - $(ELC) $< - - -push: - git push orgmode@orgmode.org:org-mode.git master - -pushtag: - git tag -m "Adding tag" -a $(TAG) - git push orgmode@orgmode.org:org-mode.git $(TAG) - -pushreleasetag: - git tag -m "Adding release tag" -a release_$(TAG) - git push orgmode@orgmode.org:org-mode.git release_$(TAG) - -# Dependencies - -lisp/org.elc: lisp/org-macs.el lisp/org-compat.el lisp/org-faces.el -lisp/org-agenda.elc: lisp/org.el -lisp/org-ascii.elc: lisp/org-exp.el -lisp/org-attach.elc: lisp/org.el lisp/org-id.el -lisp/org-archive.elc: lisp/org.el -lisp/org-bbdb.elc: lisp/org.el -lisp/org-beamer.elc: lisp/org.el -lisp/org-bibtex.elc: lisp/org.el -lisp/org-capture.elc: lisp/org.el lisp/org-mks.el -lisp/org-clock.elc: lisp/org.el -lisp/org-colview.elc: lisp/org.el -lisp/org-colview-xemacs.elc: lisp/org.el -lisp/org-compat.elc: lisp/org-macs.el -lisp/org-crypt.elc: lisp/org-crypt.el lisp/org.el -lisp/org-ctags.elc: lisp/org.el -lisp/org-datetree.elc: lisp/org.el -lisp/org-docview.elc: lisp/org.el -lisp/org-entities.elc: -lisp/org-exp.elc: lisp/org.el lisp/org-agenda.el -lisp/org-exp-blocks.elc: lisp/org.el -lisp/org-latex.elc: lisp/org.el lisp/org-exp.el lisp/org-beamer.el -lisp/org-docbook.elc: lisp/org.el lisp/org-exp.el -lisp/org-faces.elc: lisp/org-macs.el lisp/org-compat.el -lisp/org-feed.elc: lisp/org.el -lisp/org-footnotes.elc: lisp/org-macs.el lisp/org-compat.el -lisp/org-freemind.elc: lisp/org.el -lisp/org-gnus.elc: lisp/org.el -lisp/org-html.elc: lisp/org-exp.el -lisp/org-habit.elc: lisp/org.el lisp/org-agenda.el -lisp/org-icalendar.elc: lisp/org-exp.el -lisp/org-id.elc: lisp/org.el -lisp/org-indent.elc: lisp/org.el lisp/org-macs.el lisp/org-compat.el -lisp/org-info.elc: lisp/org.el -lisp/org-inlinetask.elc: -lisp/org-irc.elc: lisp/org.el -lisp/org-jsinfo.elc: lisp/org.el lisp/org-exp.el -lisp/org-list.elc: lisp/org-macs.el lisp/org-compat.el -lisp/org-lparse.elc: lisp/org-exp.el -lisp/org-mac-message.elc: lisp/org.el -lisp/org-macs.elc: -lisp/org-mew.elc: lisp/org.el -lisp/org-mhe.elc: lisp/org.el -lisp/org-mks.elc: -lisp/org-mobile.elc: lisp/org.el -lisp/org-mouse.elc: lisp/org.el -lisp/org-odt.elc: lisp/org-lparse.el -lisp/org-plot.elc: lisp/org.el lisp/org-exp.el lisp/org-table.el -lisp/org-publish.elc: -lisp/org-protocol.elc: lisp/org.el -lisp/org-remember.elc: lisp/org.el -lisp/org-rmail.elc: lisp/org.el -lisp/org-special-blocks.elc: lisp/org-compat.el -lisp/org-src.elc: lisp/org-macs.el lisp/org-compat.el -lisp/org-table.elc: lisp/org.el -lisp/org-taskjuggler.elc: lisp/org.el lisp/org-exp.el -lisp/org-timer.elc: lisp/org.el -lisp/org-vm.elc: lisp/org.el -lisp/org-w3m.elc: lisp/org.el -lisp/org-wl.elc: lisp/org.el -lisp/org-xoxo.elc: lisp/org-exp.el - # Describe valid make targets for org-mode. targets help: @echo "make - compile Org ELisp files" @@ -573,3 +21,9 @@ targets help: @echo "make install - install Org" @echo "make install-lisp - install Org ELisp files" @echo "make install-info - install Org Info file" + +include default.mk +include maint.mk +include targets.mk +include maint-targets.mk +include dependencies.mk diff --git a/default.mk b/default.mk new file mode 100644 index 000000000..4bd396ba3 --- /dev/null +++ b/default.mk @@ -0,0 +1,47 @@ +##---------------------------------------------------------------------- +## YOU MUST EDIT THE FOLLOWING LINES +##---------------------------------------------------------------------- + +# Name of your emacs binary +EMACS=emacs + +# Where local software is found +prefix=/usr/local + +# Where local lisp files go. +lispdir = $(prefix)/share/emacs/site-lisp + +# Where info files go. +infodir = $(prefix)/share/info + +##---------------------------------------------------------------------- +## YOU MAY NEED TO EDIT THESE +##---------------------------------------------------------------------- + +# Using emacs in batch mode. + +BATCH=$(EMACS) -batch -q -no-site-file -eval \ + "(setq load-path (cons (expand-file-name \"./lisp/\") (cons \"$(lispdir)\" load-path)))" + +# Specify the byte-compiler for compiling org-mode files +ELC= $(BATCH) -f batch-byte-compile + +# How to make a pdf file from a texinfo file +TEXI2PDF = texi2pdf + +# How to create directories +MKDIR = mkdir -p + +# How to create the info files from the texinfo file +MAKEINFO = makeinfo + +# How to create the HTML file +TEXI2HTML = makeinfo --html --number-sections +TEXI2HTMLNOPSLIT = makeinfo --html --no-split --number-sections + +# How to copy the lisp files and elc files to their distination. +CP = cp -p + +# Name of the program to install info files +INSTALL_INFO=install-info + diff --git a/dependencies.mk b/dependencies.mk new file mode 100644 index 000000000..21e0b225a --- /dev/null +++ b/dependencies.mk @@ -0,0 +1,61 @@ +# Dependencies + +lisp/org.elc: lisp/org-macs.el lisp/org-compat.el lisp/org-faces.el +lisp/org-agenda.elc: lisp/org.el +lisp/org-ascii.elc: lisp/org-exp.el +lisp/org-attach.elc: lisp/org.el lisp/org-id.el +lisp/org-archive.elc: lisp/org.el +lisp/org-bbdb.elc: lisp/org.el +lisp/org-beamer.elc: lisp/org.el +lisp/org-bibtex.elc: lisp/org.el +lisp/org-capture.elc: lisp/org.el lisp/org-mks.el +lisp/org-clock.elc: lisp/org.el +lisp/org-colview.elc: lisp/org.el +lisp/org-colview-xemacs.elc: lisp/org.el +lisp/org-compat.elc: lisp/org-macs.el +lisp/org-crypt.elc: lisp/org-crypt.el lisp/org.el +lisp/org-ctags.elc: lisp/org.el +lisp/org-datetree.elc: lisp/org.el +lisp/org-docview.elc: lisp/org.el +lisp/org-entities.elc: +lisp/org-exp.elc: lisp/org.el lisp/org-agenda.el +lisp/org-exp-blocks.elc: lisp/org.el +lisp/org-latex.elc: lisp/org.el lisp/org-exp.el lisp/org-beamer.el +lisp/org-docbook.elc: lisp/org.el lisp/org-exp.el +lisp/org-faces.elc: lisp/org-macs.el lisp/org-compat.el +lisp/org-feed.elc: lisp/org.el +lisp/org-footnotes.elc: lisp/org-macs.el lisp/org-compat.el +lisp/org-freemind.elc: lisp/org.el +lisp/org-gnus.elc: lisp/org.el +lisp/org-html.elc: lisp/org-exp.el +lisp/org-habit.elc: lisp/org.el lisp/org-agenda.el +lisp/org-icalendar.elc: lisp/org-exp.el +lisp/org-id.elc: lisp/org.el +lisp/org-indent.elc: lisp/org.el lisp/org-macs.el lisp/org-compat.el +lisp/org-info.elc: lisp/org.el +lisp/org-inlinetask.elc: +lisp/org-irc.elc: lisp/org.el +lisp/org-jsinfo.elc: lisp/org.el lisp/org-exp.el +lisp/org-list.elc: lisp/org-macs.el lisp/org-compat.el +lisp/org-mac-message.elc: lisp/org.el +lisp/org-macs.elc: +lisp/org-mew.elc: lisp/org.el +lisp/org-mhe.elc: lisp/org.el +lisp/org-mks.elc: +lisp/org-mobile.elc: lisp/org.el +lisp/org-mouse.elc: lisp/org.el +lisp/org-plot.elc: lisp/org.el lisp/org-exp.el lisp/org-table.el +lisp/org-publish.elc: +lisp/org-protocol.elc: lisp/org.el +lisp/org-remember.elc: lisp/org.el +lisp/org-rmail.elc: lisp/org.el +lisp/org-special-blocks.elc: lisp/org-compat.el +lisp/org-src.elc: lisp/org-macs.el lisp/org-compat.el +lisp/org-table.elc: lisp/org.el +lisp/org-taskjuggler.elc: lisp/org.el lisp/org-exp.el +lisp/org-timer.elc: lisp/org.el +lisp/org-vm.elc: lisp/org.el +lisp/org-w3m.elc: lisp/org.el +lisp/org-wl.elc: lisp/org.el +lisp/org-xoxo.elc: lisp/org-exp.el + diff --git a/maint-targets.mk b/maint-targets.mk new file mode 100644 index 000000000..d22dc53da --- /dev/null +++ b/maint-targets.mk @@ -0,0 +1,190 @@ +# Below here are special targets for maintenance only + +html: doc/org.html + +html_manual: doc/org.texi + rm -rf doc/manual + mkdir doc/manual + $(TEXI2HTML) -o doc/manual doc/org.texi + UTILITIES/mansplit.pl doc/manual/*.html + +html_guide: doc/orgguide.texi + rm -rf doc/guide + mkdir doc/guide + $(TEXI2HTML) -o doc/guide doc/orgguide.texi + UTILITIES/guidesplit.pl doc/guide/*.html + +info: doc/org + +pdf: doc/org.pdf doc/orgguide.pdf + +card: doc/orgcard.pdf doc/orgcard_letter.pdf doc/orgcard.txt + +testrelease: + git checkout -b testrelease origin/maint + git merge -s recursive -X theirs master + UTILITIES/set-version.pl testing + git commit -a -m "Release testing" + make distfile TAG=testversion + make cleanrel + rm -rf org-testversion* + git reset --hard + git checkout master + git branch -D testrelease + +# The following target makes a full release for the stuff that is +# currently on master. Do it like this: +# +# make release TAG=7.01 + +release: + git checkout maint + git merge -s recursive -X theirs master + UTILITIES/set-version.pl $(TAG) + git commit -a -m "Release $(TAG)" + make relup TAG=$(TAG) + make cleanrel + rm -rf org-$(TAG) + rm -f org-$(TAG)*.zip + rm -f org-$(TAG)*.tar.gz + make pushreleasetag TAG=$(TAG) + git push -f origin maint + git checkout master + git merge -s ours maint + UTILITIES/set-version.pl -a $(TAG) + git commit -a -m "Update website to show $(TAG) as current release" + git push + +# The following target makes a release, but from the stuff that is on +# maint, not from the stuff that is on master. The idea is that it pushes +# out a minor fix into a minor update, while development on master +# already went full steam ahead. To make a micro-relesse, cherry-pick +# the necessary changes into maint, then run (with proper version number) +# This is just like release, but we skip the step which merges master +# into maint. +# +# make fixrelease TAG=7.01.02 + +fixrelease: + git checkout maint + git merge -s recursive -X theirs master + UTILITIES/set-version.pl $(TAG) + git commit -a -m "Release $(TAG)" + make relup TAG=$(TAG) + make cleanrel + rm -rf org-$(TAG) + rm org-$(TAG)*.zip + rm org-$(TAG)*.tar.gz + make pushreleasetag TAG=$(TAG) + git push -f origin maint + git checkout master + git merge -s ours maint + UTILITIES/set-version.pl -o $(TAG) + git commit -a -m "Update website to show $(TAG) as current release" + git push + +# ~$ make relup only makes sense from orgmode.org server +# Don't call it from your computer! +relup: + ${MAKE} makerelease + ${MAKE} sync_release + ${MAKE} sync_manual + +makerelease: + @if [ "X$(TAG)" = "X" ]; then echo "*** No tag ***"; exit 1; fi + ${MAKE} distfile + ${MAKE} doc + UTILITIES/gplmanual.pl + ${MAKE} html_manual + ${MAKE} html_guide + rm -rf RELEASEDIR + $(MKDIR) RELEASEDIR + cp org-$(TAG).zip org-$(TAG).tar.gz RELEASEDIR + cp doc/org.pdf doc/orgcard.pdf doc/org.texi doc/org.html RELEASEDIR + cp doc/org_dual_license.texi RELEASEDIR + cp doc/orgguide.pdf doc/orgcard.txt RELEASEDIR + cp RELEASEDIR/org-$(TAG).zip RELEASEDIR/org.zip + cp RELEASEDIR/org-$(TAG).tar.gz RELEASEDIR/org.tar.gz + +# ~$ make sync_release only makes sense from orgmode.org server +# Don't call it from your computer! +sync_release: + rsync -avuz RELEASEDIR/ /var/www/orgmode.org/ + +# ~$ make sync_manual only makes sense from orgmode.org server +# Don't call it from your computer! +sync_manual: + rsync -avuz --delete doc/manual/ /var/www/orgmode.org/manual/ + rsync -avuz --delete doc/guide/ /var/www/orgmode.org/guide/ + +distfile: + @if [ "X$(TAG)" = "X" ]; then echo "*** No tag ***"; exit 1; fi + touch doc/org.texi doc/orgcard.tex # force update + ${MAKE} cleancontrib + ${MAKE} info + ${MAKE} doc + ${MAKE} lisp/org-install.el + rm -rf org-$(TAG) org-$(TAG).zip + $(MKDIR) org-$(TAG) + $(MKDIR) org-$(TAG)/doc + $(MKDIR) org-$(TAG)/lisp + cp -r $(LISPFILES) org-$(TAG)/lisp + cp -r $(DOCFILES) $(CARDFILES) org-$(TAG)/doc + cp -r $(DISTFILES_extra) org-$(TAG)/ + cp -r README_DIST org-$(TAG)/README + zip -r org-$(TAG).zip org-$(TAG) + tar zcvf org-$(TAG).tar.gz org-$(TAG) + +pkg: + @if [ "X$(PKG_TAG)" = "X" ]; then echo "*** No tag ***"; exit 1; fi + touch doc/org.texi doc/orgcard.tex # force update + ${MAKE} info + ${MAKE} doc + rm -rf org-$(PKG_TAG) org-$(PKG_TAG).tar + $(MKDIR) org-$(PKG_TAG) + cp -r $(PKG_FILES) org-$(PKG_TAG) + echo "(define-package \"org\" \"$(PKG_TAG)\" \"$(PKG_DOC)\" $(PKG_REQ))" > org-$(PKG_TAG)/org-pkg.el + tar cf org-$(PKG_TAG).tar org-$(PKG_TAG) --remove-files + +cleanall: + ${MAKE} clean + rm -f lisp/org-install.el + +clean: + ${MAKE} cleanelc + ${MAKE} cleandoc + ${MAKE} cleanrel + rm -f *~ */*~ */*/*~ + +cleancontrib: + find contrib -name \*~ -exec rm {} \; + +cleanelc: + rm -f $(ELCFILES) +cleandoc: + -(cd doc && rm -f org.pdf org org.html orgcard.pdf orgguide.pdf) + -(cd doc && rm -f *.aux *.cp *.cps *.dvi *.fn *.fns *.ky *.kys *.pg *.pgs) + -(cd doc && rm -f *.toc *.tp *.tps *.vr *.vrs *.log *.html *.ps) + -(cd doc && rm -f orgcard_letter.tex orgcard_letter.pdf) + -(cd doc && rm -rf manual) + +cleanrel: + rm -rf RELEASEDIR + rm -rf org-7.* + rm -rf org-7*zip org-7*tar.gz + +.el.elc: + $(ELC) $< + + +push: + git push orgmode@orgmode.org:org-mode.git master + +pushtag: + git tag -m "Adding tag" -a $(TAG) + git push orgmode@orgmode.org:org-mode.git $(TAG) + +pushreleasetag: + git tag -m "Adding release tag" -a release_$(TAG) + git push orgmode@orgmode.org:org-mode.git release_$(TAG) + diff --git a/maint.mk b/maint.mk new file mode 100644 index 000000000..dc7c0c9c0 --- /dev/null +++ b/maint.mk @@ -0,0 +1,134 @@ +##---------------------------------------------------------------------- +## BELOW THIS LINE ON YOUR OWN RISK! +##---------------------------------------------------------------------- + +# The following variables need to be defined by the maintainer +LISPF = org.el \ + org-agenda.el \ + org-ascii.el \ + org-attach.el \ + org-archive.el \ + org-bbdb.el \ + org-beamer.el \ + org-bibtex.el \ + org-capture.el \ + org-clock.el \ + org-colview.el \ + org-colview-xemacs.el \ + org-compat.el \ + org-pcomplete.el \ + org-crypt.el \ + org-ctags.el \ + org-datetree.el \ + org-docview.el \ + org-entities.el \ + org-exp.el \ + org-exp-blocks.el \ + org-docbook.el \ + org-faces.el \ + org-feed.el \ + org-footnote.el \ + org-freemind.el \ + org-gnus.el \ + org-habit.el \ + org-html.el \ + org-icalendar.el \ + org-id.el \ + org-indent.el \ + org-info.el \ + org-inlinetask.el \ + org-jsinfo.el \ + org-irc.el \ + org-latex.el \ + org-list.el \ + org-mac-message.el \ + org-macs.el \ + org-mew.el \ + org-mhe.el \ + org-mks.el \ + org-mobile.el \ + org-mouse.el \ + org-publish.el \ + org-plot.el \ + org-protocol.el \ + org-remember.el \ + org-rmail.el \ + org-special-blocks.el \ + org-src.el \ + org-table.el \ + org-taskjuggler.el \ + org-timer.el \ + org-vm.el \ + org-w3m.el \ + org-wl.el \ + org-xoxo.el \ + ob.el \ + ob-table.el \ + ob-lob.el \ + ob-ref.el \ + ob-exp.el \ + ob-tangle.el \ + ob-comint.el \ + ob-eval.el \ + ob-keys.el \ + ob-awk.el \ + ob-C.el \ + ob-calc.el \ + ob-ditaa.el \ + ob-haskell.el \ + ob-perl.el \ + ob-sh.el \ + ob-R.el \ + ob-dot.el \ + ob-mscgen.el \ + ob-latex.el \ + ob-lisp.el \ + ob-ledger.el \ + ob-python.el \ + ob-sql.el \ + ob-asymptote.el \ + ob-emacs-lisp.el \ + ob-matlab.el \ + ob-ruby.el \ + ob-sqlite.el \ + ob-clojure.el \ + ob-ocaml.el \ + ob-sass.el \ + ob-css.el \ + ob-gnuplot.el \ + ob-octave.el \ + ob-screen.el \ + ob-plantuml.el \ + ob-org.el \ + ob-js.el \ + ob-scheme.el \ + ob-lilypond.el + +LISPFILES0 = $(LISPF:%=lisp/%) +LISPFILES = $(LISPFILES0) lisp/org-install.el +ELCFILES0 = $(LISPFILES0:.el=.elc) +ELCFILES = $(LISPFILES:.el=.elc) +DOCFILES = doc/org.texi doc/org.pdf doc/org doc/dir \ + doc/pdflayout.sty doc/.nosearch \ + doc/orgguide.texi doc/orgguide.pdf +CARDFILES = doc/orgcard.tex doc/orgcard.pdf doc/orgcard_letter.pdf +TEXIFILES = doc/org.texi +INFOFILES = doc/org + +# Package Manager (ELPA) +PKG_TAG = $(shell date +%Y%m%d) +PKG_DOC = "Outline-based notes management and organizer" +PKG_REQ = "nil" + +PKG_FILES = $(LISPFILES0) \ + doc/dir doc/org \ + doc/pdflayout.sty \ + doc/org.pdf \ + doc/orgguide.pdf \ + doc/orgcard.tex \ + doc/orgcard.pdf \ + doc/orgcard_letter.pdf + +.SUFFIXES: .el .elc .texi +SHELL = /bin/sh + diff --git a/targets.mk b/targets.mk new file mode 100644 index 000000000..409ee0f78 --- /dev/null +++ b/targets.mk @@ -0,0 +1,74 @@ +# Additional distribution files +DISTFILES_extra= Makefile request-assign-future.txt contrib etc + +default: $(ELCFILES) $(ELCBFILES) + +all: $(ELCFILES) $(ELCBFILES) $(INFOFILES) + +up2: update + sudo ${MAKE} install + +update: + git pull + ${MAKE} clean + ${MAKE} all + +compile: $(ELCFILES0) $(ELCBFILES) + +install: install-lisp + +doc: doc/org.html doc/org.pdf doc/orgcard.pdf doc/orgcard_letter.pdf doc/orgguide.pdf doc/orgcard.txt + +p: + ${MAKE} pdf && open doc/org.pdf + +g: + ${MAKE} pdf && open doc/orgguide.pdf + +install-lisp: $(LISPFILES) $(ELCFILES) + if [ ! -d $(lispdir) ]; then $(MKDIR) $(lispdir); else true; fi ; + $(CP) $(LISPFILES) $(lispdir) + $(CP) $(ELCFILES) $(lispdir) + +install-info: $(INFOFILES) + if [ ! -d $(infodir) ]; then $(MKDIR) $(infodir); else true; fi ; + $(CP) $(INFOFILES) $(infodir) + $(INSTALL_INFO) --infodir=$(infodir) $(INFOFILES) + +autoloads: lisp/org-install.el + +lisp/org-install.el: $(LISPFILES0) Makefile + $(BATCH) --eval "(require 'autoload)" \ + --eval '(find-file "org-install.el")' \ + --eval '(erase-buffer)' \ + --eval '(mapc (lambda (x) (generate-file-autoloads (symbol-name x))) (quote ($(LISPFILES0))))' \ + --eval '(insert "\n(provide (quote org-install))\n")' \ + --eval '(save-buffer)' + mv org-install.el lisp + +doc/org: doc/org.texi + (cd doc && $(MAKEINFO) --no-split org.texi -o org) + +doc/org.pdf: doc/org.texi + (cd doc && $(TEXI2PDF) org.texi) + +doc/orgguide.pdf: doc/orgguide.texi + (cd doc && $(TEXI2PDF) orgguide.texi) + +doc/org.html: doc/org.texi + (cd doc && $(TEXI2HTML) --no-split -o org.html org.texi) + UTILITIES/manfull.pl doc/org.html + +doc/orgcard.pdf: doc/orgcard.tex + (cd doc && pdftex orgcard.tex) + +doc/orgcard.txt: doc/orgcard.tex + (cd doc && perl ../UTILITIES/orgcard2txt.pl orgcard.tex > orgcard.txt) + +doc/orgcard_letter.tex: doc/orgcard.tex + perl -pe 's/\\pdflayout=\(0l\)/\\pdflayout=(1l)/' \ + doc/orgcard.tex > doc/orgcard_letter.tex + +doc/orgcard_letter.pdf: doc/orgcard_letter.tex + (cd doc && pdftex orgcard_letter.tex) + From 2386380c72b9e6eca7b87060c22975485524ddbe Mon Sep 17 00:00:00 2001 From: Achim Gratz Date: Tue, 12 Jul 2011 20:11:15 +0200 Subject: [PATCH 02/36] change defaults to something that should work on most Linux systems and Cygwin * default.mk: change prefix to /usr/share and do some formatting This change establishes the baseline installation path that should work out-of-the-box on Linux and Cygwin when the install is done system-wide (which needs administrator privileges). --- default.mk | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/default.mk b/default.mk index 4bd396ba3..802105af0 100644 --- a/default.mk +++ b/default.mk @@ -3,16 +3,16 @@ ##---------------------------------------------------------------------- # Name of your emacs binary -EMACS=emacs +EMACS = emacs # Where local software is found -prefix=/usr/local +prefix = /usr/share # Where local lisp files go. -lispdir = $(prefix)/share/emacs/site-lisp +lispdir = $(prefix)/emacs/site-lisp # Where info files go. -infodir = $(prefix)/share/info +infodir = $(prefix)/info ##---------------------------------------------------------------------- ## YOU MAY NEED TO EDIT THESE @@ -20,28 +20,29 @@ infodir = $(prefix)/share/info # Using emacs in batch mode. -BATCH=$(EMACS) -batch -q -no-site-file -eval \ - "(setq load-path (cons (expand-file-name \"./lisp/\") (cons \"$(lispdir)\" load-path)))" +BATCH = $(EMACS) -batch -q -no-site-file -eval \ + "(setq load-path (cons (expand-file-name \"./lisp/\") \ + (cons \"$(lispdir)\" load-path)))" # Specify the byte-compiler for compiling org-mode files -ELC= $(BATCH) -f batch-byte-compile +ELC = $(BATCH) -f batch-byte-compile # How to make a pdf file from a texinfo file TEXI2PDF = texi2pdf # How to create directories -MKDIR = mkdir -p +MKDIR = mkdir -p # How to create the info files from the texinfo file MAKEINFO = makeinfo # How to create the HTML file TEXI2HTML = makeinfo --html --number-sections -TEXI2HTMLNOPSLIT = makeinfo --html --no-split --number-sections -# How to copy the lisp files and elc files to their distination. -CP = cp -p +# How to copy the lisp files and elc files to their destination. +# CP = cp -p # try this if there is no install +CP = install -p # Name of the program to install info files -INSTALL_INFO=install-info +INSTALL_INFO = install-info From 77f0e507874aba14a25d37f38f5bbf2608efdd1b Mon Sep 17 00:00:00 2001 From: Achim Gratz Date: Tue, 12 Jul 2011 22:31:41 +0200 Subject: [PATCH 03/36] shuffle targets to their correct place, harden recipes * Makefile: declare phony targets, remove help text for install-info-debian * default.mk: add variable for FIND and RM * targets.mk, maint-targets.mk: shuffle targets to where they belong, declare phony targets, work around a texi2dvi bug, use pattern rules, use targets for dependencies instead of repeating them verbatim --- Makefile | 3 +- default.mk | 6 ++++ maint-targets.mk | 48 ++++++----------------------- targets.mk | 80 ++++++++++++++++++++++++++++++++---------------- 4 files changed, 71 insertions(+), 66 deletions(-) diff --git a/Makefile b/Makefile index 02ed3c329..225dad3d6 100644 --- a/Makefile +++ b/Makefile @@ -3,10 +3,9 @@ # Maintainer: Carsten Dominik # Version: VERSIONTAG # -# To install org-mode, edit the Makefile, type `make', then `make install'. -# To create the PDF and HTML documentation files, type `make doc'. # Describe valid make targets for org-mode. +.PHONY: targets help targets help: @echo "make - compile Org ELisp files" @echo "make clean - clean Elisp and documentation files" diff --git a/default.mk b/default.mk index 802105af0..f19ac4920 100644 --- a/default.mk +++ b/default.mk @@ -39,6 +39,12 @@ MAKEINFO = makeinfo # How to create the HTML file TEXI2HTML = makeinfo --html --number-sections +# How to find files +FIND = find + +# How to remove files +RM = rm + # How to copy the lisp files and elc files to their destination. # CP = cp -p # try this if there is no install CP = install -p diff --git a/maint-targets.mk b/maint-targets.mk index d22dc53da..3d71d7a18 100644 --- a/maint-targets.mk +++ b/maint-targets.mk @@ -1,6 +1,15 @@ +.PHONY: p g html_manual html_guide \ + testrelease release fixrelease \ + relup makerelease sync_release sync_manual \ + distfile pkg push pushtag pushreleasetag +.NOTPARALLEL: .PHONY # Below here are special targets for maintenance only -html: doc/org.html +p: pdf + open doc/org.pdf + +g: pdf + open doc/orgguide.pdf html_manual: doc/org.texi rm -rf doc/manual @@ -14,12 +23,6 @@ html_guide: doc/orgguide.texi $(TEXI2HTML) -o doc/guide doc/orgguide.texi UTILITIES/guidesplit.pl doc/guide/*.html -info: doc/org - -pdf: doc/org.pdf doc/orgguide.pdf - -card: doc/orgcard.pdf doc/orgcard_letter.pdf doc/orgcard.txt - testrelease: git checkout -b testrelease origin/maint git merge -s recursive -X theirs master @@ -146,37 +149,6 @@ pkg: echo "(define-package \"org\" \"$(PKG_TAG)\" \"$(PKG_DOC)\" $(PKG_REQ))" > org-$(PKG_TAG)/org-pkg.el tar cf org-$(PKG_TAG).tar org-$(PKG_TAG) --remove-files -cleanall: - ${MAKE} clean - rm -f lisp/org-install.el - -clean: - ${MAKE} cleanelc - ${MAKE} cleandoc - ${MAKE} cleanrel - rm -f *~ */*~ */*/*~ - -cleancontrib: - find contrib -name \*~ -exec rm {} \; - -cleanelc: - rm -f $(ELCFILES) -cleandoc: - -(cd doc && rm -f org.pdf org org.html orgcard.pdf orgguide.pdf) - -(cd doc && rm -f *.aux *.cp *.cps *.dvi *.fn *.fns *.ky *.kys *.pg *.pgs) - -(cd doc && rm -f *.toc *.tp *.tps *.vr *.vrs *.log *.html *.ps) - -(cd doc && rm -f orgcard_letter.tex orgcard_letter.pdf) - -(cd doc && rm -rf manual) - -cleanrel: - rm -rf RELEASEDIR - rm -rf org-7.* - rm -rf org-7*zip org-7*tar.gz - -.el.elc: - $(ELC) $< - - push: git push orgmode@orgmode.org:org-mode.git master diff --git a/targets.mk b/targets.mk index 409ee0f78..5ccdf1986 100644 --- a/targets.mk +++ b/targets.mk @@ -1,9 +1,13 @@ +.PHONY: default all up2 update compile \ + install info html pdf card doc install-lisp install-info \ + autoloads cleanall clean cleancontrib cleanelc cleandoc cleanrel +.NOTPARALLEL: .PHONY # Additional distribution files DISTFILES_extra= Makefile request-assign-future.txt contrib etc -default: $(ELCFILES) $(ELCBFILES) +default: $(ELCFILES) -all: $(ELCFILES) $(ELCBFILES) $(INFOFILES) +all: default $(INFOFILES) up2: update sudo ${MAKE} install @@ -13,19 +17,21 @@ update: ${MAKE} clean ${MAKE} all -compile: $(ELCFILES0) $(ELCBFILES) +compile: $(ELCFILES0) install: install-lisp -doc: doc/org.html doc/org.pdf doc/orgcard.pdf doc/orgcard_letter.pdf doc/orgguide.pdf doc/orgcard.txt +info: doc/org -p: - ${MAKE} pdf && open doc/org.pdf +html: doc/org.html -g: - ${MAKE} pdf && open doc/orgguide.pdf +pdf: doc/org.pdf doc/orgguide.pdf -install-lisp: $(LISPFILES) $(ELCFILES) +card: doc/orgcard.pdf doc/orgcard_letter.pdf doc/orgcard.txt + +doc: html pdf card + +install-lisp: $(LISPFILES) default if [ ! -d $(lispdir) ]; then $(MKDIR) $(lispdir); else true; fi ; $(CP) $(LISPFILES) $(lispdir) $(CP) $(ELCFILES) $(lispdir) @@ -37,31 +43,30 @@ install-info: $(INFOFILES) autoloads: lisp/org-install.el -lisp/org-install.el: $(LISPFILES0) Makefile - $(BATCH) --eval "(require 'autoload)" \ - --eval '(find-file "org-install.el")' \ - --eval '(erase-buffer)' \ - --eval '(mapc (lambda (x) (generate-file-autoloads (symbol-name x))) (quote ($(LISPFILES0))))' \ - --eval '(insert "\n(provide (quote org-install))\n")' \ - --eval '(save-buffer)' +lisp/org-install.el: $(LISPFILES0) maint.mk dependencies.mk + $(BATCH) \ + --eval "(require 'autoload)" \ + --eval '(find-file "org-install.el")' \ + --eval '(erase-buffer)' \ + --eval '(mapc (lambda (x) (generate-file-autoloads (symbol-name x))) (quote ($(LISPFILES0))))' \ + --eval '(insert "\n(provide (quote org-install))\n")' \ + --eval '(save-buffer)' mv org-install.el lisp doc/org: doc/org.texi (cd doc && $(MAKEINFO) --no-split org.texi -o org) -doc/org.pdf: doc/org.texi - (cd doc && $(TEXI2PDF) org.texi) - -doc/orgguide.pdf: doc/orgguide.texi - (cd doc && $(TEXI2PDF) orgguide.texi) +doc/%.pdf: LC_ALL=C # work around a bug in texi2dvi +doc/%.pdf: LANG=C # work around a bug in texi2dvi +doc/%.pdf: doc/%.texi + (cd doc && $(TEXI2PDF) $( orgcard.txt) @@ -69,6 +74,29 @@ doc/orgcard_letter.tex: doc/orgcard.tex perl -pe 's/\\pdflayout=\(0l\)/\\pdflayout=(1l)/' \ doc/orgcard.tex > doc/orgcard_letter.tex -doc/orgcard_letter.pdf: doc/orgcard_letter.tex - (cd doc && pdftex orgcard_letter.tex) +cleanall: clean + $(RM) lisp/org-install.el +clean: cleanelc cleandoc cleanrel cleancontrib + -$(FIND) . -name \*~ -exec $(RM) {} \; + +cleancontrib: + -$(FIND) contrib -name \*~ -exec $(RM) {} \; + +cleanelc: + rm -f $(ELCFILES) + +cleandoc: + -(cd doc && rm -f org.pdf org org.html orgcard.pdf orgguide.pdf) + -(cd doc && rm -f *.aux *.cp *.cps *.dvi *.fn *.fns *.ky *.kys *.pg *.pgs) + -(cd doc && rm -f *.toc *.tp *.tps *.vr *.vrs *.log *.html *.ps) + -(cd doc && rm -f orgcard_letter.tex orgcard_letter.pdf) + -(cd doc && rm -rf manual) + +cleanrel: + rm -rf RELEASEDIR + rm -rf org-7.* + rm -rf org-7*zip org-7*tar.gz + +.el.elc: + $(ELC) $< From ac3162b4f040837e1599028a8ff16c996b942522 Mon Sep 17 00:00:00 2001 From: Achim Gratz Date: Sat, 16 Jul 2011 22:49:24 +0200 Subject: [PATCH 04/36] activate local.mk and hand off ./lisp to a sub-make * Makefile: add an optional include local.mk * default.mk: install lisp files into org subfolder by default * lisp/Makefile: new file to handle all make targets within lisp * lisp/dependencies.mk: dependencies, should rather be auto-generated * maint.mk: remove obsolete variable definitions * targets.mk: hand off to sub-make in ./lisp, remove unused targets --- Makefile | 10 ++--- default.mk | 8 ++-- dependencies.mk | 61 ------------------------- lisp/Makefile | 38 ++++++++++++++++ lisp/dependencies.mk | 61 +++++++++++++++++++++++++ maint.mk | 105 ------------------------------------------- targets.mk | 39 +++++----------- 7 files changed, 120 insertions(+), 202 deletions(-) delete mode 100644 dependencies.mk create mode 100644 lisp/Makefile create mode 100644 lisp/dependencies.mk diff --git a/Makefile b/Makefile index 225dad3d6..174af94da 100644 --- a/Makefile +++ b/Makefile @@ -21,8 +21,8 @@ targets help: @echo "make install-lisp - install Org ELisp files" @echo "make install-info - install Org Info file" -include default.mk -include maint.mk -include targets.mk -include maint-targets.mk -include dependencies.mk + include default.mk +-include local.mk + include maint.mk + include targets.mk + include maint-targets.mk diff --git a/default.mk b/default.mk index f19ac4920..41ed1d101 100644 --- a/default.mk +++ b/default.mk @@ -9,7 +9,7 @@ EMACS = emacs prefix = /usr/share # Where local lisp files go. -lispdir = $(prefix)/emacs/site-lisp +lispdir = $(prefix)/emacs/site-lisp/org # Where info files go. infodir = $(prefix)/info @@ -20,8 +20,8 @@ infodir = $(prefix)/info # Using emacs in batch mode. -BATCH = $(EMACS) -batch -q -no-site-file -eval \ - "(setq load-path (cons (expand-file-name \"./lisp/\") \ +BATCH = $(EMACS) -batch -q -no-site-file -eval \ + "(setq load-path (cons (expand-file-name \".\") \ (cons \"$(lispdir)\" load-path)))" # Specify the byte-compiler for compiling org-mode files @@ -43,7 +43,7 @@ TEXI2HTML = makeinfo --html --number-sections FIND = find # How to remove files -RM = rm +RM = rm -f # How to copy the lisp files and elc files to their destination. # CP = cp -p # try this if there is no install diff --git a/dependencies.mk b/dependencies.mk deleted file mode 100644 index 21e0b225a..000000000 --- a/dependencies.mk +++ /dev/null @@ -1,61 +0,0 @@ -# Dependencies - -lisp/org.elc: lisp/org-macs.el lisp/org-compat.el lisp/org-faces.el -lisp/org-agenda.elc: lisp/org.el -lisp/org-ascii.elc: lisp/org-exp.el -lisp/org-attach.elc: lisp/org.el lisp/org-id.el -lisp/org-archive.elc: lisp/org.el -lisp/org-bbdb.elc: lisp/org.el -lisp/org-beamer.elc: lisp/org.el -lisp/org-bibtex.elc: lisp/org.el -lisp/org-capture.elc: lisp/org.el lisp/org-mks.el -lisp/org-clock.elc: lisp/org.el -lisp/org-colview.elc: lisp/org.el -lisp/org-colview-xemacs.elc: lisp/org.el -lisp/org-compat.elc: lisp/org-macs.el -lisp/org-crypt.elc: lisp/org-crypt.el lisp/org.el -lisp/org-ctags.elc: lisp/org.el -lisp/org-datetree.elc: lisp/org.el -lisp/org-docview.elc: lisp/org.el -lisp/org-entities.elc: -lisp/org-exp.elc: lisp/org.el lisp/org-agenda.el -lisp/org-exp-blocks.elc: lisp/org.el -lisp/org-latex.elc: lisp/org.el lisp/org-exp.el lisp/org-beamer.el -lisp/org-docbook.elc: lisp/org.el lisp/org-exp.el -lisp/org-faces.elc: lisp/org-macs.el lisp/org-compat.el -lisp/org-feed.elc: lisp/org.el -lisp/org-footnotes.elc: lisp/org-macs.el lisp/org-compat.el -lisp/org-freemind.elc: lisp/org.el -lisp/org-gnus.elc: lisp/org.el -lisp/org-html.elc: lisp/org-exp.el -lisp/org-habit.elc: lisp/org.el lisp/org-agenda.el -lisp/org-icalendar.elc: lisp/org-exp.el -lisp/org-id.elc: lisp/org.el -lisp/org-indent.elc: lisp/org.el lisp/org-macs.el lisp/org-compat.el -lisp/org-info.elc: lisp/org.el -lisp/org-inlinetask.elc: -lisp/org-irc.elc: lisp/org.el -lisp/org-jsinfo.elc: lisp/org.el lisp/org-exp.el -lisp/org-list.elc: lisp/org-macs.el lisp/org-compat.el -lisp/org-mac-message.elc: lisp/org.el -lisp/org-macs.elc: -lisp/org-mew.elc: lisp/org.el -lisp/org-mhe.elc: lisp/org.el -lisp/org-mks.elc: -lisp/org-mobile.elc: lisp/org.el -lisp/org-mouse.elc: lisp/org.el -lisp/org-plot.elc: lisp/org.el lisp/org-exp.el lisp/org-table.el -lisp/org-publish.elc: -lisp/org-protocol.elc: lisp/org.el -lisp/org-remember.elc: lisp/org.el -lisp/org-rmail.elc: lisp/org.el -lisp/org-special-blocks.elc: lisp/org-compat.el -lisp/org-src.elc: lisp/org-macs.el lisp/org-compat.el -lisp/org-table.elc: lisp/org.el -lisp/org-taskjuggler.elc: lisp/org.el lisp/org-exp.el -lisp/org-timer.elc: lisp/org.el -lisp/org-vm.elc: lisp/org.el -lisp/org-w3m.elc: lisp/org.el -lisp/org-wl.elc: lisp/org.el -lisp/org-xoxo.elc: lisp/org-exp.el - diff --git a/lisp/Makefile b/lisp/Makefile new file mode 100644 index 000000000..0fb813c68 --- /dev/null +++ b/lisp/Makefile @@ -0,0 +1,38 @@ +LISPO = org-install.el +LISPF = $(subst $(LISPO),,$(wildcard *.el)) +LISPC = $(LISPF:%el=%elc) + +include dependencies.mk + +.PHONY: autoloads compile install clean cleanall + +$(LISPC): dependencies.mk + +compile: $(LISPC) + +autoloads: $(LISPO) + +org-install.el: $(LISPC) + $(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 '(save-buffer)' + +install: $(LISPF) compile autoloads + $(CP) $(LISPC) $(LISPF) $(LISPO) $(lispdir) + +clean: + $(RM) $(LISPC) + +cleanall: + $(RM) $(LISPC) $(LISPO) + +.SUFFIXES: # we don't need default suffix rules +.SUFFIXES: .el .elc + +.el.elc: + $(info in subdir lisp) + $(ELC) $< diff --git a/lisp/dependencies.mk b/lisp/dependencies.mk new file mode 100644 index 000000000..40446fa86 --- /dev/null +++ b/lisp/dependencies.mk @@ -0,0 +1,61 @@ +# Dependencies + +org.elc: org-macs.el org-compat.el org-faces.el +org-agenda.elc: org.el +org-ascii.elc: org-exp.el +org-attach.elc: org.el org-id.el +org-archive.elc: org.el +org-bbdb.elc: org.el +org-beamer.elc: org.el +org-bibtex.elc: org.el +org-capture.elc: org.el org-mks.el +org-clock.elc: org.el +org-colview.elc: org.el +org-colview-xemacs.elc: org.el +org-compat.elc: org-macs.el +org-crypt.elc: org-crypt.el org.el +org-ctags.elc: org.el +org-datetree.elc: org.el +org-docview.elc: org.el +org-entities.elc: +org-exp.elc: org.el org-agenda.el +org-exp-blocks.elc: org.el +org-latex.elc: org.el org-exp.el org-beamer.el +org-docbook.elc: org.el org-exp.el +org-faces.elc: org-macs.el org-compat.el +org-feed.elc: org.el +org-footnotes.elc: org-macs.el org-compat.el +org-freemind.elc: org.el +org-gnus.elc: org.el +org-html.elc: org-exp.el +org-habit.elc: org.el org-agenda.el +org-icalendar.elc: org-exp.el +org-id.elc: org.el +org-indent.elc: org.el org-macs.el org-compat.el +org-info.elc: org.el +org-inlinetask.elc: +org-irc.elc: org.el +org-jsinfo.elc: org.el org-exp.el +org-list.elc: org-macs.el org-compat.el +org-mac-message.elc: org.el +org-macs.elc: +org-mew.elc: org.el +org-mhe.elc: org.el +org-mks.elc: +org-mobile.elc: org.el +org-mouse.elc: org.el +org-plot.elc: org.el org-exp.el org-table.el +org-publish.elc: +org-protocol.elc: org.el +org-remember.elc: org.el +org-rmail.elc: org.el +org-special-blocks.elc: org-compat.el +org-src.elc: org-macs.el org-compat.el +org-table.elc: org.el +org-taskjuggler.elc: org.el org-exp.el +org-timer.elc: org.el +org-vm.elc: org.el +org-w3m.elc: org.el +org-wl.elc: org.el +org-xoxo.elc: org-exp.el + diff --git a/maint.mk b/maint.mk index dc7c0c9c0..ce9847772 100644 --- a/maint.mk +++ b/maint.mk @@ -3,111 +3,6 @@ ##---------------------------------------------------------------------- # The following variables need to be defined by the maintainer -LISPF = org.el \ - org-agenda.el \ - org-ascii.el \ - org-attach.el \ - org-archive.el \ - org-bbdb.el \ - org-beamer.el \ - org-bibtex.el \ - org-capture.el \ - org-clock.el \ - org-colview.el \ - org-colview-xemacs.el \ - org-compat.el \ - org-pcomplete.el \ - org-crypt.el \ - org-ctags.el \ - org-datetree.el \ - org-docview.el \ - org-entities.el \ - org-exp.el \ - org-exp-blocks.el \ - org-docbook.el \ - org-faces.el \ - org-feed.el \ - org-footnote.el \ - org-freemind.el \ - org-gnus.el \ - org-habit.el \ - org-html.el \ - org-icalendar.el \ - org-id.el \ - org-indent.el \ - org-info.el \ - org-inlinetask.el \ - org-jsinfo.el \ - org-irc.el \ - org-latex.el \ - org-list.el \ - org-mac-message.el \ - org-macs.el \ - org-mew.el \ - org-mhe.el \ - org-mks.el \ - org-mobile.el \ - org-mouse.el \ - org-publish.el \ - org-plot.el \ - org-protocol.el \ - org-remember.el \ - org-rmail.el \ - org-special-blocks.el \ - org-src.el \ - org-table.el \ - org-taskjuggler.el \ - org-timer.el \ - org-vm.el \ - org-w3m.el \ - org-wl.el \ - org-xoxo.el \ - ob.el \ - ob-table.el \ - ob-lob.el \ - ob-ref.el \ - ob-exp.el \ - ob-tangle.el \ - ob-comint.el \ - ob-eval.el \ - ob-keys.el \ - ob-awk.el \ - ob-C.el \ - ob-calc.el \ - ob-ditaa.el \ - ob-haskell.el \ - ob-perl.el \ - ob-sh.el \ - ob-R.el \ - ob-dot.el \ - ob-mscgen.el \ - ob-latex.el \ - ob-lisp.el \ - ob-ledger.el \ - ob-python.el \ - ob-sql.el \ - ob-asymptote.el \ - ob-emacs-lisp.el \ - ob-matlab.el \ - ob-ruby.el \ - ob-sqlite.el \ - ob-clojure.el \ - ob-ocaml.el \ - ob-sass.el \ - ob-css.el \ - ob-gnuplot.el \ - ob-octave.el \ - ob-screen.el \ - ob-plantuml.el \ - ob-org.el \ - ob-js.el \ - ob-scheme.el \ - ob-lilypond.el - -LISPFILES0 = $(LISPF:%=lisp/%) -LISPFILES = $(LISPFILES0) lisp/org-install.el -ELCFILES0 = $(LISPFILES0:.el=.elc) -ELCFILES = $(LISPFILES:.el=.elc) DOCFILES = doc/org.texi doc/org.pdf doc/org doc/dir \ doc/pdflayout.sty doc/.nosearch \ doc/orgguide.texi doc/orgguide.pdf diff --git a/targets.mk b/targets.mk index 5ccdf1986..025c955b4 100644 --- a/targets.mk +++ b/targets.mk @@ -1,13 +1,15 @@ -.PHONY: default all up2 update compile \ +.PHONY: default all up2 update compile lisp\ install info html pdf card doc install-lisp install-info \ autoloads cleanall clean cleancontrib cleanelc cleandoc cleanrel .NOTPARALLEL: .PHONY # Additional distribution files DISTFILES_extra= Makefile request-assign-future.txt contrib etc +.EXPORT_ALL_VARIABLES: -default: $(ELCFILES) +lisp compile: + $(MAKE) -C lisp compile -all: default $(INFOFILES) +all: lisp $(INFOFILES) up2: update sudo ${MAKE} install @@ -17,8 +19,6 @@ update: ${MAKE} clean ${MAKE} all -compile: $(ELCFILES0) - install: install-lisp info: doc/org @@ -31,27 +31,17 @@ card: doc/orgcard.pdf doc/orgcard_letter.pdf doc/orgcard.txt doc: html pdf card -install-lisp: $(LISPFILES) default +install-lisp: if [ ! -d $(lispdir) ]; then $(MKDIR) $(lispdir); else true; fi ; - $(CP) $(LISPFILES) $(lispdir) - $(CP) $(ELCFILES) $(lispdir) + $(MAKE) -C lisp install install-info: $(INFOFILES) if [ ! -d $(infodir) ]; then $(MKDIR) $(infodir); else true; fi ; $(CP) $(INFOFILES) $(infodir) $(INSTALL_INFO) --infodir=$(infodir) $(INFOFILES) -autoloads: lisp/org-install.el - -lisp/org-install.el: $(LISPFILES0) maint.mk dependencies.mk - $(BATCH) \ - --eval "(require 'autoload)" \ - --eval '(find-file "org-install.el")' \ - --eval '(erase-buffer)' \ - --eval '(mapc (lambda (x) (generate-file-autoloads (symbol-name x))) (quote ($(LISPFILES0))))' \ - --eval '(insert "\n(provide (quote org-install))\n")' \ - --eval '(save-buffer)' - mv org-install.el lisp +autoloads: lisp maint.mk + $(MAKE) -C lisp autoloads doc/org: doc/org.texi (cd doc && $(MAKEINFO) --no-split org.texi -o org) @@ -75,17 +65,15 @@ doc/orgcard_letter.tex: doc/orgcard.tex doc/orgcard.tex > doc/orgcard_letter.tex cleanall: clean - $(RM) lisp/org-install.el + $(MAKE) -C lisp cleanall -clean: cleanelc cleandoc cleanrel cleancontrib +clean: cleandoc cleanrel cleancontrib + $(MAKE) -C lisp clean -$(FIND) . -name \*~ -exec $(RM) {} \; cleancontrib: -$(FIND) contrib -name \*~ -exec $(RM) {} \; -cleanelc: - rm -f $(ELCFILES) - cleandoc: -(cd doc && rm -f org.pdf org org.html orgcard.pdf orgguide.pdf) -(cd doc && rm -f *.aux *.cp *.cps *.dvi *.fn *.fns *.ky *.kys *.pg *.pgs) @@ -97,6 +85,3 @@ cleanrel: rm -rf RELEASEDIR rm -rf org-7.* rm -rf org-7*zip org-7*tar.gz - -.el.elc: - $(ELC) $< From a5cb04dcd8183a573ac7c60726a5b6993840e051 Mon Sep 17 00:00:00 2001 From: Achim Gratz Date: Sun, 17 Jul 2011 14:49:43 +0200 Subject: [PATCH 05/36] hand off ./doc to sub-make * Makefile: use info function for output and call shell only once * default.mk: add PDFTEX and RMR variables for customization * lisp/Makefile: add target 'all' and create $(lispdir) if necessary * maint-targets.mk: invoke sub-make for HTML manuals * maint.mk: remove unsused VARIABLES * targets.mk: invoke sub-make for ./doc and clean up some targets --- Makefile | 27 +++++++++-------- default.mk | 6 ++++ doc/Makefile | 59 +++++++++++++++++++++++++++++++++++++ lisp/Makefile | 11 +++++-- maint-targets.mk | 13 ++------- maint.mk | 6 ---- targets.mk | 76 +++++++++++++++--------------------------------- 7 files changed, 113 insertions(+), 85 deletions(-) create mode 100644 doc/Makefile diff --git a/Makefile b/Makefile index 174af94da..7037e9a62 100644 --- a/Makefile +++ b/Makefile @@ -7,19 +7,22 @@ # Describe valid make targets for org-mode. .PHONY: targets help targets help: - @echo "make - compile Org ELisp files" - @echo "make clean - clean Elisp and documentation files" - @echo "make all - compile Org ELisp files and documentation" + $(info ) + $(info make - show this help) + $(info ) + $(info make clean - clean Elisp and documentation files) + $(info make all - compile Org ELisp files and documentation) + $(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) @echo "" - @echo "make doc - make all documentation" - @echo "make info - make Info documentation" - @echo "make html - make HTML documentation" - @echo "make pdf - make pdf documentation" - @echo "make card - make refcards documentation" - @echo "" - @echo "make install - install Org" - @echo "make install-lisp - install Org ELisp files" - @echo "make install-info - install Org Info file" include default.mk -include local.mk diff --git a/default.mk b/default.mk index 41ed1d101..cb92181ba 100644 --- a/default.mk +++ b/default.mk @@ -30,6 +30,9 @@ ELC = $(BATCH) -f batch-byte-compile # How to make a pdf file from a texinfo file TEXI2PDF = texi2pdf +# How to make a pdf file from a tex file +PDFTEX = pdftex + # How to create directories MKDIR = mkdir -p @@ -45,6 +48,9 @@ FIND = find # How to remove files RM = rm -f +# How to remove files recursively +RMR = rm -fr + # How to copy the lisp files and elc files to their destination. # CP = cp -p # try this if there is no install CP = install -p diff --git a/doc/Makefile b/doc/Makefile new file mode 100644 index 000000000..251ee568c --- /dev/null +++ b/doc/Makefile @@ -0,0 +1,59 @@ +ifeq ($(MAKELEVEL), 0) + $(error This make needs to be started as a sub-make from the toplevel directory.) +endif + +.PHONY: all info html pdf card manual guide install clean cleanall + +all: info html pdf card + +info: org + +html: org.html + +pdf: org.pdf orgguide.pdf + +card: orgcard.pdf orgcard_letter.pdf orgguide.pdf + +manual guide:: + $(RMR) $@ ; $(MKDIR) $@ +manual:: org.texi + $(TEXI2HTML) -o $@ $< + ../UTILITIES/mansplit.pl $@/* +guide:: orgguide.texi + $(TEXI2HTML) -o $@ $< + ../UTILITIES/guidesplit.pl $@/* + + +install: org + if [ ! -d $(infodir) ]; then $(MKDIR) $(infodir); else true; fi ; + $(CP) org $(infodir) + $(INSTALL_INFO) --infodir=$(infodir) org + +clean cleanall: + $(RM) dir org *.pdf *.html *_letter.tex \ + *.aux *.cp *.cps *.dvi *.fn *.fns *.ky *.kys *.pg *.pgs \ + *.toc *.tp *.tps *.vr *.vrs *.log *.html *.ps + +.SUFFIXES: # we don't need default suffix rules +.SUFFIXES: .texi .tex .txt + +%: %.texi + $(MAKEINFO) --no-split $< -o $@ + +%.pdf: LC_ALL=C # work around a bug in texi2dvi +%.pdf: LANG=C # work around a bug in texi2dvi +%.pdf: %.texi + $(TEXI2PDF) $< +%.pdf: %.tex + PDFLATEX=$(PDFTEX) $(TEXI2PDF) $< + +%.html: %.texi + $(TEXI2HTML) --no-split -o $@ $< + ../UTILITIES/manfull.pl $@ + +%.txt: %.tex + perl ../UTILITIES/orgcard2txt.pl $< > $@ + +%_letter.tex: %.tex + perl -pe 's/\\pdflayout=\(0l\)/\\pdflayout=(1l)/' \ + $< > $@ diff --git a/lisp/Makefile b/lisp/Makefile index 0fb813c68..b14d6f131 100644 --- a/lisp/Makefile +++ b/lisp/Makefile @@ -1,3 +1,7 @@ +ifeq ($(MAKELEVEL), 0) + $(error This make needs to be started as a sub-make from the toplevel directory.) +endif + LISPO = org-install.el LISPF = $(subst $(LISPO),,$(wildcard *.el)) LISPC = $(LISPF:%el=%elc) @@ -6,9 +10,7 @@ include dependencies.mk .PHONY: autoloads compile install clean cleanall -$(LISPC): dependencies.mk - -compile: $(LISPC) +all compile: $(LISPC) autoloads: $(LISPO) @@ -22,6 +24,7 @@ org-install.el: $(LISPC) --eval '(save-buffer)' install: $(LISPF) compile autoloads + if [ ! -d $(lispdir) ]; then $(MKDIR) $(lispdir); else true; fi ; $(CP) $(LISPC) $(LISPF) $(LISPO) $(lispdir) clean: @@ -30,6 +33,8 @@ clean: cleanall: $(RM) $(LISPC) $(LISPO) +$(LISPC): dependencies.mk + .SUFFIXES: # we don't need default suffix rules .SUFFIXES: .el .elc diff --git a/maint-targets.mk b/maint-targets.mk index 3d71d7a18..f44888cd3 100644 --- a/maint-targets.mk +++ b/maint-targets.mk @@ -11,17 +11,8 @@ p: pdf g: pdf open doc/orgguide.pdf -html_manual: doc/org.texi - rm -rf doc/manual - mkdir doc/manual - $(TEXI2HTML) -o doc/manual doc/org.texi - UTILITIES/mansplit.pl doc/manual/*.html - -html_guide: doc/orgguide.texi - rm -rf doc/guide - mkdir doc/guide - $(TEXI2HTML) -o doc/guide doc/orgguide.texi - UTILITIES/guidesplit.pl doc/guide/*.html +html_manual html_guide: + $(MAKE) -C doc $(@:html_%=%) testrelease: git checkout -b testrelease origin/maint diff --git a/maint.mk b/maint.mk index ce9847772..0f4189674 100644 --- a/maint.mk +++ b/maint.mk @@ -3,12 +3,6 @@ ##---------------------------------------------------------------------- # The following variables need to be defined by the maintainer -DOCFILES = doc/org.texi doc/org.pdf doc/org doc/dir \ - doc/pdflayout.sty doc/.nosearch \ - doc/orgguide.texi doc/orgguide.pdf -CARDFILES = doc/orgcard.tex doc/orgcard.pdf doc/orgcard_letter.pdf -TEXIFILES = doc/org.texi -INFOFILES = doc/org # Package Manager (ELPA) PKG_TAG = $(shell date +%Y%m%d) diff --git a/targets.mk b/targets.mk index 025c955b4..df54cf35f 100644 --- a/targets.mk +++ b/targets.mk @@ -1,4 +1,4 @@ -.PHONY: default all up2 update compile lisp\ +.PHONY: default all up2 update compile lisp doc \ install info html pdf card doc install-lisp install-info \ autoloads cleanall clean cleancontrib cleanelc cleandoc cleanrel .NOTPARALLEL: .PHONY @@ -6,10 +6,14 @@ DISTFILES_extra= Makefile request-assign-future.txt contrib etc .EXPORT_ALL_VARIABLES: -lisp compile: - $(MAKE) -C lisp compile +LISPDIRS = lisp #contrib +SUBDIRS = doc $(LISPDIRS) #contrib -all: lisp $(INFOFILES) +compile: lisp + $(MAKE) -C $< $@ + +all: $(SUBDIRS) + $(foreach dir, $?, $(MAKE) -C $(dir) $@;) up2: update sudo ${MAKE} install @@ -19,69 +23,35 @@ update: ${MAKE} clean ${MAKE} all -install: install-lisp +install: install-lisp install-info -info: doc/org +docs: info html pdf card -html: doc/org.html - -pdf: doc/org.pdf doc/orgguide.pdf - -card: doc/orgcard.pdf doc/orgcard_letter.pdf doc/orgcard.txt - -doc: html pdf card +info html pdf card: + $(MAKE) -C doc $@ install-lisp: - if [ ! -d $(lispdir) ]; then $(MKDIR) $(lispdir); else true; fi ; $(MAKE) -C lisp install -install-info: $(INFOFILES) - if [ ! -d $(infodir) ]; then $(MKDIR) $(infodir); else true; fi ; - $(CP) $(INFOFILES) $(infodir) - $(INSTALL_INFO) --infodir=$(infodir) $(INFOFILES) +install-info: + $(MAKE) -C doc install autoloads: lisp maint.mk - $(MAKE) -C lisp autoloads + $(MAKE) -C $< $@ -doc/org: doc/org.texi - (cd doc && $(MAKEINFO) --no-split org.texi -o org) +cleanall: $(SUBDIRS) + $(foreach dir, $?, $(MAKE) -C $(dir) $@;) + -$(FIND) . -name \*~ -exec $(RM) {} \; -doc/%.pdf: LC_ALL=C # work around a bug in texi2dvi -doc/%.pdf: LANG=C # work around a bug in texi2dvi -doc/%.pdf: doc/%.texi - (cd doc && $(TEXI2PDF) $( orgcard.txt) - -doc/orgcard_letter.tex: doc/orgcard.tex - perl -pe 's/\\pdflayout=\(0l\)/\\pdflayout=(1l)/' \ - doc/orgcard.tex > doc/orgcard_letter.tex - -cleanall: clean - $(MAKE) -C lisp cleanall - -clean: cleandoc cleanrel cleancontrib +clean: cleanrel $(MAKE) -C lisp clean + $(MAKE) -C doc clean -$(FIND) . -name \*~ -exec $(RM) {} \; cleancontrib: -$(FIND) contrib -name \*~ -exec $(RM) {} \; -cleandoc: - -(cd doc && rm -f org.pdf org org.html orgcard.pdf orgguide.pdf) - -(cd doc && rm -f *.aux *.cp *.cps *.dvi *.fn *.fns *.ky *.kys *.pg *.pgs) - -(cd doc && rm -f *.toc *.tp *.tps *.vr *.vrs *.log *.html *.ps) - -(cd doc && rm -f orgcard_letter.tex orgcard_letter.pdf) - -(cd doc && rm -rf manual) - cleanrel: - rm -rf RELEASEDIR - rm -rf org-7.* - rm -rf org-7*zip org-7*tar.gz + $(RMR) RELEASEDIR + $(RMR) org-7.* + $(RMR) org-7*zip org-7*tar.gz From f29ef857ae7a3ad4d191a3c167f9c96d8faf61bd Mon Sep 17 00:00:00 2001 From: Achim Gratz Date: Sun, 17 Jul 2011 16:54:47 +0200 Subject: [PATCH 06/36] inject git-describe version into org.el during install * lisp/org.el (org-git-version): placeholder for recording the Git version of org during install * lisp/org.el (org-version): initialize local git-version with placeholder and fall through using it when org is not installed in a Git repository --- lisp/Makefile | 7 +++++++ lisp/org.el | 11 +++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/lisp/Makefile b/lisp/Makefile index b14d6f131..963d08c8a 100644 --- a/lisp/Makefile +++ b/lisp/Makefile @@ -2,6 +2,11 @@ ifeq ($(MAKELEVEL), 0) $(error This make needs to be started as a sub-make from the toplevel directory.) endif +GITVERSION = $(shell git describe --abbrev=6 HEAD) +ifneq ($(shell git status -uno --porcelain), '') + GITVERSION := $(GITVERSION).dirty +endif + LISPO = org-install.el LISPF = $(subst $(LISPO),,$(wildcard *.el)) LISPC = $(LISPF:%el=%elc) @@ -26,6 +31,8 @@ org-install.el: $(LISPC) install: $(LISPF) compile autoloads if [ ! -d $(lispdir) ]; then $(MKDIR) $(lispdir); else true; fi ; $(CP) $(LISPC) $(LISPF) $(LISPO) $(lispdir) + perl -i -pe 's/^(\(defconst org-git-version ).*/\1 "$(GITVERSION)"/;' $(lispdir)/org.el + $(MAKE) $(lispdir)/org.elc clean: $(RM) $(LISPC) diff --git a/lisp/org.el b/lisp/org.el index b2b140c48..c76103878 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -212,6 +212,10 @@ identifier." (defconst org-version "7.8.09" "The version number of the file org.el.") +(defconst org-git-version "N/A" + "The Git version of org-mode. Inserted by installing org-mode + or when a release is made.") + ;;;###autoload (defun org-version (&optional here) "Show the org-mode version in the echo area. @@ -219,7 +223,7 @@ With prefix arg HERE, insert it at point." (interactive "P") (let* ((origin default-directory) (version org-version) - (git-version) + (git-version org-git-version) (dir (concat (file-name-directory (locate-library "org")) "../" ))) (when (and (file-exists-p (expand-file-name ".git" dir)) (executable-find "git")) @@ -232,12 +236,11 @@ With prefix arg HERE, insert it at point." (setq git-version (buffer-substring (point) (point-at-eol)))) (subst-char-in-string ?- ?. git-version t) (when (string-match "\\S-" - (shell-command-to-string - "git diff-index --name-only HEAD --")) + (shell-command-to-string "git status -uno --porcelain")) (setq git-version (concat git-version ".dirty"))) (setq version (concat version " (" git-version ")")))) (cd origin))) - (setq version (format "Org-mode version %s" version)) + (setq version (format "Org-mode version %s (%s)" version git-version)) (if here (insert version)) (message version))) From 00d357ab9822bbc2c8808d44256d9b490d6cf281 Mon Sep 17 00:00:00 2001 From: Achim Gratz Date: Sun, 17 Jul 2011 17:24:08 +0200 Subject: [PATCH 07/36] keep Emacs' Changelog clean * UTILITIES/make_emacs_changelog: remove UTILITIES/ and all Makefiles from Emacs' Changelog --- UTILITIES/make_emacs_changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/UTILITIES/make_emacs_changelog b/UTILITIES/make_emacs_changelog index 8d14a757d..565bc6438 100755 --- a/UTILITIES/make_emacs_changelog +++ b/UTILITIES/make_emacs_changelog @@ -59,8 +59,8 @@ for $i (0..$#commits) { # remove stuff which is not for this output if ($kind =~ /\S/) { - remove_parts("contrib/","testing/","xemacs/"); - remove_parts("Makefile","README"); + remove_parts("contrib/","testing/","xemacs/","UTILITIES/"); + remove_parts(".*Makefile","README",".+\.mk"); } if ($kind eq "lisp") { remove_parts("doc/") } if ($kind eq "texi") { remove_parts("lisp/","doc/orgcard","doc/orgguide") } From 501f9b17419ffaafa0ab2d167247a393ab855d7f Mon Sep 17 00:00:00 2001 From: Achim Gratz Date: Mon, 18 Jul 2011 17:55:23 +0200 Subject: [PATCH 08/36] use sed instead of perl, add target clean-install * Makefile, lisp/Makefile, doc/Makefile: add target clean-install to remove files in install-directories * default.mk: add customization variable $(SED) * doc/Makefile: do not remove dir while cleaning * lisp/Makefile: use sed instead of perl to weave git-status into org.el and ignore any errors while doing it. Keep git status in $(GITSTATUS) to make it more clear what happens in the check. --- default.mk | 3 +++ doc/Makefile | 8 ++++++-- lisp/Makefile | 17 +++++++++++------ targets.mk | 3 ++- 4 files changed, 22 insertions(+), 9 deletions(-) diff --git a/default.mk b/default.mk index cb92181ba..cb61ff38c 100644 --- a/default.mk +++ b/default.mk @@ -51,6 +51,9 @@ RM = rm -f # How to remove files recursively RMR = rm -fr +# How to stream edit a file +SED = sed + # How to copy the lisp files and elc files to their destination. # CP = cp -p # try this if there is no install CP = install -p diff --git a/doc/Makefile b/doc/Makefile index 251ee568c..8ce532828 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -2,7 +2,7 @@ ifeq ($(MAKELEVEL), 0) $(error This make needs to be started as a sub-make from the toplevel directory.) endif -.PHONY: all info html pdf card manual guide install clean cleanall +.PHONY: all info html pdf card manual guide install clean cleanall clean-install all: info html pdf card @@ -30,10 +30,14 @@ install: org $(INSTALL_INFO) --infodir=$(infodir) org clean cleanall: - $(RM) dir org *.pdf *.html *_letter.tex \ + $(RM) org *.pdf *.html *_letter.tex \ *.aux *.cp *.cps *.dvi *.fn *.fns *.ky *.kys *.pg *.pgs \ *.toc *.tp *.tps *.vr *.vrs *.log *.html *.ps +clean-install: + $(RM) $(infodir)/org* + @echo You should run $(INSTALL_INFO) again to correct dir entries. + .SUFFIXES: # we don't need default suffix rules .SUFFIXES: .texi .tex .txt diff --git a/lisp/Makefile b/lisp/Makefile index 963d08c8a..0845113f1 100644 --- a/lisp/Makefile +++ b/lisp/Makefile @@ -2,8 +2,9 @@ ifeq ($(MAKELEVEL), 0) $(error This make needs to be started as a sub-make from the toplevel directory.) endif -GITVERSION = $(shell git describe --abbrev=6 HEAD) -ifneq ($(shell git status -uno --porcelain), '') +GITVERSION = $(shell git describe --abbrev=6 HEAD) +GITSTATUS = $(shell git status -uno --porcelain) +ifneq ("$(GITSTATUS)", "") GITVERSION := $(GITVERSION).dirty endif @@ -13,7 +14,7 @@ LISPC = $(LISPF:%el=%elc) include dependencies.mk -.PHONY: autoloads compile install clean cleanall +.PHONY: all autoloads compile install clean cleanall clean-install all compile: $(LISPC) @@ -31,14 +32,18 @@ org-install.el: $(LISPC) install: $(LISPF) compile autoloads if [ ! -d $(lispdir) ]; then $(MKDIR) $(lispdir); else true; fi ; $(CP) $(LISPC) $(LISPF) $(LISPO) $(lispdir) - perl -i -pe 's/^(\(defconst org-git-version ).*/\1 "$(GITVERSION)"/;' $(lispdir)/org.el + -$(SED) -e 's/^\((defconst org-git-version \).*/\1 "$(GITVERSION)"/;' org.el > $(lispdir)/org.el $(MAKE) $(lispdir)/org.elc clean: - $(RM) $(LISPC) + $(RM) *.elc cleanall: - $(RM) $(LISPC) $(LISPO) + $(RM) *.elc $(LISPO) + +clean-install: + if [ ! -d $(lispdir) ]; then $(MKDIR) $(lispdir); else true; fi ; + $(RM) $(lispdir)/org*.el* $(lispdir)/ob*.el* $(LISPC): dependencies.mk diff --git a/targets.mk b/targets.mk index df54cf35f..219e61cc5 100644 --- a/targets.mk +++ b/targets.mk @@ -12,7 +12,8 @@ SUBDIRS = doc $(LISPDIRS) #contrib compile: lisp $(MAKE) -C $< $@ -all: $(SUBDIRS) +all \ +clean-install: $(SUBDIRS) $(foreach dir, $?, $(MAKE) -C $(dir) $@;) up2: update From 8bbf77a748685b3cb99b8de1fe8fedc4fcced4f9 Mon Sep 17 00:00:00 2001 From: Achim Gratz Date: Mon, 18 Jul 2011 21:05:52 +0200 Subject: [PATCH 09/36] finish cleanup on infodir, some refinements on rules * doc/Makefile: cleanall additionally removes the directories for manual and guide; fix the dir file in infodir after removal of org documentation * lisp/Makefile: remove debug statement --- doc/Makefile | 6 ++++-- lisp/Makefile | 1 - 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/Makefile b/doc/Makefile index 8ce532828..1a1172e86 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -29,14 +29,16 @@ install: org $(CP) org $(infodir) $(INSTALL_INFO) --infodir=$(infodir) org -clean cleanall: +clean: $(RM) org *.pdf *.html *_letter.tex \ *.aux *.cp *.cps *.dvi *.fn *.fns *.ky *.kys *.pg *.pgs \ *.toc *.tp *.tps *.vr *.vrs *.log *.html *.ps +cleanall: clean + $(RMR) guide manual clean-install: $(RM) $(infodir)/org* - @echo You should run $(INSTALL_INFO) again to correct dir entries. + $(INSTALL_INFO) --infodir=$(infodir) --remove org .SUFFIXES: # we don't need default suffix rules .SUFFIXES: .texi .tex .txt diff --git a/lisp/Makefile b/lisp/Makefile index 0845113f1..c8cbc2b69 100644 --- a/lisp/Makefile +++ b/lisp/Makefile @@ -51,5 +51,4 @@ $(LISPC): dependencies.mk .SUFFIXES: .el .elc .el.elc: - $(info in subdir lisp) $(ELC) $< From 236b79da67e46889937e048cf514a6adeff174a9 Mon Sep 17 00:00:00 2001 From: Achim Gratz Date: Tue, 19 Jul 2011 20:05:14 +0200 Subject: [PATCH 10/36] prepare for additional subdirs for "install" * targets.mk: modify install target to be based on pattern match so that additional SUBDIRS will be automatically processed --- targets.mk | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/targets.mk b/targets.mk index 219e61cc5..b35cfa1b6 100644 --- a/targets.mk +++ b/targets.mk @@ -1,13 +1,15 @@ -.PHONY: default all up2 update compile lisp doc \ - install info html pdf card doc install-lisp install-info \ - autoloads cleanall clean cleancontrib cleanelc cleandoc cleanrel .NOTPARALLEL: .PHONY # Additional distribution files DISTFILES_extra= Makefile request-assign-future.txt contrib etc .EXPORT_ALL_VARIABLES: -LISPDIRS = lisp #contrib -SUBDIRS = doc $(LISPDIRS) #contrib +LISPDIRS = lisp +SUBDIRS = doc $(LISPDIRS) +INSTSUB = $(SUBDIRS:%=install-%) + +.PHONY: default all up2 update compile lisp doc \ + install info html pdf card docs $(INSTSUB) \ + autoloads cleanall clean cleancontrib cleanelc cleandoc cleanrel compile: lisp $(MAKE) -C $< $@ @@ -24,18 +26,17 @@ update: ${MAKE} clean ${MAKE} all -install: install-lisp install-info +install: $(INSTSUB) + +install-info: install-doc docs: info html pdf card info html pdf card: $(MAKE) -C doc $@ -install-lisp: - $(MAKE) -C lisp install - -install-info: - $(MAKE) -C doc install +$(INSTSUB): + $(MAKE) -C $(@:install-%=%) install autoloads: lisp maint.mk $(MAKE) -C $< $@ From 465adbdae35d737246857e7412ab5ca82b8497f4 Mon Sep 17 00:00:00 2001 From: Achim Gratz Date: Sun, 25 Sep 2011 11:17:53 +0200 Subject: [PATCH 11/36] Always "make clean" for lisp files before compiling them * Makefile: prepend "make clean" in lisp directory when compiling Rationale: Emacs prefers the compiled lisp files even if the source is newer. In case of circular dependencies or if the dependencies file is not correct, the compiled files might not reflect the sources. Since there is no canonical way to remove all compiled files which are stale (it can be hacked, but it is really ugly), it seems more prudent to just always remove the compiled files before starting the compilation. Most folks already already do that anyway. --- targets.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/targets.mk b/targets.mk index b35cfa1b6..d61b6e247 100644 --- a/targets.mk +++ b/targets.mk @@ -12,6 +12,7 @@ INSTSUB = $(SUBDIRS:%=install-%) autoloads cleanall clean cleancontrib cleanelc cleandoc cleanrel compile: lisp + $(MAKE) -C $< clean $(MAKE) -C $< $@ all \ From c74d93b8c61f6c18fc15432ba71800cc75a6bb51 Mon Sep 17 00:00:00 2001 From: Achim Gratz Date: Sun, 25 Sep 2011 11:34:58 +0200 Subject: [PATCH 12/36] remove dependencies.mk since it is not needed any more * lisp/dependencies.mk: remove file * lisp/Makefile: remove dependency on dependencies.mk Rationale: since we will always start with a "make clean", the dependencies file has become obsolete. The dependencies had not been updated for a long time anyway and there seems to be no way to produce them automatically. --- lisp/Makefile | 4 --- lisp/dependencies.mk | 61 -------------------------------------------- 2 files changed, 65 deletions(-) delete mode 100644 lisp/dependencies.mk diff --git a/lisp/Makefile b/lisp/Makefile index c8cbc2b69..6ac5447a8 100644 --- a/lisp/Makefile +++ b/lisp/Makefile @@ -12,8 +12,6 @@ LISPO = org-install.el LISPF = $(subst $(LISPO),,$(wildcard *.el)) LISPC = $(LISPF:%el=%elc) -include dependencies.mk - .PHONY: all autoloads compile install clean cleanall clean-install all compile: $(LISPC) @@ -45,8 +43,6 @@ clean-install: if [ ! -d $(lispdir) ]; then $(MKDIR) $(lispdir); else true; fi ; $(RM) $(lispdir)/org*.el* $(lispdir)/ob*.el* -$(LISPC): dependencies.mk - .SUFFIXES: # we don't need default suffix rules .SUFFIXES: .el .elc diff --git a/lisp/dependencies.mk b/lisp/dependencies.mk deleted file mode 100644 index 40446fa86..000000000 --- a/lisp/dependencies.mk +++ /dev/null @@ -1,61 +0,0 @@ -# Dependencies - -org.elc: org-macs.el org-compat.el org-faces.el -org-agenda.elc: org.el -org-ascii.elc: org-exp.el -org-attach.elc: org.el org-id.el -org-archive.elc: org.el -org-bbdb.elc: org.el -org-beamer.elc: org.el -org-bibtex.elc: org.el -org-capture.elc: org.el org-mks.el -org-clock.elc: org.el -org-colview.elc: org.el -org-colview-xemacs.elc: org.el -org-compat.elc: org-macs.el -org-crypt.elc: org-crypt.el org.el -org-ctags.elc: org.el -org-datetree.elc: org.el -org-docview.elc: org.el -org-entities.elc: -org-exp.elc: org.el org-agenda.el -org-exp-blocks.elc: org.el -org-latex.elc: org.el org-exp.el org-beamer.el -org-docbook.elc: org.el org-exp.el -org-faces.elc: org-macs.el org-compat.el -org-feed.elc: org.el -org-footnotes.elc: org-macs.el org-compat.el -org-freemind.elc: org.el -org-gnus.elc: org.el -org-html.elc: org-exp.el -org-habit.elc: org.el org-agenda.el -org-icalendar.elc: org-exp.el -org-id.elc: org.el -org-indent.elc: org.el org-macs.el org-compat.el -org-info.elc: org.el -org-inlinetask.elc: -org-irc.elc: org.el -org-jsinfo.elc: org.el org-exp.el -org-list.elc: org-macs.el org-compat.el -org-mac-message.elc: org.el -org-macs.elc: -org-mew.elc: org.el -org-mhe.elc: org.el -org-mks.elc: -org-mobile.elc: org.el -org-mouse.elc: org.el -org-plot.elc: org.el org-exp.el org-table.el -org-publish.elc: -org-protocol.elc: org.el -org-remember.elc: org.el -org-rmail.elc: org.el -org-special-blocks.elc: org-compat.el -org-src.elc: org-macs.el org-compat.el -org-table.elc: org.el -org-taskjuggler.elc: org.el org-exp.el -org-timer.elc: org.el -org-vm.elc: org.el -org-w3m.elc: org.el -org-wl.elc: org.el -org-xoxo.elc: org-exp.el - From 306c748f6380c6c555f84f2079c4d57f9810b4d6 Mon Sep 17 00:00:00 2001 From: Achim Gratz Date: Fri, 28 Oct 2011 10:33:15 +0200 Subject: [PATCH 13/36] inject git-describe version and date into org manual * doc/Makefile: introduce target for git-describe.texi, which is an automatically generated file that records the output of git-describe and date; remove this file during make clean * doc/org.texi: remove @set for VERSION and DATE and do an @include git-describe.texi instead --- doc/Makefile | 18 ++++++++++++++++-- doc/org.texi | 3 +-- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/doc/Makefile b/doc/Makefile index 1a1172e86..3ca04483a 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -2,6 +2,14 @@ ifeq ($(MAKELEVEL), 0) $(error This make needs to be started as a sub-make from the toplevel directory.) endif +GITVERSION = $(shell git describe --abbrev=6 HEAD) +ORGVERSION = $(subst release_,,$(shell git describe --abbrev=0 HEAD)) +GITSTATUS = $(shell git status -uno --porcelain) +DATE = $(shell date +%Y-%m-%d) +ifneq ("$(GITSTATUS)", "") + GITVERSION := $(GITVERSION).dirty +endif + .PHONY: all info html pdf card manual guide install clean cleanall clean-install all: info html pdf card @@ -23,6 +31,11 @@ guide:: orgguide.texi $(TEXI2HTML) -o $@ $< ../UTILITIES/guidesplit.pl $@/* +git-describe.texi: org.texi + @echo "@c automatically generated, do not edit" > git-describe.texi + @echo "@set VERSION $(ORGVERSION) ($(GITVERSION))" >> git-describe.texi + @echo "@set DATE $(DATE)" >> git-describe.texi + install: org if [ ! -d $(infodir) ]; then $(MKDIR) $(infodir); else true; fi ; @@ -32,7 +45,7 @@ install: org clean: $(RM) org *.pdf *.html *_letter.tex \ *.aux *.cp *.cps *.dvi *.fn *.fns *.ky *.kys *.pg *.pgs \ - *.toc *.tp *.tps *.vr *.vrs *.log *.html *.ps + *.toc *.tp *.tps *.vr *.vrs *.log *.html *.ps git-describe.texi cleanall: clean $(RMR) guide manual @@ -44,6 +57,7 @@ clean-install: .SUFFIXES: .texi .tex .txt %: %.texi + $(MAKE) git-describe.texi $(MAKEINFO) --no-split $< -o $@ %.pdf: LC_ALL=C # work around a bug in texi2dvi @@ -61,5 +75,5 @@ clean-install: perl ../UTILITIES/orgcard2txt.pl $< > $@ %_letter.tex: %.tex - perl -pe 's/\\pdflayout=\(0l\)/\\pdflayout=(1l)/' \ + $(SED) -e 's/\\pdflayout=(0l)/\\pdflayout=(1l)/' \ $< > $@ diff --git a/doc/org.texi b/doc/org.texi index fd2835294..467293e72 100644 --- a/doc/org.texi +++ b/doc/org.texi @@ -4,8 +4,7 @@ @setfilename ../../info/org @settitle The Org Manual -@set VERSION 7.8.09 -@set DATE April 2012 +@include git-describe.texi @c Use proper quote and backtick for code sections in PDF output @c Cf. Texinfo manual 14.2 From 6da2d089b0c0f165134e33e12267a51a9ac41f52 Mon Sep 17 00:00:00 2001 From: Achim Gratz Date: Sun, 6 Nov 2011 17:53:45 +0100 Subject: [PATCH 14/36] move all version strings into org-install.el * targets.mk: check for release and git version and record this into environment variables for use in sub-make invocations; add new target "compile-dirty" that does not invoke "make clean" first * doc/Makefile, lisp/Makefile: remove git version check, since they are now provided by first-level make * lisp/Makefile: add insertion of version information into org-install.el, have org-install.el depend on LISPF rather than LISPC so that autoloads can be produced without compiling everything and remove insertion into org.el and re-compilation during install; add new target "compile-dirty" to support invocation from first-level make * lisp/org.el (org-version): remove determination of version information, show "N/A" if the information is not provided via org-install.el --- doc/Makefile | 8 -------- lisp/Makefile | 16 ++++++---------- lisp/org.el | 28 ++-------------------------- targets.mk | 13 ++++++++++++- 4 files changed, 20 insertions(+), 45 deletions(-) diff --git a/doc/Makefile b/doc/Makefile index 3ca04483a..04c4fb81d 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -2,14 +2,6 @@ ifeq ($(MAKELEVEL), 0) $(error This make needs to be started as a sub-make from the toplevel directory.) endif -GITVERSION = $(shell git describe --abbrev=6 HEAD) -ORGVERSION = $(subst release_,,$(shell git describe --abbrev=0 HEAD)) -GITSTATUS = $(shell git status -uno --porcelain) -DATE = $(shell date +%Y-%m-%d) -ifneq ("$(GITSTATUS)", "") - GITVERSION := $(GITVERSION).dirty -endif - .PHONY: all info html pdf card manual guide install clean cleanall clean-install all: info html pdf card diff --git a/lisp/Makefile b/lisp/Makefile index 6ac5447a8..6b6739249 100644 --- a/lisp/Makefile +++ b/lisp/Makefile @@ -2,36 +2,32 @@ ifeq ($(MAKELEVEL), 0) $(error This make needs to be started as a sub-make from the toplevel directory.) endif -GITVERSION = $(shell git describe --abbrev=6 HEAD) -GITSTATUS = $(shell git status -uno --porcelain) -ifneq ("$(GITSTATUS)", "") - GITVERSION := $(GITVERSION).dirty -endif - LISPO = org-install.el LISPF = $(subst $(LISPO),,$(wildcard *.el)) LISPC = $(LISPF:%el=%elc) .PHONY: all autoloads compile install clean cleanall clean-install -all compile: $(LISPC) +all \ +compile \ +compile-dirty: $(LISPC) autoloads: $(LISPO) -org-install.el: $(LISPC) +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)' install: $(LISPF) compile autoloads if [ ! -d $(lispdir) ]; then $(MKDIR) $(lispdir); else true; fi ; $(CP) $(LISPC) $(LISPF) $(LISPO) $(lispdir) - -$(SED) -e 's/^\((defconst org-git-version \).*/\1 "$(GITVERSION)"/;' org.el > $(lispdir)/org.el - $(MAKE) $(lispdir)/org.elc clean: $(RM) *.elc diff --git a/lisp/org.el b/lisp/org.el index c76103878..988815787 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -7,7 +7,6 @@ ;; Maintainer: Bastien Guerry ;; Keywords: outlines, hypermedia, calendar, wp ;; Homepage: http://orgmode.org -;; Version: 7.8.09 ;; ;; This file is part of GNU Emacs. ;; @@ -209,37 +208,14 @@ identifier." ;;; Version -(defconst org-version "7.8.09" - "The version number of the file org.el.") - -(defconst org-git-version "N/A" - "The Git version of org-mode. Inserted by installing org-mode - or when a release is made.") - -;;;###autoload (defun org-version (&optional here) "Show the org-mode version in the echo area. With prefix arg HERE, insert it at point." (interactive "P") (let* ((origin default-directory) - (version org-version) - (git-version org-git-version) + (version (if (boundp 'org-release) org-release "N/A")) + (git-version (if (boundp 'org-git-version) org-git-version "N/A")) (dir (concat (file-name-directory (locate-library "org")) "../" ))) - (when (and (file-exists-p (expand-file-name ".git" dir)) - (executable-find "git")) - (unwind-protect - (progn - (cd dir) - (when (eql 0 (shell-command "git describe --abbrev=4 HEAD")) - (with-current-buffer "*Shell Command Output*" - (goto-char (point-min)) - (setq git-version (buffer-substring (point) (point-at-eol)))) - (subst-char-in-string ?- ?. git-version t) - (when (string-match "\\S-" - (shell-command-to-string "git status -uno --porcelain")) - (setq git-version (concat git-version ".dirty"))) - (setq version (concat version " (" git-version ")")))) - (cd origin))) (setq version (format "Org-mode version %s (%s)" version git-version)) (if here (insert version)) (message version))) diff --git a/targets.mk b/targets.mk index d61b6e247..ab333a2b3 100644 --- a/targets.mk +++ b/targets.mk @@ -7,12 +7,23 @@ LISPDIRS = lisp SUBDIRS = doc $(LISPDIRS) INSTSUB = $(SUBDIRS:%=install-%) +GITVERSION = $(shell git describe --abbrev=6 HEAD) +ORGVERSION = $(subst release_,,$(shell git describe --abbrev=0 HEAD)) +GITSTATUS = $(shell git status -uno --porcelain) +DATE = $(shell date +%Y-%m-%d) +ifneq ("$(GITSTATUS)", "") + GITVERSION := $(GITVERSION).dirty +endif + .PHONY: default all up2 update compile lisp doc \ install info html pdf card docs $(INSTSUB) \ autoloads cleanall clean cleancontrib cleanelc cleandoc cleanrel -compile: lisp +compile:: lisp $(MAKE) -C $< clean + +compile \ +compile-dirty:: lisp $(MAKE) -C $< $@ all \ From cb8600b1ba15565f696ebfd34fc169508678262b Mon Sep 17 00:00:00 2001 From: Achim Gratz Date: Sun, 6 Nov 2011 18:36:19 +0100 Subject: [PATCH 15/36] show installation path or org-install.el to avoid mishaps with multiple installations * lisp/org.el (org-version): show the full path to org-install.el in the version string to avoid confusion if multiple installations exist or a previously loaded org-install.el has already defined a version string that is now out of date. --- lisp/org.el | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 988815787..13801484c 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -111,6 +111,7 @@ (declare-function org-at-clock-log-p "org-clock" ()) (declare-function org-clock-timestamps-up "org-clock" ()) (declare-function org-clock-timestamps-down "org-clock" ()) +(declare-function find-library-name "find-func") ;; babel (require 'ob) @@ -208,6 +209,7 @@ identifier." ;;; Version +;;;###autoload (defun org-version (&optional here) "Show the org-mode version in the echo area. With prefix arg HERE, insert it at point." @@ -215,8 +217,11 @@ With prefix arg HERE, insert it at point." (let* ((origin default-directory) (version (if (boundp 'org-release) org-release "N/A")) (git-version (if (boundp 'org-git-version) org-git-version "N/A")) - (dir (concat (file-name-directory (locate-library "org")) "../" ))) - (setq version (format "Org-mode version %s (%s)" version git-version)) + (org-install (ignore-errors (find-library-name "org-install")))) + (setq version (format "Org-mode version %s (%s @ %s)" + version + git-version + (if org-install org-install "org-install.el can not be found!"))) (if here (insert version)) (message version))) From 510a51310bb13c7ef8d0a05eb0a25ef2fe2722d0 Mon Sep 17 00:00:00 2001 From: Achim Gratz Date: Sun, 13 Nov 2011 11:07:21 +0100 Subject: [PATCH 16/36] use batch-byte-recompile-directory instead of batch-byte-compile * lisp/Makefile: use batch-byte-recompile-directory instead of batch-byte-compile; remove pattern rule for compiling single file from source * lisp/Makefile: add compile-dirty to list of phony targets --- lisp/Makefile | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/lisp/Makefile b/lisp/Makefile index 6b6739249..ac3445f8a 100644 --- a/lisp/Makefile +++ b/lisp/Makefile @@ -1,3 +1,4 @@ +.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.) endif @@ -6,11 +7,12 @@ LISPO = org-install.el LISPF = $(subst $(LISPO),,$(wildcard *.el)) LISPC = $(LISPF:%el=%elc) -.PHONY: all autoloads compile install clean cleanall clean-install +.PHONY: all compile compile-dirty autoloads install clean cleanall clean-install all \ compile \ -compile-dirty: $(LISPC) +compile-dirty: + $(BATCH) --eval '(batch-byte-recompile-directory 0)' autoloads: $(LISPO) @@ -38,9 +40,3 @@ cleanall: clean-install: if [ ! -d $(lispdir) ]; then $(MKDIR) $(lispdir); else true; fi ; $(RM) $(lispdir)/org*.el* $(lispdir)/ob*.el* - -.SUFFIXES: # we don't need default suffix rules -.SUFFIXES: .el .elc - -.el.elc: - $(ELC) $< From 1e343f7f3bac8e1436f3b1fa5acfe7f8b2b5ccec Mon Sep 17 00:00:00 2001 From: Achim Gratz Date: Sun, 13 Nov 2011 11:53:12 +0100 Subject: [PATCH 17/36] update target descriptions, target "all" now automatically cleans .elc before compilation * targets.mk: target "all" for lisp directory does now the same as "compile", i.e. it cleans .elc file first * Makefile: describe all targets and re-arrange the target groups --- .gitignore | 1 + Makefile | 32 ++++++++++++++++++++------------ default.mk | 11 +++++++---- lisp/Makefile | 29 ++++++++++++++++++----------- lisp/org.el | 1 + targets.mk | 3 ++- 6 files changed, 49 insertions(+), 28 deletions(-) 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 From 0081071a528892f92b62894146be4ba79a2d87a2 Mon Sep 17 00:00:00 2001 From: Achim Gratz Date: Fri, 16 Dec 2011 10:33:45 +0100 Subject: [PATCH 18/36] create Makefile for etc/, some additions to .gitignore * etc/Makefile: create, activate subdir "styles" for ODT exporter * .gitignore: ignore doc/git-describe.texi and .gitattributes --- .gitignore | 2 ++ etc/Makefile | 24 ++++++++++++++++++++++++ targets.mk | 4 ++-- 3 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 etc/Makefile diff --git a/.gitignore b/.gitignore index c878226bf..3504d1d0e 100644 --- a/.gitignore +++ b/.gitignore @@ -37,6 +37,8 @@ manual org_dual_license.texi ORGWEBPAGE/Changes.txt local*.mk +doc/git-describe.texi +.gitattributes # aspell word and replacement lists diff --git a/etc/Makefile b/etc/Makefile new file mode 100644 index 000000000..c58d9120d --- /dev/null +++ b/etc/Makefile @@ -0,0 +1,24 @@ +etcdir = $(lispdir)/etc +ETCDIRS = styles +-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.) +endif + +.PHONY: all install clean cleanall clean-install + +all: + +install: $(ETCDIRS) + $(foreach dir, $?, if [ ! -d $(etcdir)/$(dir) ]; then $(MKDIR) $(etcdir)/$(dir); else true; fi ; $(CP) $(dir)/* $(etcdir)/$(dir); ) + +clean: + +cleanall: + +clean-install: + if [ ! -d $(etcdir) ]; then $(MKDIR) $(etcdir); else true; fi ; + $(RMR) $(etcdir) diff --git a/targets.mk b/targets.mk index badb3524c..197962284 100644 --- a/targets.mk +++ b/targets.mk @@ -4,7 +4,7 @@ DISTFILES_extra= Makefile request-assign-future.txt contrib etc .EXPORT_ALL_VARIABLES: LISPDIRS = lisp -SUBDIRS = doc $(LISPDIRS) +SUBDIRS = doc etc $(LISPDIRS) INSTSUB = $(SUBDIRS:%=install-%) GITVERSION = $(shell git describe --abbrev=6 HEAD) @@ -15,7 +15,7 @@ ifneq ("$(GITSTATUS)", "") GITVERSION := $(GITVERSION).dirty endif -.PHONY: default all up2 update compile lisp doc \ +.PHONY: default all up2 update compile lisp doc etc \ install info html pdf card docs $(INSTSUB) \ autoloads cleanall clean cleancontrib cleanelc cleandoc cleanrel From 6a3ec67abd61b4707ec4847ac81e3612201e5ec5 Mon Sep 17 00:00:00 2001 From: Achim Gratz Date: Mon, 2 Jan 2012 20:07:04 +0100 Subject: [PATCH 19/36] Introduce $(datadir), prefix all installation paths with $(DESTDIR) Makefile: remove includes for maintainer targets, these will go into local.mk on the server default.mk: introduce $(datadir) to replace $(etcdir) in etc/Makefile doc/Makefile: replace $etcdir) with $(datadir) lisp/Makefile: record ODT styles location as defconst in org-install {doc,etc,lisp}/Makefile: prefix all installation targets with $(DESTDIR) --- Makefile | 15 +++++++-------- default.mk | 4 +++- doc/Makefile | 13 ++++++------- etc/Makefile | 7 +++---- lisp/Makefile | 9 +++++---- 5 files changed, 24 insertions(+), 24 deletions(-) diff --git a/Makefile b/Makefile index 5f1d9bff7..b6b3b930a 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,9 @@ # Makefile - for the org-mode distribution # -# Maintainer: Carsten Dominik -# Version: VERSIONTAG -# +# This file is not part of GNU Emacs + +# default target is "all" +.DEFAULT: all # Describe valid make targets for org-mode. .PHONY: targets help @@ -32,8 +33,6 @@ targets help: $(info make clean-install - remove installed Org ELisp and documentation files) @echo "" - include default.mk --include local.mk # optional local customization - include maint.mk - include targets.mk - include maint-targets.mk + include default.mk # defaults, customizable via "local.mk" +-include local.mk # optional local customization, use default.mk as template + include targets.mk # toplevel make machinery diff --git a/default.mk b/default.mk index a1831feb5..0d32e3a51 100644 --- a/default.mk +++ b/default.mk @@ -11,6 +11,9 @@ prefix = /usr/share # Where local lisp files go. lispdir = $(prefix)/emacs/site-lisp/org +# Where local data files go. +datadir = $(lispdir)/etc + # Where info files go. infodir = $(prefix)/info @@ -63,4 +66,3 @@ CP = install -p # Name of the program to install info files INSTALL_INFO = install-info - diff --git a/doc/Makefile b/doc/Makefile index 04c4fb81d..bb3e80762 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -1,7 +1,7 @@ +.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.) endif - .PHONY: all info html pdf card manual guide install clean cleanall clean-install all: info html pdf card @@ -30,9 +30,9 @@ git-describe.texi: org.texi install: org - if [ ! -d $(infodir) ]; then $(MKDIR) $(infodir); else true; fi ; - $(CP) org $(infodir) - $(INSTALL_INFO) --infodir=$(infodir) org + if [ ! -d $(DESTDIR)$(infodir) ]; then $(MKDIR) $(DESTDIR)$(infodir); else true; fi ; + $(CP) org $(DESTDIR)$(infodir) + $(INSTALL_INFO) --infodir=$(DESTDIR)$(infodir) org clean: $(RM) org *.pdf *.html *_letter.tex \ @@ -42,10 +42,9 @@ cleanall: clean $(RMR) guide manual clean-install: - $(RM) $(infodir)/org* - $(INSTALL_INFO) --infodir=$(infodir) --remove org + $(RM) $(DESTDIR)$(infodir)/org* + $(INSTALL_INFO) --infodir=$(DESTDIR)$(infodir) --remove org -.SUFFIXES: # we don't need default suffix rules .SUFFIXES: .texi .tex .txt %: %.texi diff --git a/etc/Makefile b/etc/Makefile index c58d9120d..9ef280df2 100644 --- a/etc/Makefile +++ b/etc/Makefile @@ -1,4 +1,3 @@ -etcdir = $(lispdir)/etc ETCDIRS = styles -include local.mk # optional local customization @@ -13,12 +12,12 @@ endif all: install: $(ETCDIRS) - $(foreach dir, $?, if [ ! -d $(etcdir)/$(dir) ]; then $(MKDIR) $(etcdir)/$(dir); else true; fi ; $(CP) $(dir)/* $(etcdir)/$(dir); ) + $(foreach dir, $?, if [ ! -d $(DESTDIR)$(datadir)/$(dir) ]; then $(MKDIR) $(DESTDIR)$(datadir)/$(dir); else true; fi ; $(CP) $(dir)/* $(DESTDIR)$(datadir)/$(dir); ) clean: cleanall: clean-install: - if [ ! -d $(etcdir) ]; then $(MKDIR) $(etcdir); else true; fi ; - $(RMR) $(etcdir) + if [ ! -d $(DESTDIR)$(datadir) ]; then $(MKDIR) $(DESTDIR)$(datadir); else true; fi ; + $(RMR) $(DESTDIR)$(datadir) diff --git a/lisp/Makefile b/lisp/Makefile index 4aa022611..31ecdb758 100644 --- a/lisp/Makefile +++ b/lisp/Makefile @@ -6,6 +6,7 @@ ORG-INSTALL = $(BATCH) \ --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 '(insert "\n(defconst org-odt-data-dir \"$(datadir)\"\n \"The location of ODT styles.\")\n")' \ --eval '(save-buffer)' -include local.mk # optional local customization @@ -32,8 +33,8 @@ org-install.el: $(LISPF) $(ORG-INSTALL) install: $(LISPF) compile autoloads - if [ ! -d $(lispdir) ]; then $(MKDIR) $(lispdir); else true; fi ; - $(CP) $(LISPC) $(LISPF) $(LISPO) $(lispdir) + if [ ! -d $(DESTDIR)$(lispdir) ]; then $(MKDIR) $(DESTDIR)$(lispdir); else true; fi ; + $(CP) $(LISPC) $(LISPF) $(LISPO) $(DESTDIR)$(lispdir) clean: $(RM) *.elc @@ -45,5 +46,5 @@ cleanall: $(RM) *.elc $(LISPO) clean-install: - if [ ! -d $(lispdir) ]; then $(MKDIR) $(lispdir); else true; fi ; - $(RM) $(lispdir)/org*.el* $(lispdir)/ob*.el* + if [ ! -d $(DESTDIR)$(lispdir) ]; then $(MKDIR) $(DESTDIR)$(lispdir); else true; fi ; + $(RM) $(DESTDIR)$(lispdir)/org*.el* $(DESTDIR)$(lispdir)/ob*.el* From 24fa46a9e507684f0b5cd9413004c9d585e9b9c1 Mon Sep 17 00:00:00 2001 From: Achim Gratz Date: Mon, 2 Jan 2012 20:30:32 +0100 Subject: [PATCH 20/36] more robust shell code for install/clean-install {etc,lisp}/Makefile: use shell instead of make for looping, make code more robust --- etc/Makefile | 16 ++++++++++++---- lisp/Makefile | 9 ++++++--- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/etc/Makefile b/etc/Makefile index 9ef280df2..1c9e2cc30 100644 --- a/etc/Makefile +++ b/etc/Makefile @@ -12,12 +12,20 @@ endif all: install: $(ETCDIRS) - $(foreach dir, $?, if [ ! -d $(DESTDIR)$(datadir)/$(dir) ]; then $(MKDIR) $(DESTDIR)$(datadir)/$(dir); else true; fi ; $(CP) $(dir)/* $(DESTDIR)$(datadir)/$(dir); ) + for dir in $? ; do \ + if [ ! -d $(DESTDIR)$(datadir)/$${dir} ] ; then \ + $(MKDIR) $(DESTDIR)$(datadir)/$${dir} ; \ + fi ; \ + $(CP) $${dir}/* $(DESTDIR)$(datadir)/$${dir} ; \ + done ; clean: cleanall: -clean-install: - if [ ! -d $(DESTDIR)$(datadir) ]; then $(MKDIR) $(DESTDIR)$(datadir); else true; fi ; - $(RMR) $(DESTDIR)$(datadir) +clean-install: $(ETCDIRS) + for dir in $? ; do \ + if [ -d $(DESTDIR)$(datadir)/$${dir} ] ; then \ + $(RMR) $(DESTDIR)$(datadir)/$${dir} ; \ + fi ; \ + done ; diff --git a/lisp/Makefile b/lisp/Makefile index 31ecdb758..0824ffe78 100644 --- a/lisp/Makefile +++ b/lisp/Makefile @@ -33,7 +33,9 @@ org-install.el: $(LISPF) $(ORG-INSTALL) install: $(LISPF) compile autoloads - if [ ! -d $(DESTDIR)$(lispdir) ]; then $(MKDIR) $(DESTDIR)$(lispdir); else true; fi ; + if [ ! -d $(DESTDIR)$(lispdir) ] ; then \ + $(MKDIR) $(DESTDIR)$(lispdir) ; \ + fi ; $(CP) $(LISPC) $(LISPF) $(LISPO) $(DESTDIR)$(lispdir) clean: @@ -46,5 +48,6 @@ cleanall: $(RM) *.elc $(LISPO) clean-install: - if [ ! -d $(DESTDIR)$(lispdir) ]; then $(MKDIR) $(DESTDIR)$(lispdir); else true; fi ; - $(RM) $(DESTDIR)$(lispdir)/org*.el* $(DESTDIR)$(lispdir)/ob*.el* + if [ -d $(DESTDIR)$(lispdir) ] ; then \ + $(RM) $(DESTDIR)$(lispdir)/org*.el* $(DESTDIR)$(lispdir)/ob*.el* ; \ + fi ; From 6ec5f3016511a3ee1bd86f0eeb0915a300cee0bf Mon Sep 17 00:00:00 2001 From: Achim Gratz Date: Mon, 2 Jan 2012 21:24:36 +0100 Subject: [PATCH 21/36] Do not croak when git is not available targets.mk: if no .git directory is present, assume that Git is not available. Make ORGVERSION, GITVERSION and GITSTATUS customizable from local.mk (override from command line is also possible and probably easier) --- targets.mk | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/targets.mk b/targets.mk index 197962284..49795fc39 100644 --- a/targets.mk +++ b/targets.mk @@ -3,15 +3,20 @@ DISTFILES_extra= Makefile request-assign-future.txt contrib etc .EXPORT_ALL_VARIABLES: -LISPDIRS = lisp -SUBDIRS = doc etc $(LISPDIRS) -INSTSUB = $(SUBDIRS:%=install-%) +LISPDIRS = lisp +SUBDIRS = doc etc $(LISPDIRS) +INSTSUB = $(SUBDIRS:%=install-%) -GITVERSION = $(shell git describe --abbrev=6 HEAD) -ORGVERSION = $(subst release_,,$(shell git describe --abbrev=0 HEAD)) -GITSTATUS = $(shell git status -uno --porcelain) -DATE = $(shell date +%Y-%m-%d) -ifneq ("$(GITSTATUS)", "") +ifneq ($(wildcard .git),) + GITVERSION ?= $(shell git describe --abbrev=6 HEAD) + ORGVERSION ?= $(subst release_,,$(shell git describe --abbrev=0 HEAD)) + GITSTATUS ?= $(shell git status -uno --porcelain) +else + GITVERSION ?= N/A + ORGVERSION ?= N/A +endif +DATE = $(shell date +%Y-%m-%d) +ifneq ($(GITSTATUS),) GITVERSION := $(GITVERSION).dirty endif From 3661de936804d26f02b4ad26e9d8543f11dfa618 Mon Sep 17 00:00:00 2001 From: Achim Gratz Date: Mon, 2 Jan 2012 21:54:55 +0100 Subject: [PATCH 22/36] The default target should be "all" Makefile: "all" should be the default target --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b6b3b930a..8f52015b2 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ # This file is not part of GNU Emacs # default target is "all" -.DEFAULT: all +all:: # Describe valid make targets for org-mode. .PHONY: targets help From a5ed8c65a012bfb178e96a534bdd2f01279a5291 Mon Sep 17 00:00:00 2001 From: Achim Gratz Date: Mon, 2 Jan 2012 22:05:53 +0100 Subject: [PATCH 23/36] Remove maint.mk and maint-targets.mk from repository maint.mk and maint-targets.mk are removed from the repository as they are only used on the server by Bastien --- maint-targets.mk | 153 ----------------------------------------------- maint.mk | 23 ------- 2 files changed, 176 deletions(-) delete mode 100644 maint-targets.mk delete mode 100644 maint.mk diff --git a/maint-targets.mk b/maint-targets.mk deleted file mode 100644 index f44888cd3..000000000 --- a/maint-targets.mk +++ /dev/null @@ -1,153 +0,0 @@ -.PHONY: p g html_manual html_guide \ - testrelease release fixrelease \ - relup makerelease sync_release sync_manual \ - distfile pkg push pushtag pushreleasetag -.NOTPARALLEL: .PHONY -# Below here are special targets for maintenance only - -p: pdf - open doc/org.pdf - -g: pdf - open doc/orgguide.pdf - -html_manual html_guide: - $(MAKE) -C doc $(@:html_%=%) - -testrelease: - git checkout -b testrelease origin/maint - git merge -s recursive -X theirs master - UTILITIES/set-version.pl testing - git commit -a -m "Release testing" - make distfile TAG=testversion - make cleanrel - rm -rf org-testversion* - git reset --hard - git checkout master - git branch -D testrelease - -# The following target makes a full release for the stuff that is -# currently on master. Do it like this: -# -# make release TAG=7.01 - -release: - git checkout maint - git merge -s recursive -X theirs master - UTILITIES/set-version.pl $(TAG) - git commit -a -m "Release $(TAG)" - make relup TAG=$(TAG) - make cleanrel - rm -rf org-$(TAG) - rm -f org-$(TAG)*.zip - rm -f org-$(TAG)*.tar.gz - make pushreleasetag TAG=$(TAG) - git push -f origin maint - git checkout master - git merge -s ours maint - UTILITIES/set-version.pl -a $(TAG) - git commit -a -m "Update website to show $(TAG) as current release" - git push - -# The following target makes a release, but from the stuff that is on -# maint, not from the stuff that is on master. The idea is that it pushes -# out a minor fix into a minor update, while development on master -# already went full steam ahead. To make a micro-relesse, cherry-pick -# the necessary changes into maint, then run (with proper version number) -# This is just like release, but we skip the step which merges master -# into maint. -# -# make fixrelease TAG=7.01.02 - -fixrelease: - git checkout maint - git merge -s recursive -X theirs master - UTILITIES/set-version.pl $(TAG) - git commit -a -m "Release $(TAG)" - make relup TAG=$(TAG) - make cleanrel - rm -rf org-$(TAG) - rm org-$(TAG)*.zip - rm org-$(TAG)*.tar.gz - make pushreleasetag TAG=$(TAG) - git push -f origin maint - git checkout master - git merge -s ours maint - UTILITIES/set-version.pl -o $(TAG) - git commit -a -m "Update website to show $(TAG) as current release" - git push - -# ~$ make relup only makes sense from orgmode.org server -# Don't call it from your computer! -relup: - ${MAKE} makerelease - ${MAKE} sync_release - ${MAKE} sync_manual - -makerelease: - @if [ "X$(TAG)" = "X" ]; then echo "*** No tag ***"; exit 1; fi - ${MAKE} distfile - ${MAKE} doc - UTILITIES/gplmanual.pl - ${MAKE} html_manual - ${MAKE} html_guide - rm -rf RELEASEDIR - $(MKDIR) RELEASEDIR - cp org-$(TAG).zip org-$(TAG).tar.gz RELEASEDIR - cp doc/org.pdf doc/orgcard.pdf doc/org.texi doc/org.html RELEASEDIR - cp doc/org_dual_license.texi RELEASEDIR - cp doc/orgguide.pdf doc/orgcard.txt RELEASEDIR - cp RELEASEDIR/org-$(TAG).zip RELEASEDIR/org.zip - cp RELEASEDIR/org-$(TAG).tar.gz RELEASEDIR/org.tar.gz - -# ~$ make sync_release only makes sense from orgmode.org server -# Don't call it from your computer! -sync_release: - rsync -avuz RELEASEDIR/ /var/www/orgmode.org/ - -# ~$ make sync_manual only makes sense from orgmode.org server -# Don't call it from your computer! -sync_manual: - rsync -avuz --delete doc/manual/ /var/www/orgmode.org/manual/ - rsync -avuz --delete doc/guide/ /var/www/orgmode.org/guide/ - -distfile: - @if [ "X$(TAG)" = "X" ]; then echo "*** No tag ***"; exit 1; fi - touch doc/org.texi doc/orgcard.tex # force update - ${MAKE} cleancontrib - ${MAKE} info - ${MAKE} doc - ${MAKE} lisp/org-install.el - rm -rf org-$(TAG) org-$(TAG).zip - $(MKDIR) org-$(TAG) - $(MKDIR) org-$(TAG)/doc - $(MKDIR) org-$(TAG)/lisp - cp -r $(LISPFILES) org-$(TAG)/lisp - cp -r $(DOCFILES) $(CARDFILES) org-$(TAG)/doc - cp -r $(DISTFILES_extra) org-$(TAG)/ - cp -r README_DIST org-$(TAG)/README - zip -r org-$(TAG).zip org-$(TAG) - tar zcvf org-$(TAG).tar.gz org-$(TAG) - -pkg: - @if [ "X$(PKG_TAG)" = "X" ]; then echo "*** No tag ***"; exit 1; fi - touch doc/org.texi doc/orgcard.tex # force update - ${MAKE} info - ${MAKE} doc - rm -rf org-$(PKG_TAG) org-$(PKG_TAG).tar - $(MKDIR) org-$(PKG_TAG) - cp -r $(PKG_FILES) org-$(PKG_TAG) - echo "(define-package \"org\" \"$(PKG_TAG)\" \"$(PKG_DOC)\" $(PKG_REQ))" > org-$(PKG_TAG)/org-pkg.el - tar cf org-$(PKG_TAG).tar org-$(PKG_TAG) --remove-files - -push: - git push orgmode@orgmode.org:org-mode.git master - -pushtag: - git tag -m "Adding tag" -a $(TAG) - git push orgmode@orgmode.org:org-mode.git $(TAG) - -pushreleasetag: - git tag -m "Adding release tag" -a release_$(TAG) - git push orgmode@orgmode.org:org-mode.git release_$(TAG) - diff --git a/maint.mk b/maint.mk deleted file mode 100644 index 0f4189674..000000000 --- a/maint.mk +++ /dev/null @@ -1,23 +0,0 @@ -##---------------------------------------------------------------------- -## BELOW THIS LINE ON YOUR OWN RISK! -##---------------------------------------------------------------------- - -# The following variables need to be defined by the maintainer - -# Package Manager (ELPA) -PKG_TAG = $(shell date +%Y%m%d) -PKG_DOC = "Outline-based notes management and organizer" -PKG_REQ = "nil" - -PKG_FILES = $(LISPFILES0) \ - doc/dir doc/org \ - doc/pdflayout.sty \ - doc/org.pdf \ - doc/orgguide.pdf \ - doc/orgcard.tex \ - doc/orgcard.pdf \ - doc/orgcard_letter.pdf - -.SUFFIXES: .el .elc .texi -SHELL = /bin/sh - From b323d9e5c3b64fbca90912db75f4d02e2c6575c9 Mon Sep 17 00:00:00 2001 From: Achim Gratz Date: Tue, 3 Jan 2012 18:46:51 +0100 Subject: [PATCH 24/36] move schema files to etc/ and modify makefile to install them into $(datadir) etc/Makefile: add "schema" to $(ETCDIRS) contrib/odt/etc/schema/od-manifest-schema-v1.2-cs01.rnc: move to etc/schema/od-manifest-schema-v1.2-cs01.rnc contrib/odt/etc/schema/od-schema-v1.2-cs01.rnc: move to etc/schema/od-schema-v1.2-cs01.rn contrib/odt/etc/schema/schemas.xml: move to etc/schema/schemas.xml --- etc/Makefile | 2 +- .../odt/etc => etc}/schema/od-manifest-schema-v1.2-cs01.rnc | 0 {contrib/odt/etc => etc}/schema/od-schema-v1.2-cs01.rnc | 0 {contrib/odt/etc => etc}/schema/schemas.xml | 0 4 files changed, 1 insertion(+), 1 deletion(-) rename {contrib/odt/etc => etc}/schema/od-manifest-schema-v1.2-cs01.rnc (100%) rename {contrib/odt/etc => etc}/schema/od-schema-v1.2-cs01.rnc (100%) rename {contrib/odt/etc => etc}/schema/schemas.xml (100%) diff --git a/etc/Makefile b/etc/Makefile index 1c9e2cc30..8b0615851 100644 --- a/etc/Makefile +++ b/etc/Makefile @@ -1,4 +1,4 @@ -ETCDIRS = styles +ETCDIRS = styles schema -include local.mk # optional local customization .NOTPARALLEL: # always run this make serially diff --git a/contrib/odt/etc/schema/od-manifest-schema-v1.2-cs01.rnc b/etc/schema/od-manifest-schema-v1.2-cs01.rnc similarity index 100% rename from contrib/odt/etc/schema/od-manifest-schema-v1.2-cs01.rnc rename to etc/schema/od-manifest-schema-v1.2-cs01.rnc diff --git a/contrib/odt/etc/schema/od-schema-v1.2-cs01.rnc b/etc/schema/od-schema-v1.2-cs01.rnc similarity index 100% rename from contrib/odt/etc/schema/od-schema-v1.2-cs01.rnc rename to etc/schema/od-schema-v1.2-cs01.rnc diff --git a/contrib/odt/etc/schema/schemas.xml b/etc/schema/schemas.xml similarity index 100% rename from contrib/odt/etc/schema/schemas.xml rename to etc/schema/schemas.xml From 4a7ed95010d20c0f62bf9c26b331e1e353444585 Mon Sep 17 00:00:00 2001 From: Achim Gratz Date: Wed, 4 Jan 2012 21:02:14 +0100 Subject: [PATCH 25/36] introduce new make target "test" Makefile: add help for target "test" default.mk: more sane location for local data, add $(BTEST) that will run the test in batch mode. Some tests require non-standard packages, introduce $(BTEST_EXTRA) in order to add options so they can be found. targets.mk: new target "test" that implies "all" and then runs all test. Hidden target "test-dirty" runs tests without doing compilation. --- Makefile | 1 + default.mk | 11 +++++++++-- targets.mk | 10 ++++++++-- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 8f52015b2..7e82e4a4a 100644 --- a/Makefile +++ b/Makefile @@ -26,6 +26,7 @@ targets help: $(info make pdf - make pdf documentation) $(info make card - make refcards documentation) $(info ) + $(info make test - build org and run all test suite) $(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) diff --git a/default.mk b/default.mk index 0d32e3a51..cdbcb499b 100644 --- a/default.mk +++ b/default.mk @@ -12,7 +12,7 @@ prefix = /usr/share lispdir = $(prefix)/emacs/site-lisp/org # Where local data files go. -datadir = $(lispdir)/etc +datadir = $(prefix)/emacs/etc/org # Where info files go. infodir = $(prefix)/info @@ -22,9 +22,16 @@ infodir = $(prefix)/info ##---------------------------------------------------------------------- # Using emacs in batch mode. - BATCH = $(EMACS) -batch -Q -L . +# run tests +BTEST = $(EMACS) -batch \ + $(BTEST_EXTRA) \ + -L lisp/ \ + -l testing/org-test.el \ + -eval "(setq org-confirm-babel-evaluate nil)" \ + -f org-test-run-batch-tests + # How to byte-compile the whole source directory ELCDIR = $(BATCH) \ --eval '(defconst org-release "$(ORGVERSION)")' \ diff --git a/targets.mk b/targets.mk index 49795fc39..02d1be09a 100644 --- a/targets.mk +++ b/targets.mk @@ -21,8 +21,8 @@ ifneq ($(GITSTATUS),) endif .PHONY: default all up2 update compile lisp doc etc \ - install info html pdf card docs $(INSTSUB) \ - autoloads cleanall clean cleancontrib cleanelc cleandoc cleanrel + test install info html pdf card docs $(INSTSUB) \ + autoloads cleanall clean cleancontrib cleanelc cleandoc cleanrel clean-install all \ compile:: lisp @@ -36,6 +36,12 @@ all \ clean-install:: $(SUBDIRS) $(foreach dir, $?, $(MAKE) -C $(dir) $@;) +test:: all + +test \ +test-dirty:: + $(BTEST) + up2: update sudo ${MAKE} install From b9c72bebe424e05e678c267f0c801ea83a226c9d Mon Sep 17 00:00:00 2001 From: Achim Gratz Date: Wed, 4 Jan 2012 22:53:02 +0100 Subject: [PATCH 26/36] make sure org-release is defined in batch mode default.mk: make sure org-release is defined when starting emacs in batch mode. Add a suffix to see if this definition leaks into the installed version someplace. When running from an installed version, this definition is pulled in from org-install.el. --- default.mk | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/default.mk b/default.mk index cdbcb499b..24d48e48a 100644 --- a/default.mk +++ b/default.mk @@ -22,19 +22,21 @@ infodir = $(prefix)/info ##---------------------------------------------------------------------- # Using emacs in batch mode. -BATCH = $(EMACS) -batch -Q -L . +BATCH = $(EMACS) -batch -Q \ + -L . \ + --eval '(defconst org-release "$(ORGVERSION)-Make")' \ # run tests BTEST = $(EMACS) -batch \ $(BTEST_EXTRA) \ -L lisp/ \ + --eval '(defconst org-release "$(ORGVERSION)-Test")' \ -l testing/org-test.el \ -eval "(setq org-confirm-babel-evaluate nil)" \ -f org-test-run-batch-tests # 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 From 41624c1809d015a4d41601917ce09234dd8f567b Mon Sep 17 00:00:00 2001 From: Achim Gratz Date: Thu, 5 Jan 2012 20:54:52 +0100 Subject: [PATCH 27/36] ignore *.t2d directories in doc/, adapt some comments, implement missing targets .gitignore: also ignore *.t2d directories in doc/ that texi2pdf might produce when run in tidy mode default.mk: correct some comments targets.mk: implement missing clean targets and add aliases for them --- .gitignore | 4 ++++ default.mk | 40 ++++++++++++++++++++++------------------ targets.mk | 13 ++++++++++--- 3 files changed, 36 insertions(+), 21 deletions(-) diff --git a/.gitignore b/.gitignore index 3504d1d0e..609c2240b 100644 --- a/.gitignore +++ b/.gitignore @@ -40,6 +40,10 @@ local*.mk doc/git-describe.texi .gitattributes +# texi2pdf --tidy + +doc/*.t2d + # aspell word and replacement lists .aspell.org.pws diff --git a/default.mk b/default.mk index 24d48e48a..b3c3f6c7f 100644 --- a/default.mk +++ b/default.mk @@ -1,15 +1,17 @@ ##---------------------------------------------------------------------- -## YOU MUST EDIT THE FOLLOWING LINES +## NEVER EDIT THIS FILE, PUT ANY ADAPTATIONS INTO local.mk +##---------------------------------------------------------------------- +## CHECK AND ADAPT THE FOLLOWING DEFINITIONS ##---------------------------------------------------------------------- # Name of your emacs binary -EMACS = emacs +EMACS = emacs # Where local software is found -prefix = /usr/share +prefix = /usr/share # Where local lisp files go. -lispdir = $(prefix)/emacs/site-lisp/org +lispdir= $(prefix)/emacs/site-lisp/org # Where local data files go. datadir = $(prefix)/emacs/etc/org @@ -18,16 +20,17 @@ datadir = $(prefix)/emacs/etc/org infodir = $(prefix)/info ##---------------------------------------------------------------------- -## YOU MAY NEED TO EDIT THESE +## YOU MAY NEED TO ADAPT THESE DEFINITIONS ##---------------------------------------------------------------------- # Using emacs in batch mode. -BATCH = $(EMACS) -batch -Q \ +BATCH = $(EMACS) -batch -Q \ -L . \ --eval '(defconst org-release "$(ORGVERSION)-Make")' \ -# run tests -BTEST = $(EMACS) -batch \ +# How to run tests +BTEST_EXTRA = # placeholder +BTEST = $(EMACS) -batch \ $(BTEST_EXTRA) \ -L lisp/ \ --eval '(defconst org-release "$(ORGVERSION)-Test")' \ @@ -36,20 +39,20 @@ BTEST = $(EMACS) -batch \ -f org-test-run-batch-tests # How to byte-compile the whole source directory -ELCDIR = $(BATCH) \ +ELCDIR = $(BATCH) \ --eval '(batch-byte-recompile-directory 0)' # How to byte-compile a single source file -ELC = $(BATCH) -f batch-byte-compile +ELC = $(BATCH) -f batch-byte-compile # How to make a pdf file from a texinfo file -TEXI2PDF = texi2pdf +TEXI2PDF = texi2pdf --batch --clean # How to make a pdf file from a tex file PDFTEX = pdftex # How to create directories -MKDIR = mkdir -p +MKDIR = mkdir -p # How to create the info files from the texinfo file MAKEINFO = makeinfo @@ -58,20 +61,21 @@ MAKEINFO = makeinfo TEXI2HTML = makeinfo --html --number-sections # How to find files -FIND = find +FIND = find # How to remove files -RM = rm -f +RM = rm -f # How to remove files recursively -RMR = rm -fr +RMR = rm -fr # How to stream edit a file -SED = sed +SED = sed # How to copy the lisp files and elc files to their destination. -# CP = cp -p # try this if there is no install -CP = install -p +# CP = cp -p # try this if there is no install +CP = install -p # Name of the program to install info files +# INSTALL_INFO = ginstall-info # Debian: avoid harmless warning message INSTALL_INFO = install-info diff --git a/targets.mk b/targets.mk index 02d1be09a..8b0d9dae8 100644 --- a/targets.mk +++ b/targets.mk @@ -22,7 +22,8 @@ endif .PHONY: default all up2 update compile lisp doc etc \ test install info html pdf card docs $(INSTSUB) \ - autoloads cleanall clean cleancontrib cleanelc cleandoc cleanrel clean-install + autoloads cleanall clean cleancontrib cleanrel clean-install \ + cleanelc cleanlisp cleandoc cleandocs all \ compile:: lisp @@ -46,8 +47,8 @@ up2: update sudo ${MAKE} install update: + git remote update git pull - ${MAKE} clean ${MAKE} all install: $(INSTSUB) @@ -62,7 +63,7 @@ info html pdf card: $(INSTSUB): $(MAKE) -C $(@:install-%=%) install -autoloads: lisp maint.mk +autoloads: lisp $(MAKE) -C $< $@ cleanall: $(SUBDIRS) @@ -81,3 +82,9 @@ cleanrel: $(RMR) RELEASEDIR $(RMR) org-7.* $(RMR) org-7*zip org-7*tar.gz + +cleanelc cleanlisp: + $(MAKE) -C lisp clean + +cleandoc cleandocs: + $(MAKE) -C doc clean From 353a0c519bae0fce277de48adc8cf582d986b7e0 Mon Sep 17 00:00:00 2001 From: Achim Gratz Date: Tue, 31 Jan 2012 20:44:37 +0100 Subject: [PATCH 28/36] introduce $(SUDO) to make install with administrative privileges customizable defaults.mk: define SUDO to map to sudo, add comment to define blank if administrative privileges are not needed (already root on Linux or Administrator on Windows) targets.mk: use newly defined $(SUDO) uinstead of plain sudo, replaces some braces with parentheses --- default.mk | 4 ++++ targets.mk | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/default.mk b/default.mk index b3c3f6c7f..0835938a5 100644 --- a/default.mk +++ b/default.mk @@ -76,6 +76,10 @@ SED = sed # CP = cp -p # try this if there is no install CP = install -p +# How to obtain administrative privileges +# SUDO = # leave blank if you don't need this +SUDO = sudo + # Name of the program to install info files # INSTALL_INFO = ginstall-info # Debian: avoid harmless warning message INSTALL_INFO = install-info diff --git a/targets.mk b/targets.mk index 8b0d9dae8..d33e98c40 100644 --- a/targets.mk +++ b/targets.mk @@ -44,12 +44,12 @@ test-dirty:: $(BTEST) up2: update - sudo ${MAKE} install + $(SUDO) $(MAKE) install update: git remote update git pull - ${MAKE} all + $(MAKE) all install: $(INSTSUB) From 035f24673b2170c284859479aabb588f0330f8bc Mon Sep 17 00:00:00 2001 From: Achim Gratz Date: Tue, 14 Feb 2012 19:36:59 +0100 Subject: [PATCH 29/36] introduce "check" as alias for "test" to comply with GNU Makefile conventions Makefile: change test to check in help text targets.mk: add check as alias for test --- Makefile | 2 +- targets.mk | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 7e82e4a4a..7870736ed 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ targets help: $(info make pdf - make pdf documentation) $(info make card - make refcards documentation) $(info ) - $(info make test - build org and run all test suite) + $(info make check - build org and run complete test suite) $(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) diff --git a/targets.mk b/targets.mk index d33e98c40..fe283a5a5 100644 --- a/targets.mk +++ b/targets.mk @@ -21,7 +21,7 @@ ifneq ($(GITSTATUS),) endif .PHONY: default all up2 update compile lisp doc etc \ - test install info html pdf card docs $(INSTSUB) \ + check test install info html pdf card docs $(INSTSUB) \ autoloads cleanall clean cleancontrib cleanrel clean-install \ cleanelc cleanlisp cleandoc cleandocs @@ -37,9 +37,9 @@ all \ clean-install:: $(SUBDIRS) $(foreach dir, $?, $(MAKE) -C $(dir) $@;) -test:: all +check test:: all -test \ +check test \ test-dirty:: $(BTEST) From 3bbd458780926ea398d8b32400a858de79ccdf8b Mon Sep 17 00:00:00 2001 From: Achim Gratz Date: Thu, 16 Feb 2012 21:24:51 +0100 Subject: [PATCH 30/36] add cleaning of temporary test files (with option to keep them) default.mk: add $(testdir) definition based on $(TMPDIR), which defaults to "/tmp" if not already defined targets.mk(check): call test suite with TMPDIR=$(testdir) and remove direactory after successful run of testsuite. Do not remove temporary test files if $(TEST_NO_AUTOCLEAN) is set to a non-empty value. targets.mk(cleandirs): refactor the first part of what cleanall had been doing. targets.mk(cleanall): run cleantest and cleandirs, then remove backup files. targets.mk(cleanlisp): remove backup files. targets.mk(cleandoc): remove backup files. targets.mk(cleanall): run cleantest and cleandirs, then remove backup files. targets.mk(cleantest): removal of temporary test files. --- default.mk | 4 ++++ targets.mk | 20 +++++++++++++++----- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/default.mk b/default.mk index 0835938a5..961e659da 100644 --- a/default.mk +++ b/default.mk @@ -19,6 +19,10 @@ datadir = $(prefix)/emacs/etc/org # Where info files go. infodir = $(prefix)/info +# where to create temporary files for the testsuite +TMPDIR ?= /tmp +testdir = $(TMPDIR)/tmp-orgtest + ##---------------------------------------------------------------------- ## YOU MAY NEED TO ADAPT THESE DEFINITIONS ##---------------------------------------------------------------------- diff --git a/targets.mk b/targets.mk index fe283a5a5..da24ae21e 100644 --- a/targets.mk +++ b/targets.mk @@ -23,7 +23,7 @@ endif .PHONY: default all up2 update compile lisp doc etc \ check test install info html pdf card docs $(INSTSUB) \ autoloads cleanall clean cleancontrib cleanrel clean-install \ - cleanelc cleanlisp cleandoc cleandocs + cleanelc cleandirs cleanlisp cleandoc cleandocs cleantest all \ compile:: lisp @@ -41,7 +41,11 @@ check test:: all check test \ test-dirty:: - $(BTEST) + -$(MKDIR) $(testdir) + TMPDIR=$(testdir) $(BTEST) +ifeq ($(TEST_NO_AUTOCLEAN),) # define this variable to leave $(testdir) around for inspection + $(MAKE) cleantest +endif up2: update $(SUDO) $(MAKE) install @@ -66,13 +70,14 @@ $(INSTSUB): autoloads: lisp $(MAKE) -C $< $@ -cleanall: $(SUBDIRS) - $(foreach dir, $?, $(MAKE) -C $(dir) $@;) - -$(FIND) . -name \*~ -exec $(RM) {} \; +cleandirs: $(SUBDIRS) + $(foreach dir, $?, $(MAKE) -C $(dir) cleanall;) clean: cleanrel $(MAKE) -C lisp clean $(MAKE) -C doc clean + +cleanall: cleandirs cleantest -$(FIND) . -name \*~ -exec $(RM) {} \; cleancontrib: @@ -85,6 +90,11 @@ cleanrel: cleanelc cleanlisp: $(MAKE) -C lisp clean + -$(FIND) lisp -name \*~ -exec $(RM) {} \; cleandoc cleandocs: $(MAKE) -C doc clean + -$(FIND) doc -name \*~ -exec $(RM) {} \; + +cleantest: + $(RMR) $(testdir) From d5914ad47f56d7b97cd024ba63495de6cea5f171 Mon Sep 17 00:00:00 2001 From: Achim Gratz Date: Mon, 27 Feb 2012 21:54:19 +0100 Subject: [PATCH 31/36] make sure org-install.el does not get compiled lisp/Makefile: add local variable section to org-install.el so that it is never compiled --- lisp/Makefile | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/lisp/Makefile b/lisp/Makefile index 0824ffe78..4957ce941 100644 --- a/lisp/Makefile +++ b/lisp/Makefile @@ -1,12 +1,21 @@ ORG-INSTALL = $(BATCH) \ - --eval "(require 'autoload)" \ + --eval '(require '"'"'autoload)' \ --eval '(find-file "$(LISPO)")' \ --eval '(erase-buffer)' \ + --eval '(insert ";;; org-install.el --- automatically extracted autoloads\n;;\n;;; Code:\n")' \ --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 '(insert "\n(defconst org-odt-data-dir \"$(datadir)\"\n \"The location of ODT styles.\")\n")' \ + --eval '(insert "\f\n(provide '"'"'org-install)\n")' \ + --eval '(insert "(defconst org-release \"$(ORGVERSION)\"\n")' \ + --eval '(insert " \"The release version of org-mode.\n")' \ + --eval '(insert " Inserted by installing org-mode or when a release is made.\")\n")' \ + --eval '(insert "(defconst org-git-version \"$(GITVERSION)\"\n")' \ + --eval '(insert " \"The Git version of org-mode.\n")' \ + --eval '(insert " Inserted by installing org-mode or when a release is made.\")\n")' \ + --eval '(insert "(defconst org-odt-data-dir \"$(datadir)\"\n")' \ + --eval '(insert " \"The location of ODT styles.\")\n")' \ + --eval '(insert ";; Local Variables:\n;; version-control: never\n")' \ + --eval '(insert ";; no-byte-compile: t\n;; no-update-autoloads: t\n")' \ + --eval '(insert ";; coding: utf-8\n;; End:\n;;; org-install.el ends here\n")' \ --eval '(save-buffer)' -include local.mk # optional local customization @@ -20,7 +29,9 @@ LISPO = org-install.el LISPF = $(subst $(LISPO),,$(wildcard *.el)) LISPC = $(LISPF:%el=%elc) -.PHONY: all compile compile-dirty autoloads install clean cleanall clean-install +.PHONY: all compile compile-dirty \ + autoloads \ + install clean cleanauto cleanall clean-install all \ compile \ @@ -41,7 +52,7 @@ install: $(LISPF) compile autoloads clean: $(RM) *.elc -cleanauto: +cleanauto: # internal target $(RM) $(LISPO) $(LISPO:%el=%elc) cleanall: From 72d7c95469cdb5fd403de53215fb4df012e08339 Mon Sep 17 00:00:00 2001 From: Achim Gratz Date: Sun, 4 Mar 2012 12:07:44 +0100 Subject: [PATCH 32/36] initialize Babel languages and provide possibility to load extra packages for testing * default.mk: Run emacs without a site-file. BTEST_EXTRA redefined to hold names of extra packages to require for testing. BTEST_PRE and BTEST_POST allow additional options to be injected around setup of standard load path for testing. BTEST_OB_LANGUAGES holds the names of Babel languages to required. R is not added to the list since it requires ess to be installed and configured. All variables can be overridden in local.mk as before. --- default.mk | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/default.mk b/default.mk index 961e659da..9d4052ceb 100644 --- a/default.mk +++ b/default.mk @@ -33,13 +33,20 @@ BATCH = $(EMACS) -batch -Q \ --eval '(defconst org-release "$(ORGVERSION)-Make")' \ # How to run tests -BTEST_EXTRA = # placeholder -BTEST = $(EMACS) -batch \ - $(BTEST_EXTRA) \ - -L lisp/ \ +BTEST_PRE = # add options before standard load-path +BTEST_POST = # add options after standard load path +BTEST_OB_LANGUAGES = awk C fortran maxima lilypond octave python sh # R +# R is not activated by default because it requires ess to be installed and configured +req-ob-lang = --eval '(require '"'"'ob-$(ob-lang))' +BTEST_EXTRA = # extra packages to require +req-extra = --eval '(require '"'"'$(req))' +BTEST = $(EMACS) -batch -Q \ + $(BTEST_PRE) -L lisp/ -L testing/ $(BTEST_POST) \ --eval '(defconst org-release "$(ORGVERSION)-Test")' \ -l testing/org-test.el \ - -eval "(setq org-confirm-babel-evaluate nil)" \ + $(foreach ob-lang,$(BTEST_OB_LANGUAGES),$(req-ob-lang)) \ + $(foreach req,$(BTEST_EXTRA),$(req-extra)) \ + --eval '(setq org-confirm-babel-evaluate nil)' \ -f org-test-run-batch-tests # How to byte-compile the whole source directory From 97e7636b68d64e70472dacd499140925ebfb912b Mon Sep 17 00:00:00 2001 From: Achim Gratz Date: Sun, 4 Mar 2012 17:49:28 +0100 Subject: [PATCH 33/36] Modify target 'update' to run tests before installation * targets.mk: replace 'all' with 'test' in 'update' --- targets.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/targets.mk b/targets.mk index da24ae21e..94387f476 100644 --- a/targets.mk +++ b/targets.mk @@ -53,7 +53,7 @@ up2: update update: git remote update git pull - $(MAKE) all + $(MAKE) check install: $(INSTSUB) From 1751d2d7f9779ad33d21941887aa90ef5f7e9449 Mon Sep 17 00:00:00 2001 From: Achim Gratz Date: Wed, 21 Mar 2012 09:25:46 +0100 Subject: [PATCH 34/36] need to require find-func instead of just declare-function * lisp/org.el: require find-func and remove declare-function for find-library-name, otherwise autoloaded org-version doesn't show all info correctly. --- lisp/org.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/org.el b/lisp/org.el index 8add2f1cc..8686bf52f 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -75,6 +75,7 @@ (require 'gnus-sum)) (require 'calendar) +(require 'find-func) (require 'format-spec) ;; Emacs 22 calendar compatibility: Make sure the new variables are available @@ -111,7 +112,6 @@ (declare-function org-at-clock-log-p "org-clock" ()) (declare-function org-clock-timestamps-up "org-clock" ()) (declare-function org-clock-timestamps-down "org-clock" ()) -(declare-function find-library-name "find-func") ;; babel (require 'ob) From b33a4d6be040febccd8a1fad6a36a941c53619a4 Mon Sep 17 00:00:00 2001 From: Achim Gratz Date: Sun, 1 Apr 2012 09:48:18 +0200 Subject: [PATCH 35/36] move testing configuration into user-defined part, add hints * default.mk: move testing configuration $(BTEST_*) into user-defined part, add hints on what should go there. Some cosmetic fixes. --- default.mk | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/default.mk b/default.mk index 9d4052ceb..45e6fbfa7 100644 --- a/default.mk +++ b/default.mk @@ -19,26 +19,25 @@ datadir = $(prefix)/emacs/etc/org # Where info files go. infodir = $(prefix)/info -# where to create temporary files for the testsuite +# Where to create temporary files for the testsuite TMPDIR ?= /tmp testdir = $(TMPDIR)/tmp-orgtest +# Configuration for testing +BTEST_PRE = # add options before standard load-path +BTEST_POST = # add options after standard load path + # -L /ert # needed for Emacs23, Emacs24 has ert built in + # -L /htmlize # need at least version 1.34 for source code formatting +BTEST_OB_LANGUAGES = awk C fortran maxima lilypond octave python sh # R + # R is not activated by default because it requires ess to be installed and configured +BTEST_EXTRA = # extra packages to require for testing + ##---------------------------------------------------------------------- ## YOU MAY NEED TO ADAPT THESE DEFINITIONS ##---------------------------------------------------------------------- -# Using emacs in batch mode. -BATCH = $(EMACS) -batch -Q \ - -L . \ - --eval '(defconst org-release "$(ORGVERSION)-Make")' \ - # How to run tests -BTEST_PRE = # add options before standard load-path -BTEST_POST = # add options after standard load path -BTEST_OB_LANGUAGES = awk C fortran maxima lilypond octave python sh # R -# R is not activated by default because it requires ess to be installed and configured req-ob-lang = --eval '(require '"'"'ob-$(ob-lang))' -BTEST_EXTRA = # extra packages to require req-extra = --eval '(require '"'"'$(req))' BTEST = $(EMACS) -batch -Q \ $(BTEST_PRE) -L lisp/ -L testing/ $(BTEST_POST) \ @@ -49,6 +48,11 @@ BTEST = $(EMACS) -batch -Q \ --eval '(setq org-confirm-babel-evaluate nil)' \ -f org-test-run-batch-tests +# Using emacs in batch mode. +BATCH = $(EMACS) -batch -Q \ + -L . \ + --eval '(defconst org-release "$(ORGVERSION)-Make")' \ + # How to byte-compile the whole source directory ELCDIR = $(BATCH) \ --eval '(batch-byte-recompile-directory 0)' From e102e411e4c9a70823b10b25e748f9c1e829b956 Mon Sep 17 00:00:00 2001 From: Achim Gratz Date: Mon, 16 Apr 2012 19:35:55 +0200 Subject: [PATCH 36/36] doc/Makefile: rename/add auto-generated files to be compatible with Emacs * doc/Makefile: rename auto-generated file "git-describe.texi" to "org-version.inc" to allow for easier inclusion into Emacs. * doc/org.texi: include "org-version.inc" instead of "git-describe.texi". * lisp/Makefile: new auto-generated file org-version.el with autoload cookies. The version strings will be pulled during autoload extraction into org-install.el (standalone org-mode) or ../loaddefs.el (Emacs). --- .gitignore | 6 ++---- doc/Makefile | 12 ++++++------ doc/org.texi | 2 +- lisp/Makefile | 43 +++++++++++++++++++++++++++++-------------- 4 files changed, 38 insertions(+), 25 deletions(-) diff --git a/.gitignore b/.gitignore index 609c2240b..1470b8707 100644 --- a/.gitignore +++ b/.gitignore @@ -31,13 +31,13 @@ orgcard_letter.tex orgcard.txt org org-install.el +org-version.* org-*.tar.gz org-*.zip manual org_dual_license.texi ORGWEBPAGE/Changes.txt local*.mk -doc/git-describe.texi .gitattributes # texi2pdf --tidy @@ -63,10 +63,8 @@ TODO .DS_Store *# .#* +/UTILITIES/x11idle # # Local variables: -# fill-column: 72 -# mode: conf # End: -/UTILITIES/x11idle diff --git a/doc/Makefile b/doc/Makefile index bb3e80762..7672664af 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -23,10 +23,10 @@ guide:: orgguide.texi $(TEXI2HTML) -o $@ $< ../UTILITIES/guidesplit.pl $@/* -git-describe.texi: org.texi - @echo "@c automatically generated, do not edit" > git-describe.texi - @echo "@set VERSION $(ORGVERSION) ($(GITVERSION))" >> git-describe.texi - @echo "@set DATE $(DATE)" >> git-describe.texi +org-version.inc: + @echo "@c automatically generated, do not edit" > org-version.inc + @echo "@set VERSION $(ORGVERSION) ($(GITVERSION))" >> org-version.inc + @echo "@set DATE $(DATE)" >> org-version.inc install: org @@ -37,7 +37,7 @@ install: org clean: $(RM) org *.pdf *.html *_letter.tex \ *.aux *.cp *.cps *.dvi *.fn *.fns *.ky *.kys *.pg *.pgs \ - *.toc *.tp *.tps *.vr *.vrs *.log *.html *.ps git-describe.texi + *.toc *.tp *.tps *.vr *.vrs *.log *.html *.ps org-version.inc cleanall: clean $(RMR) guide manual @@ -48,7 +48,7 @@ clean-install: .SUFFIXES: .texi .tex .txt %: %.texi - $(MAKE) git-describe.texi + $(MAKE) org-version.inc $(MAKEINFO) --no-split $< -o $@ %.pdf: LC_ALL=C # work around a bug in texi2dvi diff --git a/doc/org.texi b/doc/org.texi index 467293e72..1a0dbb95c 100644 --- a/doc/org.texi +++ b/doc/org.texi @@ -4,7 +4,7 @@ @setfilename ../../info/org @settitle The Org Manual -@include git-describe.texi +@include org-version.inc @c Use proper quote and backtick for code sections in PDF output @c Cf. Texinfo manual 14.2 diff --git a/lisp/Makefile b/lisp/Makefile index 4957ce941..7e140d756 100644 --- a/lisp/Makefile +++ b/lisp/Makefile @@ -1,22 +1,34 @@ ORG-INSTALL = $(BATCH) \ --eval '(require '"'"'autoload)' \ - --eval '(find-file "$(LISPO)")' \ + --eval '(find-file "org-install.el")' \ --eval '(erase-buffer)' \ - --eval '(insert ";;; org-install.el --- automatically extracted autoloads\n;;\n;;; Code:\n")' \ - --eval '(mapc (lambda (x) (generate-file-autoloads (symbol-name x))) (quote ($(LISPF))))' \ + --eval '(insert ";;; org-install.el --- autogenerated file, do not edit\n;;\n;;; Code:\n")' \ + --eval '(mapc (lambda (x) (generate-file-autoloads (symbol-name x)))\ + (quote ($(LISPF) org-version.el)))' \ --eval '(insert "\f\n(provide '"'"'org-install)\n")' \ - --eval '(insert "(defconst org-release \"$(ORGVERSION)\"\n")' \ - --eval '(insert " \"The release version of org-mode.\n")' \ - --eval '(insert " Inserted by installing org-mode or when a release is made.\")\n")' \ - --eval '(insert "(defconst org-git-version \"$(GITVERSION)\"\n")' \ - --eval '(insert " \"The Git version of org-mode.\n")' \ - --eval '(insert " Inserted by installing org-mode or when a release is made.\")\n")' \ - --eval '(insert "(defconst org-odt-data-dir \"$(datadir)\"\n")' \ - --eval '(insert " \"The location of ODT styles.\")\n")' \ --eval '(insert ";; Local Variables:\n;; version-control: never\n")' \ --eval '(insert ";; no-byte-compile: t\n;; no-update-autoloads: t\n")' \ --eval '(insert ";; coding: utf-8\n;; End:\n;;; org-install.el ends here\n")' \ --eval '(save-buffer)' +ORG-VERSION = $(BATCH) \ + --eval '(find-file "org-version.el")' \ + --eval '(erase-buffer)' \ + --eval '(insert ";;; org-version.el --- autogenerated file, do not edit\n;;\n;;; Code:\n")' \ + --eval '(insert ";;;\#\#\#autoload\n")' \ + --eval '(insert "(defconst org-release \"$(ORGVERSION)\"\n")' \ + --eval '(insert " \"The release version of org-mode.\n")' \ + --eval '(insert " Inserted by installing org-mode or when a release is made.\")\n")' \ + --eval '(insert ";;;\#\#\#autoload\n")' \ + --eval '(insert "(defconst org-git-version \"$(GITVERSION)\"\n")' \ + --eval '(insert " \"The Git version of org-mode.\n")' \ + --eval '(insert " Inserted by installing org-mode or when a release is made.\")\n")' \ + --eval '(insert ";;;\#\#\#autoload\n")' \ + --eval '(insert "(defconst org-odt-data-dir \"$(datadir)\"\n")' \ + --eval '(insert " \"The location of ODT styles.\")\n")' \ + --eval '(insert ";; Local Variables:\n;; version-control: never\n")' \ + --eval '(insert ";; no-byte-compile: t\n")' \ + --eval '(insert ";; coding: utf-8\n;; End:\n;;; org-version.el ends here\n")' \ + --eval '(save-buffer)' -include local.mk # optional local customization .NOTPARALLEL: # always run this make serially @@ -25,8 +37,8 @@ ifeq ($(MAKELEVEL), 0) $(error This make needs to be started as a sub-make from the toplevel directory.) endif -LISPO = org-install.el -LISPF = $(subst $(LISPO),,$(wildcard *.el)) +LISPO = org-install.el org-version.el # autogenerated files +LISPF = $(filter-out $(LISPO),$(wildcard *.el)) LISPC = $(LISPF:%el=%elc) .PHONY: all compile compile-dirty \ @@ -40,7 +52,10 @@ compile-dirty: cleanauto autoloads: $(LISPO) -org-install.el: $(LISPF) +org-version.el: $(LISPF) + $(ORG-VERSION) + +org-install.el: org-version.el $(ORG-INSTALL) install: $(LISPF) compile autoloads