summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAchim Gratz <Stromeko@Stromeko.DE>2011-07-17 14:49:43 +0200
committerAchim Gratz <Stromeko@Stromeko.DE>2012-04-20 21:04:07 +0200
commita5cb04dcd8183a573ac7c60726a5b6993840e051 (patch)
tree4de70281f431973269fe1b407679e81c5bc5a9f0
parentac3162b4f040837e1599028a8ff16c996b942522 (diff)
downloadorg-mode-a5cb04dcd8183a573ac7c60726a5b6993840e051.tar.gz
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
-rw-r--r--Makefile27
-rw-r--r--default.mk6
-rw-r--r--doc/Makefile59
-rw-r--r--lisp/Makefile11
-rw-r--r--maint-targets.mk13
-rw-r--r--maint.mk6
-rw-r--r--targets.mk76
7 files changed, 113 insertions, 85 deletions
diff --git a/Makefile b/Makefile
index 174af94..7037e9a 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 41ed1d1..cb92181 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 0000000..251ee56
--- /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 0fb813c..b14d6f1 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 3d71d7a..f44888c 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 ce98477..0f41896 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 025c955..df54cf3 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
-
-info: doc/org
-
-html: doc/org.html
+install: install-lisp install-info
-pdf: doc/org.pdf doc/orgguide.pdf
+docs: info html pdf card
-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
-
-doc/org: doc/org.texi
- (cd doc && $(MAKEINFO) --no-split org.texi -o org)
-
-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) $(<F))
-doc/%.pdf: doc/%.tex
- (cd doc && $(TEXI2PDF) $(<F))
+ $(MAKE) -C $< $@
-doc/org.html: doc/org.texi
- (cd doc && $(TEXI2HTML) --no-split -o org.html org.texi)
- UTILITIES/manfull.pl doc/org.html
-
-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
-
-cleanall: clean
- $(MAKE) -C lisp cleanall
+cleanall: $(SUBDIRS)
+ $(foreach dir, $?, $(MAKE) -C $(dir) $@;)
+ -$(FIND) . -name \*~ -exec $(RM) {} \;
-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