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