diff --git a/Makefile b/Makefile index 3b285dc..0335b77 100644 --- a/Makefile +++ b/Makefile @@ -1,21 +1,20 @@ PDFLATEX ?= pdflatex PDFLATEX_FLAGS ?= -halt-on-error -output-directory tmp -.PHONY: clean upload org html pdf tex +files := $(wildcard org/*.org) + +.PHONY: clean upload publish 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 +org html pdf tex : $(wildcard org/*.org) + GOALS=`echo $(files) | sed 's/\.org/.$@/g' | sed 's/org\//out\//g'`; \ + $(MAKE) $$GOALS; + out tmp : mkdir $@ .SECONDEXPANSION: -out/%.org out/%.tex out/%.pdf out/%.html : $$(subst out,tmp,$$@) - echo $@ - echo $< - echo $(subst out,tmp,$@) +out/%.org out/%.tex out/%.pdf out/%.html : $$(subst out,tmp,$$@) | out cp $< out/ tmp/%.org : org/%.org | tmp @@ -23,7 +22,6 @@ tmp/%.org : org/%.org | 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 @@ -34,8 +32,10 @@ tmp/%.html : tmp/%.org | tmp emacs --batch $< -l ../init.el -f org-mode --eval '(org-html-export-to-html)' clean: - rm -r tmp + rm -r tmp out upload: scp -P 35284 out/* christoffer@users.guava.space:public_html/holdets_time/ +publish: + cp out/* ~/public_html/holdets_time/