revamp the website
[~bandali/bndl.org] / GNUmakefile
... / ...
CommitLineData
1SITE_DOMAIN := 'https://shemshak.org'
2SITE_PREFIX := '/~bandali'
3SITE_URL := '$(SITE_DOMAIN)$(SITE_PREFIX)'
4
5SRC := $(filter-out $(wildcard meta_*), $(wildcard *.m4))
6OUTPUTS := $(patsubst %.m4,out/%.html, $(SRC))
7STATIC := $(patsubst static/%,out/%, $(filter-out static/GNUmakefile, $(wildcard static/* static/.*)))
8
9all: $(OUTPUTS) out/notes.atom out/notes.rss out/style.css out/GNUmakefile $(STATIC)
10
11out/%.html: %.m4 header.html footer.html
12 @mkdir -p $(@D)
13 m4 -D__d=$(SITE_DOMAIN) -D__p=$(SITE_PREFIX) $< > $@
14out/notes.%: meta_feed_%.m4 $(SRC) header.html footer.html
15 m4 -D__d=$(SITE_DOMAIN) -D__p=$(SITE_PREFIX) $< > $@
16 sed -i 's|href="/\([^/]\)|href="$(SITE_DOMAIN)/\1|' $@
17out/GNUmakefile: GNUmakefile ; ln -s $(PWD)/$< $@
18$(STATIC): ; ln -s $(PWD)/static/$(@F) $@
19
20# publications bibliography
21static/publications-partial.html: static/bandali.bib static/bandali-bib-*
22static/publications-partial.html: $(filter-out static/publications-partial.html, $(wildcard static/publications-*))
23static/publications-partial.html:
24 $(MAKE) -C $(@D) $(@F)
25out/publications.html: static/publications-partial.html
26out/bandali-bib.html: static/bandali-bib-partial.html
27
28clean:
29 rm -rf out/
30
31deploy:
32 rsync -avzLP out/ bandali@shemshak.org:~/public_html/
33
34watch:
35 while true; do \
36 echo $(SRC) header.html footer.html \
37 static/bandali.bib static/bandali-bib-* static/publications-* \
38 GNUmakefile static/GNUmakefile | \
39 tr " " "\n" | entr -d make; done
40
41.PHONY: deploy watch