Commit | Line | Data |
---|---|---|
29f0d7b9 AB |
1 | SITE_DOMAIN := 'https://shemshak.org' |
2 | SITE_PREFIX := '/~bandali' | |
3 | SITE_URL := '$(SITE_DOMAIN)$(SITE_PREFIX)' | |
4 | ||
553a0296 | 5 | SRC := $(filter-out $(wildcard meta_*), $(wildcard *.m4)) |
8c1ba2f2 | 6 | OUTPUTS := $(patsubst %.m4,out/%.html, $(SRC)) |
c867ac90 | 7 | STATIC := $(patsubst static/%,out/%, $(filter-out static/GNUmakefile, $(wildcard static/* static/.*))) |
38037201 | 8 | |
c867ac90 | 9 | all: $(OUTPUTS) out/notes.atom out/notes.rss out/style.css out/GNUmakefile $(STATIC) |
38037201 | 10 | |
d9462d28 AB |
11 | out/%.html: %.m4 header.html footer.html |
12 | @mkdir -p $(@D) | |
29f0d7b9 | 13 | m4 -D__d=$(SITE_DOMAIN) -D__p=$(SITE_PREFIX) $< > $@ |
dcc71b98 | 14 | out/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 | 17 | out/GNUmakefile: GNUmakefile ; ln -s $(PWD)/$< $@ |
8c1ba2f2 AB |
18 | $(STATIC): ; ln -s $(PWD)/static/$(@F) $@ |
19 | ||
20 | # publications bibliography | |
842b89b2 | 21 | static/publications-partial.html: static/bandali.bib static/bandali-bib-* |
64864447 | 22 | static/publications-partial.html: $(filter-out static/publications-partial.html, $(wildcard static/publications-*)) |
842b89b2 | 23 | static/publications-partial.html: |
8c1ba2f2 | 24 | $(MAKE) -C $(@D) $(@F) |
842b89b2 AB |
25 | out/publications.html: static/publications-partial.html |
26 | out/bandali-bib.html: static/bandali-bib-partial.html | |
38037201 | 27 | |
d9462d28 AB |
28 | clean: |
29 | rm -rf out/ | |
30 | ||
38037201 | 31 | deploy: |
29f0d7b9 | 32 | rsync -avzLP out/ bandali@shemshak.org:~/public_html/ |
e4b339cf | 33 | |
8c1ba2f2 AB |
34 | watch: |
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 |