From a89c213ef8cd3791d772f5b8bda95198af7dbf5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoffer=20M=C3=BCller=20Madsen?= Date: Wed, 4 Oct 2017 14:47:48 +0200 Subject: [PATCH] forbedr rekursive kald til make --- Makefile | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) 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/