refgen/Makefile

42 lines
939 B
Makefile
Raw Normal View History

2017-10-03 21:52:55 +00:00
PDFLATEX ?= pdflatex
PDFLATEX_FLAGS ?= -halt-on-error -output-directory tmp
.PHONY: clean upload org html pdf tex
all: org html pdf tex
org html pdf tex:
for org in $(wildcard org/*.org); do \
$(MAKE) `echo $$org | sed s/.org/.$@/ | sed s/org/out/`; \
done
out tmp :
mkdir $@
.SECONDEXPANSION:
out/%.org out/%.tex out/%.pdf out/%.html : $$(subst out,tmp,$$@)
echo $@
echo $<
echo $(subst out,tmp,$@)
cp $< out/
tmp/%.org : org/%.org | tmp
cp $< tmp/
sed -i '1i#+SETUPFILE: ../setup.org' $@
tmp/%.tex : tmp/%.org | tmp
cd tmp;
emacs --batch $< -l ../init.el -f org-mode --eval '(org-latex-export-to-latex)'
tmp/%.pdf : tmp/%.tex | tmp
$(PDFLATEX) $(PDFLATEX_FLAGS) $<; \
$(PDFLATEX) $(PDFLATEX_FLAGS) $<
tmp/%.html : tmp/%.org | tmp
emacs --batch $< -l ../init.el -f org-mode --eval '(org-html-export-to-html)'
clean:
rm -r tmp
upload:
scp -P 35284 out/* christoffer@users.guava.space:public_html/holdets_time/