|
default: all
|
|
# $^ -> finished $@ at $(shell date)
|
|
|
|
SOURCE_FILES := $(shell find . -type f | egrep -v '(cache|output|.doit.db|#)' )
|
|
NEWEST := $(shell ls -t $(SOURCE_FILES) | head -1 )
|
|
LATEX_MAKEFILES := $(shell find latex -name Makefile)
|
|
LATEX_FOLDERS := $(dir $(LATEX_MAKEFILES))
|
|
LATEX_TEX := $(shell find $(LATEX_FOLDERS) -maxdepth 1 -name [^.]\*.tex)
|
|
LATEX_PDFS := $(patsubst %.tex,%.pdf,$(LATEX_TEX))
|
|
|
|
newest:
|
|
@echo ================ updated file: $(NEWEST)
|
|
|
|
all: latex output
|
|
# $^ -> finished $@ at $(shell date)
|
|
clean: latex-clean
|
|
rm -rfv output
|
|
# $^ -> finished $@ at $(shell date)
|
|
|
|
serve: all
|
|
cd output && python -m http.server
|
|
# $^ -> finished $@ at $(shell date)
|
|
|
|
output: $(NEWEST)
|
|
nikola build
|
|
date > $@/sentinel
|
|
touch $@
|
|
# $^ -> finished $@ at $(shell date)
|
|
|
|
continuous: all
|
|
while true ; do \
|
|
$(MAKE) -q -s latex output || $(MAKE) newest all; \
|
|
/bin/echo -n -e \\r $$(date +"%F %T.%N :") "" ; \
|
|
sleep 1; \
|
|
done
|
|
# $^ -> finished $@ at $(shell date)
|
|
|
|
latex: $(LATEX_PDFS)
|
|
touch $@
|
|
# $^ -> finished $@ at $(shell date)
|
|
%.pdf : %.tex
|
|
$(MAKE) -C $(dir $@)
|
|
# $^ -> finished $@ at $(shell date)
|
|
latex-clean:
|
|
$(foreach folder, $(LATEX_FOLDERS), $(MAKE) -C $(folder) clean;)
|
|
# $^ -> finished $@ at $(shell date)
|