a7071a1aafebd96487461047f392dd25c7ac6090
[~bandali/bndl.org] / Makefile
1 SRC := $(filter-out $(wildcard meta_*), \
2 $(wildcard *.m4 fsf-internship/*.m4))
3 OUTPUTS := $(patsubst %.m4,out/%.html, $(SRC))
4 STATIC := $(patsubst static/%,out/%, \
5 $(filter-out static/publications.html, \
6 $(wildcard static/* static/.*)))
7
8 all: $(OUTPUTS) out/notes.atom out/notes.rss out/style.css $(STATIC)
9
10 out/%.html: %.m4 header.html footer.html
11 @mkdir -p $(@D)
12 m4 $< > $@
13 out/notes.atom: meta_feed_atom.m4 ; m4 $< > $@
14 out/notes.rss: meta_feed_rss.m4 ; m4 $< > $@
15 $(STATIC): ; ln -s $(PWD)/static/$(@F) $@
16
17 # publications bibliography
18 static/publications.html: static/bandali.bib static/bandali-bib-*.txt
19 static/publications.html: static/publications-sed.txt
20 static/publications.html:
21 $(MAKE) -C $(@D) $(@F)
22 out/publications.html: static/publications.html
23
24 clean:
25 rm -rf out/
26
27 deploy:
28 rsync -avzLP out/ abandali@bndl.org:www/site/
29 ssh abandali@bndl.org mv www/site/.htaccess-www www/.htaccess
30
31 watch:
32 while true; do \
33 echo $(SRC) header.html footer.html \
34 static/bandali.bib static/bandali-bib-*.txt \
35 static/publications-sed.txt \
36 Makefile static/Makefile | \
37 tr " " "\n" | entr -d make; done
38
39 .PHONY: deploy watch