horribelt og ulæseligt

This commit is contained in:
Christoffer Müller Madsen 2017-10-04 15:50:07 +02:00
parent a89c213ef8
commit a28f76e394

View File

@ -7,15 +7,19 @@ files := $(wildcard org/*.org)
all: org html pdf tex all: org html pdf tex
org html pdf tex : $(wildcard org/*.org) org html pdf tex : $(wildcard org/*.org)
GOALS=`echo $(files) | sed 's/\.org/.$@/g' | sed 's/org\//out\//g'`; \ GOALS=`echo $(foreach file,$(files),out/$(basename $(notdir $(file)))/$(notdir $(file))) | sed 's/\.org/.$@/g'`; \
$(MAKE) $$GOALS; $(MAKE) $$GOALS;
out tmp : out tmp :
mkdir $@ mkdir $@
.SECONDEXPANSION: .SECONDEXPANSION:
out/%.org out/%.tex out/%.pdf out/%.html : $$(subst out,tmp,$$@) | out out/%.org out/%.tex out/%.pdf out/%.html : tmp/$$(notdir $$@) | out
cp $< out/ mkdir -p $(@D)
echo $@
echo out/$(basename $(notdir $@))
echo $(notdir $@) out/$(basename $(notdir $<)) $<
cp $< out/$(basename $(notdir $<))
tmp/%.org : org/%.org | tmp tmp/%.org : org/%.org | tmp
cp $< tmp/ cp $< tmp/
@ -38,4 +42,4 @@ upload:
scp -P 35284 out/* christoffer@users.guava.space:public_html/holdets_time/ scp -P 35284 out/* christoffer@users.guava.space:public_html/holdets_time/
publish: publish:
cp out/* ~/public_html/holdets_time/ cp -r out/* ~/public_html/holdets_time/