summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAchim Gratz <Stromeko@Stromeko.DE>2011-07-12 22:31:41 +0200
committerAchim Gratz <Stromeko@Stromeko.DE>2012-04-20 21:04:07 +0200
commit77f0e507874aba14a25d37f38f5bbf2608efdd1b (patch)
tree8347848646a99ad636c4b3891738876ab946b4ba
parent2386380c72b9e6eca7b87060c22975485524ddbe (diff)
downloadorg-mode-77f0e507874aba14a25d37f38f5bbf2608efdd1b.tar.gz
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
-rw-r--r--Makefile3
-rw-r--r--default.mk6
-rw-r--r--maint-targets.mk48
-rw-r--r--targets.mk80
4 files changed, 71 insertions, 66 deletions
diff --git a/Makefile b/Makefile
index 02ed3c3..225dad3 100644
--- a/Makefile
+++ b/Makefile
@@ -3,10 +3,9 @@
# Maintainer: Carsten Dominik <dominik@science.uva.nl>
# 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 802105a..f19ac49 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 d22dc53..3d71d7a 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 409ee0f..5ccdf19 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) $(<F))
+doc/%.pdf: doc/%.tex
+ (cd doc && $(TEXI2PDF) $(<F))
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)
@@ -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) $<