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