Merge branch 'origin-maint'
[org-mode.git] / Makefile
blob1022cdc9ff14c9d7f3004c4181507acf9f7414a2
1 # Makefile - for the org-mode distribution
3 # Maintainer: Carsten Dominik <dominik@science.uva.nl>
4 # Version: VERSIONTAG
6 # To install org-mode, edit the Makefile, type `make', then `make install'.
7 # To create the PDF and HTML documentation files, type `make doc'.
9 ##----------------------------------------------------------------------
10 ## YOU MUST EDIT THE FOLLOWING LINES
11 ##----------------------------------------------------------------------
13 # Name of your emacs binary
14 EMACS=emacs
16 # Where local software is found
17 prefix=/usr/local
19 # Where local lisp files go
20 lispdir = $(prefix)/share/emacs/site-lisp
22 # Where data files go
23 # $(datadir) contains auxiliary files for use with ODT exporter.
24 # See comments under DATAFILES.
25 datadir = $(prefix)/share/emacs/etc
27 # Where info files go
28 infodir = $(prefix)/share/info
30 ##----------------------------------------------------------------------
31 ## YOU MAY NEED TO EDIT THESE
32 ##----------------------------------------------------------------------
34 # Using emacs in batch mode.
36 BATCH=$(EMACS) -batch -q -no-site-file -eval \
37 "(setq load-path (cons (expand-file-name \"./lisp/\") (cons \"$(lispdir)\" load-path)))" $(BATCH_EXTRA)
39 # Specify the byte-compiler for compiling org-mode files
40 ELC= $(BATCH) -f batch-byte-compile
42 # How to make a pdf file from a texinfo file
43 TEXI2PDF = texi2pdf
45 # How to create directories
46 MKDIR = mkdir -p
48 # How to create the info files from the texinfo file
49 MAKEINFO = makeinfo
51 # How to create the HTML file
52 TEXI2HTML = makeinfo --html --number-sections
53 TEXI2HTMLNOPSLIT = makeinfo --html --no-split --number-sections
55 # How to copy the lisp files and elc files to their distination.
56 CP = cp -pr
58 # Name of the program to install info files
59 INSTALL_INFO=install-info
61 ##----------------------------------------------------------------------
62 ## BELOW THIS LINE ON YOUR OWN RISK!
63 ##----------------------------------------------------------------------
65 # The following variables need to be defined by the maintainer
66 LISPF = org.el \
67 org-agenda.el \
68 org-ascii.el \
69 org-attach.el \
70 org-archive.el \
71 org-bbdb.el \
72 org-beamer.el \
73 org-bibtex.el \
74 org-capture.el \
75 org-clock.el \
76 org-colview.el \
77 org-colview-xemacs.el \
78 org-compat.el \
79 org-pcomplete.el \
80 org-crypt.el \
81 org-ctags.el \
82 org-datetree.el \
83 org-docview.el \
84 org-entities.el \
85 org-exp.el \
86 org-exp-blocks.el \
87 org-docbook.el \
88 org-faces.el \
89 org-feed.el \
90 org-footnote.el \
91 org-freemind.el \
92 org-gnus.el \
93 org-eshell.el \
94 org-habit.el \
95 org-html.el \
96 org-icalendar.el \
97 org-id.el \
98 org-indent.el \
99 org-info.el \
100 org-inlinetask.el \
101 org-jsinfo.el \
102 org-irc.el \
103 org-latex.el \
104 org-list.el \
105 org-lparse.el \
106 org-mac-message.el \
107 org-macs.el \
108 org-mew.el \
109 org-mhe.el \
110 org-mks.el \
111 org-mobile.el \
112 org-mouse.el \
113 org-odt.el \
114 org-publish.el \
115 org-plot.el \
116 org-protocol.el \
117 org-remember.el \
118 org-rmail.el \
119 org-special-blocks.el \
120 org-src.el \
121 org-table.el \
122 org-taskjuggler.el \
123 org-timer.el \
124 org-vm.el \
125 org-w3m.el \
126 org-wl.el \
127 org-xoxo.el \
128 ob.el \
129 ob-table.el \
130 ob-lob.el \
131 ob-ref.el \
132 ob-exp.el \
133 ob-tangle.el \
134 ob-comint.el \
135 ob-eval.el \
136 ob-keys.el \
137 ob-awk.el \
138 ob-C.el \
139 ob-calc.el \
140 ob-ditaa.el \
141 ob-haskell.el \
142 ob-perl.el \
143 ob-sh.el \
144 ob-R.el \
145 ob-dot.el \
146 ob-mscgen.el \
147 ob-latex.el \
148 ob-lisp.el \
149 ob-ledger.el \
150 ob-python.el \
151 ob-sql.el \
152 ob-asymptote.el \
153 ob-emacs-lisp.el \
154 ob-matlab.el \
155 ob-ruby.el \
156 ob-sqlite.el \
157 ob-clojure.el \
158 ob-ocaml.el \
159 ob-sass.el \
160 ob-css.el \
161 ob-gnuplot.el \
162 ob-octave.el \
163 ob-screen.el \
164 ob-plantuml.el \
165 ob-org.el \
166 ob-js.el \
167 ob-scheme.el \
168 ob-lilypond.el \
169 ob-java.el \
170 ob-shen.el \
171 ob-fortran.el \
172 ob-picolisp.el \
173 ob-maxima.el \
174 ob-io.el \
175 ob-scala.el
177 LISPFILES0 = $(LISPF:%=lisp/%)
178 LISPFILES = $(LISPFILES0) lisp/org-install.el
179 ELCFILES0 = $(LISPFILES0:.el=.elc)
180 ELCFILES = $(LISPFILES:.el=.elc)
181 DOCFILES = doc/org.texi doc/org.pdf doc/org doc/dir \
182 doc/pdflayout.sty doc/.nosearch \
183 doc/orgguide.texi doc/orgguide.pdf
184 CARDFILES = doc/orgcard.tex doc/orgcard.pdf doc/orgcard_letter.pdf
185 TEXIFILES = doc/org.texi
186 INFOFILES = doc/org
188 # etc/styles contains OpenDocument style files. These files *must* be
189 # installed for the ODT exporter to function. These files are
190 # distirbuted with GNU ELPA as well as with stock Emacs >= 24.1.
192 # contrib/odt/etc/schema contains OpenDocument schema files. It is
193 # *desirable* but *not* mandatory that these files be installed.
194 # These files are not distributed with stock Emacs. This is because
195 # the terms under which OASIS distributes these files are not
196 # agreeable to FSF.
198 # BasicODConverter-x.y.z.oxt is a LibreOffice extension for converting
199 # OpenDocument files to numerous other formats. It is similar to
200 # unoconv and is implemented in StarBasic. It is *desirable* but
201 # *not* *mandatory* that the converter be installed. It is
202 # distributed under the same license as GNU Emacs. This file is *not*
203 # part of GNU Emacs.
204 DATAFILES = etc/styles \
205 # contrib/odt/BasicODConverter/BasicODConverter*.oxt \
206 # contrib/odt/etc/schema \
208 # Package Manager (ELPA)
209 PKG_TAG = $(shell date +%Y%m%d)
210 PKG_DOC = "Outline-based notes management and organizer"
211 PKG_REQ = "nil"
213 PKG_FILES = $(LISPFILES0) \
214 doc/dir doc/org \
215 doc/pdflayout.sty \
216 doc/org.pdf \
217 doc/orgguide.pdf \
218 doc/orgcard.tex \
219 doc/orgcard.pdf \
220 doc/orgcard_letter.pdf \
221 etc/
223 .SUFFIXES: .el .elc .texi
224 SHELL = /bin/sh
226 # Additional distribution files
227 DISTFILES_extra= Makefile request-assign-future.txt contrib etc
229 default: $(ELCFILES) $(ELCBFILES)
231 all: $(ELCFILES) $(ELCBFILES) $(INFOFILES)
233 up2: update
234 sudo ${MAKE} install
236 update:
237 git pull
238 ${MAKE} clean
239 ${MAKE} all
241 compile: $(ELCFILES0) $(ELCBFILES)
243 install: install-lisp install-data
245 doc: doc/org.html doc/org.pdf doc/orgcard.pdf doc/orgcard_letter.pdf doc/orgguide.pdf doc/orgcard.txt
248 ${MAKE} pdf && open doc/org.pdf
251 ${MAKE} pdf && open doc/orgguide.pdf
253 # Always force re-compilation of org-odt
254 lisp/org-odt.elc: org-odt-data-dir
255 org-odt-data-dir:
257 # Sleight of hand to "hard code" the value of $(datadir) in
258 # org-odt.el. See variables `org-odt-styles-dir-list' and
259 # `org-odt-schema-dir-list'.
260 install-lisp: BATCH_EXTRA = -eval "(setq org-odt-data-dir (expand-file-name \"$(datadir)\"))"
262 install-lisp: $(LISPFILES) $(ELCFILES)
263 if [ ! -d $(DESTDIR)$(lispdir) ]; then \
264 $(MKDIR) $(DESTDIR)$(lispdir); else true; fi ;
265 $(CP) $(LISPFILES) $(DESTDIR)$(lispdir)
266 $(CP) $(ELCFILES) $(DESTDIR)$(lispdir)
268 install-info: $(INFOFILES)
269 if [ ! -d $(DESTDIR)$(infodir) ]; then \
270 $(MKDIR) $(DESTDIR)$(infodir); else true; fi ;
271 $(CP) $(INFOFILES) $(DESTDIR)$(infodir)
272 $(INSTALL_INFO) --infodir=$(DESTDIR)$(infodir) $(INFOFILES)
274 install-data: $(DATAFILES)
275 if [ ! -d $(DESTDIR)$(datadir) ]; then \
276 $(MKDIR) $(DESTDIR)$(datadir); else true; fi ;
277 $(CP) $(DATAFILES) $(DESTDIR)$(datadir)
279 autoloads: lisp/org-install.el
281 lisp/org-install.el: $(LISPFILES0) Makefile
282 $(BATCH) --eval "(require 'autoload)" \
283 --eval '(find-file "lisp/org-install.el")' \
284 --eval '(erase-buffer)' \
285 --eval '(mapc (lambda (x) (generate-file-autoloads (symbol-name x))) (quote ($(LISPF))))' \
286 --eval '(insert "\n(provide (quote org-install))\n")' \
287 --eval '(save-buffer)'
289 doc/org: doc/org.texi
290 (cd doc && $(MAKEINFO) --no-split org.texi -o org)
292 doc/org.pdf: doc/org.texi
293 (cd doc && $(TEXI2PDF) org.texi)
295 doc/orgguide.pdf: doc/orgguide.texi
296 (cd doc && $(TEXI2PDF) orgguide.texi)
298 doc/org.html: doc/org.texi
299 (cd doc && $(TEXI2HTML) --no-split -o org.html org.texi)
300 UTILITIES/manfull.pl doc/org.html
302 doc/orgcard.pdf: doc/orgcard.tex
303 (cd doc && pdftex orgcard.tex)
305 doc/orgcard.txt: doc/orgcard.tex
306 (cd doc && perl ../UTILITIES/orgcard2txt.pl orgcard.tex > orgcard.txt)
308 doc/orgcard_letter.tex: doc/orgcard.tex
309 perl -pe 's/\\pdflayout=\(0l\)/\\pdflayout=(1l)/' \
310 doc/orgcard.tex > doc/orgcard_letter.tex
312 doc/orgcard_letter.pdf: doc/orgcard_letter.tex
313 (cd doc && pdftex orgcard_letter.tex)
315 # Below here are special targets for maintenance only
317 html: doc/org.html
319 html_manual: doc/org.texi
320 rm -rf doc/manual
321 mkdir doc/manual
322 $(TEXI2HTML) -o doc/manual doc/org.texi
323 UTILITIES/mansplit.pl doc/manual/*.html
325 html_guide: doc/orgguide.texi
326 rm -rf doc/guide
327 mkdir doc/guide
328 $(TEXI2HTML) -o doc/guide doc/orgguide.texi
329 UTILITIES/guidesplit.pl doc/guide/*.html
331 info: doc/org
333 pdf: doc/org.pdf doc/orgguide.pdf
335 card: doc/orgcard.pdf doc/orgcard_letter.pdf doc/orgcard.txt
337 testrelease:
338 git checkout -b testrelease origin/maint
339 git merge -s recursive -X theirs master
340 UTILITIES/set-version.pl testing
341 git commit -a -m "Release testing"
342 make distfile TAG=testversion
343 make cleanrel
344 rm -rf org-testversion*
345 git reset --hard
346 git checkout master
347 git branch -D testrelease
349 # The following target makes a full release for the stuff that is
350 # currently on master. Do it like this:
352 # make release TAG=7.01
354 release:
355 git checkout maint
356 git merge -s recursive -X theirs master
357 UTILITIES/set-version.pl $(TAG)
358 git commit -a -m "Release $(TAG)"
359 make relup TAG=$(TAG)
360 make cleanrel
361 rm -rf org-$(TAG)
362 rm -f org-$(TAG)*.zip
363 rm -f org-$(TAG)*.tar.gz
364 make pushreleasetag TAG=$(TAG)
365 git push -f origin maint
366 git checkout master
367 git merge -s ours maint
368 UTILITIES/set-version.pl -a $(TAG)
369 git commit -a -m "Update website to show $(TAG) as current release"
370 git push
372 # The following target makes a release, but from the stuff that is on
373 # maint, not from the stuff that is on master. The idea is that it pushes
374 # out a minor fix into a minor update, while development on master
375 # already went full steam ahead. To make a micro-relesse, cherry-pick
376 # the necessary changes into maint, then run (with proper version number)
377 # This is just like release, but we skip the step which merges master
378 # into maint.
380 # make fixrelease TAG=7.01.02
382 fixrelease:
383 git checkout maint
384 git merge -s recursive -X theirs master
385 UTILITIES/set-version.pl $(TAG)
386 git commit -a -m "Release $(TAG)"
387 make relup TAG=$(TAG)
388 make cleanrel
389 rm -rf org-$(TAG)
390 rm org-$(TAG)*.zip
391 rm org-$(TAG)*.tar.gz
392 make pushreleasetag TAG=$(TAG)
393 git push -f origin maint
394 git checkout master
395 git merge -s ours maint
396 UTILITIES/set-version.pl -o $(TAG)
397 git commit -a -m "Update website to show $(TAG) as current release"
398 git push
400 # ~$ make relup only makes sense from orgmode.org server
401 # Don't call it from your computer!
402 relup:
403 ${MAKE} makerelease
404 ${MAKE} sync_release
405 ${MAKE} sync_manual
407 makerelease:
408 @if [ "X$(TAG)" = "X" ]; then echo "*** No tag ***"; exit 1; fi
409 ${MAKE} distfile
410 ${MAKE} doc
411 UTILITIES/gplmanual.pl
412 ${MAKE} html_manual
413 ${MAKE} html_guide
414 rm -rf RELEASEDIR
415 $(MKDIR) RELEASEDIR
416 cp org-$(TAG).zip org-$(TAG).tar.gz RELEASEDIR
417 cp doc/org.pdf doc/orgcard.pdf doc/org.texi doc/org.html RELEASEDIR
418 cp doc/org_dual_license.texi RELEASEDIR
419 cp doc/orgguide.pdf doc/orgcard.txt RELEASEDIR
420 cp RELEASEDIR/org-$(TAG).zip RELEASEDIR/org.zip
421 cp RELEASEDIR/org-$(TAG).tar.gz RELEASEDIR/org.tar.gz
423 # ~$ make sync_release only makes sense from orgmode.org server
424 # Don't call it from your computer!
425 sync_release:
426 rsync -avuz RELEASEDIR/ /var/www/orgmode.org/
428 # ~$ make sync_manual only makes sense from orgmode.org server
429 # Don't call it from your computer!
430 sync_manual:
431 rsync -avuz --delete doc/manual/ /var/www/orgmode.org/manual/
432 rsync -avuz --delete doc/guide/ /var/www/orgmode.org/guide/
434 distfile:
435 @if [ "X$(TAG)" = "X" ]; then echo "*** No tag ***"; exit 1; fi
436 touch doc/org.texi doc/orgcard.tex # force update
437 ${MAKE} cleancontrib
438 ${MAKE} info
439 ${MAKE} doc
440 ${MAKE} lisp/org-install.el
441 rm -rf org-$(TAG) org-$(TAG).zip
442 $(MKDIR) org-$(TAG)
443 $(MKDIR) org-$(TAG)/doc
444 $(MKDIR) org-$(TAG)/lisp
445 cp -r $(LISPFILES) org-$(TAG)/lisp
446 cp -r $(DOCFILES) $(CARDFILES) org-$(TAG)/doc
447 cp -r $(DISTFILES_extra) org-$(TAG)/
448 cp -r README_DIST org-$(TAG)/README
449 zip -r org-$(TAG).zip org-$(TAG)
450 tar zcvf org-$(TAG).tar.gz org-$(TAG)
452 pkg:
453 @if [ "X$(PKG_TAG)" = "X" ]; then echo "*** No tag ***"; exit 1; fi
454 touch doc/org.texi doc/orgcard.tex # force update
455 ${MAKE} info
456 ${MAKE} doc
457 rm -rf org-$(PKG_TAG) org-$(PKG_TAG).tar
458 $(MKDIR) org-$(PKG_TAG)
459 cp -r $(PKG_FILES) org-$(PKG_TAG)
460 echo "(define-package \"org\" \"$(PKG_TAG)\" \"$(PKG_DOC)\" $(PKG_REQ))" > org-$(PKG_TAG)/org-pkg.el
461 tar cf org-$(PKG_TAG).tar org-$(PKG_TAG) --remove-files
463 cleanall:
464 ${MAKE} clean
465 rm -f lisp/org-install.el
467 clean:
468 ${MAKE} cleanelc
469 ${MAKE} cleandoc
470 ${MAKE} cleanrel
471 rm -f *~ */*~ */*/*~
473 cleancontrib:
474 find contrib -name \*~ -exec rm {} \;
476 cleanelc:
477 rm -f $(ELCFILES)
478 cleandoc:
479 -(cd doc && rm -f org.pdf org org.html orgcard.pdf orgguide.pdf)
480 -(cd doc && rm -f *.aux *.cp *.cps *.dvi *.fn *.fns *.ky *.kys *.pg *.pgs)
481 -(cd doc && rm -f *.toc *.tp *.tps *.vr *.vrs *.log *.html *.ps)
482 -(cd doc && rm -f orgcard_letter.tex orgcard_letter.pdf)
483 -(cd doc && rm -rf manual)
485 cleanrel:
486 rm -rf RELEASEDIR
487 rm -rf org-7.*
488 rm -rf org-7*zip org-7*tar.gz
490 .el.elc:
491 $(ELC) $<
494 push:
495 git push orgmode@orgmode.org:org-mode.git master
497 pushtag:
498 git tag -m "Adding tag" -a $(TAG)
499 git push orgmode@orgmode.org:org-mode.git $(TAG)
501 pushreleasetag:
502 git tag -m "Adding release tag" -a release_$(TAG)
503 git push orgmode@orgmode.org:org-mode.git release_$(TAG)
505 # Dependencies
507 lisp/org.elc: lisp/org-macs.el lisp/org-compat.el lisp/org-faces.el
508 lisp/org-agenda.elc: lisp/org.el
509 lisp/org-ascii.elc: lisp/org-exp.el
510 lisp/org-attach.elc: lisp/org.el lisp/org-id.el
511 lisp/org-archive.elc: lisp/org.el
512 lisp/org-bbdb.elc: lisp/org.el
513 lisp/org-beamer.elc: lisp/org.el
514 lisp/org-bibtex.elc: lisp/org.el
515 lisp/org-capture.elc: lisp/org.el lisp/org-mks.el
516 lisp/org-clock.elc: lisp/org.el
517 lisp/org-colview.elc: lisp/org.el
518 lisp/org-colview-xemacs.elc: lisp/org.el
519 lisp/org-compat.elc: lisp/org-macs.el
520 lisp/org-crypt.elc: lisp/org-crypt.el lisp/org.el
521 lisp/org-ctags.elc: lisp/org.el
522 lisp/org-datetree.elc: lisp/org.el
523 lisp/org-docview.elc: lisp/org.el
524 lisp/org-entities.elc:
525 lisp/org-exp.elc: lisp/org.el lisp/org-agenda.el
526 lisp/org-exp-blocks.elc: lisp/org.el
527 lisp/org-latex.elc: lisp/org.el lisp/org-exp.el lisp/org-beamer.el
528 lisp/org-docbook.elc: lisp/org.el lisp/org-exp.el
529 lisp/org-faces.elc: lisp/org-macs.el lisp/org-compat.el
530 lisp/org-feed.elc: lisp/org.el
531 lisp/org-footnotes.elc: lisp/org-macs.el lisp/org-compat.el
532 lisp/org-freemind.elc: lisp/org.el
533 lisp/org-gnus.elc: lisp/org.el
534 lisp/org-html.elc: lisp/org-exp.el
535 lisp/org-habit.elc: lisp/org.el lisp/org-agenda.el
536 lisp/org-icalendar.elc: lisp/org-exp.el
537 lisp/org-id.elc: lisp/org.el
538 lisp/org-indent.elc: lisp/org.el lisp/org-macs.el lisp/org-compat.el
539 lisp/org-info.elc: lisp/org.el
540 lisp/org-inlinetask.elc:
541 lisp/org-irc.elc: lisp/org.el
542 lisp/org-jsinfo.elc: lisp/org.el lisp/org-exp.el
543 lisp/org-list.elc: lisp/org-macs.el lisp/org-compat.el
544 lisp/org-lparse.elc: lisp/org-exp.el
545 lisp/org-mac-message.elc: lisp/org.el
546 lisp/org-macs.elc:
547 lisp/org-mew.elc: lisp/org.el
548 lisp/org-mhe.elc: lisp/org.el
549 lisp/org-mks.elc:
550 lisp/org-mobile.elc: lisp/org.el
551 lisp/org-mouse.elc: lisp/org.el
552 lisp/org-odt.elc: lisp/org-lparse.el
553 lisp/org-plot.elc: lisp/org.el lisp/org-exp.el lisp/org-table.el
554 lisp/org-publish.elc:
555 lisp/org-protocol.elc: lisp/org.el
556 lisp/org-remember.elc: lisp/org.el
557 lisp/org-rmail.elc: lisp/org.el
558 lisp/org-special-blocks.elc: lisp/org-compat.el
559 lisp/org-src.elc: lisp/org-macs.el lisp/org-compat.el
560 lisp/org-table.elc: lisp/org.el
561 lisp/org-taskjuggler.elc: lisp/org.el lisp/org-exp.el
562 lisp/org-timer.elc: lisp/org.el
563 lisp/org-vm.elc: lisp/org.el
564 lisp/org-w3m.elc: lisp/org.el
565 lisp/org-wl.elc: lisp/org.el
566 lisp/org-xoxo.elc: lisp/org-exp.el
568 # Describe valid make targets for org-mode.
569 targets help:
570 @echo "make - compile Org ELisp files"
571 @echo "make clean - clean Elisp and documentation files"
572 @echo "make all - compile Org ELisp files and documentation"
573 @echo ""
574 @echo "make doc - make all documentation"
575 @echo "make info - make Info documentation"
576 @echo "make html - make HTML documentation"
577 @echo "make pdf - make pdf documentation"
578 @echo "make card - make refcards documentation"
579 @echo ""
580 @echo "make install - install Org"
581 @echo "make install-lisp - install Org ELisp files"
582 @echo "make install-info - install Org Info file"