refgen/Makefile

42 lines
989 B
Makefile
Raw Normal View History

2017-10-03 21:52:55 +00:00
PDFLATEX ?= pdflatex
PDFLATEX_FLAGS ?= -halt-on-error -output-directory tmp
2017-10-04 12:47:48 +00:00
files := $(wildcard org/*.org)
.PHONY: clean upload publish org html pdf tex
2017-10-03 21:52:55 +00:00
all: org html pdf tex
2017-10-04 12:47:48 +00:00
org html pdf tex : $(wildcard org/*.org)
GOALS=`echo $(files) | sed 's/\.org/.$@/g' | sed 's/org\//out\//g'`; \
$(MAKE) $$GOALS;
2017-10-03 21:52:55 +00:00
out tmp :
mkdir $@
.SECONDEXPANSION:
2017-10-04 12:47:48 +00:00
out/%.org out/%.tex out/%.pdf out/%.html : $$(subst out,tmp,$$@) | out
2017-10-03 21:52:55 +00:00
cp $< out/
tmp/%.org : org/%.org | tmp
cp $< tmp/
sed -i '1i#+SETUPFILE: ../setup.org' $@
tmp/%.tex : tmp/%.org | 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:
2017-10-04 12:47:48 +00:00
rm -r tmp out
2017-10-03 21:52:55 +00:00
upload:
scp -P 35284 out/* christoffer@users.guava.space:public_html/holdets_time/
2017-10-04 12:47:48 +00:00
publish:
cp out/* ~/public_html/holdets_time/