Commit | Line | Data |
---|---|---|
553a0296 | 1 | SRC := $(filter-out $(wildcard meta_*), $(wildcard *.m4)) |
8c1ba2f2 | 2 | OUTPUTS := $(patsubst %.m4,out/%.html, $(SRC)) |
c867ac90 | 3 | STATIC := $(patsubst static/%,out/%, $(filter-out static/GNUmakefile, $(wildcard static/* static/.*))) |
38037201 | 4 | |
c867ac90 | 5 | all: $(OUTPUTS) out/notes.atom out/notes.rss out/style.css out/GNUmakefile $(STATIC) |
38037201 | 6 | |
d9462d28 AB |
7 | out/%.html: %.m4 header.html footer.html |
8 | @mkdir -p $(@D) | |
9 | m4 $< > $@ | |
dcc71b98 AB |
10 | out/notes.%: meta_feed_%.m4 $(SRC) header.html footer.html |
11 | m4 $< > $@ | |
12 | sed -i 's|href="/\([^/]\)|href="https://bndl.org/\1|' $@ | |
c867ac90 | 13 | out/GNUmakefile: GNUmakefile ; ln -s $(PWD)/$< $@ |
8c1ba2f2 AB |
14 | $(STATIC): ; ln -s $(PWD)/static/$(@F) $@ |
15 | ||
16 | # publications bibliography | |
842b89b2 | 17 | static/publications-partial.html: static/bandali.bib static/bandali-bib-* |
64864447 | 18 | static/publications-partial.html: $(filter-out static/publications-partial.html, $(wildcard static/publications-*)) |
842b89b2 | 19 | static/publications-partial.html: |
8c1ba2f2 | 20 | $(MAKE) -C $(@D) $(@F) |
842b89b2 AB |
21 | out/publications.html: static/publications-partial.html |
22 | out/bandali-bib.html: static/bandali-bib-partial.html | |
38037201 | 23 | |
d9462d28 AB |
24 | clean: |
25 | rm -rf out/ | |
26 | ||
38037201 | 27 | deploy: |
35cf61e5 | 28 | rsync -avzLP out/ abandali@bndl.org:www/bndl.org/ |
dcc71b98 | 29 | # ssh abandali@bndl.org mv www/bndl.org/.htaccess-www www/.htaccess |
e4b339cf | 30 | |
8c1ba2f2 AB |
31 | watch: |
32 | while true; do \ | |
33 | echo $(SRC) header.html footer.html \ | |
842b89b2 | 34 | static/bandali.bib static/bandali-bib-* static/publications-* \ |
c867ac90 | 35 | GNUmakefile static/GNUmakefile | \ |
8c1ba2f2 AB |
36 | tr " " "\n" | entr -d make; done |
37 | ||
38 | .PHONY: deploy watch |