

all: touch lurette-man.pdf

touch:
	touch touch.tex
clean:
	rm -f *.log *.aux *.log *~ *.toc lurette-man.tex *.out *.blg *.bbl *.html 

realclean: clean
	rm -f *.pdf *.html



PRECIOUS: lurette-man.tex
EMACS=emacs --batch --load=emacs-org.el

%.tex: %.org 
	$(EMACS) --visit=$*.org   --funcall org-export-as-latex

#	bibtex $*

# Expanse les blocs noweb
%.noweb: %.org
	$(EMACS) --visit=$*.org --funcall  org-babel-tangle


%.pdf: %.tex touch.tex
	pdflatex --shell-escape -interaction nonstopmode $*.tex

%.doc: %.odt
	odt2doc $<

%.odt: %.org
	/usr/local/soft/emacs23/stable/bin/emacs --batch \
	  --directory=$(HOME)/el_files/org-mode/lisp/ \
          --load=org-odt.el  \
	  --visit=$*.org --funcall org-export-as-odt


%.html: %.org
	/usr/local/soft/emacs23/23.3/bin/emacs --batch \
	  --directory=$(HOME)/el_files/org-mode/lisp/ \
          --load=org.el  \
          --eval "(setq org-export-headline-levels 2)" \
	  --visit=$*.org --funcall org-export-as-html-batch

bib:
	bibtex lurette-man
