-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
37 lines (27 loc) · 906 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/make -f
SITE_REMOTE ?= www/
export SITE_TITLE ?= Fäktning/M5K i Falun
export SUBTITLE ?= En sektion i Dalregementets IF
KEYWORDS_BASE ?= fäktning, M5K, modern femkamp, värja, falun
SITE_RSYNC_OPTS ?= -O -e "ssh -i deploy_key"
.PHONY: help build deploy clean
SRC = src
IMG = data/img
export TMPL = templates
#PAGES = $(shell git ls-tree HEAD --name-only -- $(SRC)/*.html 2>/dev/null)
PAGES = $(shell ls -1 -- $(SRC)/*.txt 2>/dev/null)
help:
$(info make build|deploy|clean)
build: $(patsubst $(SRC)/%.txt,build/%.html,$(PAGES)) \
build/img \
build/js/calendar.js
deploy: build
rsync -rLvzc $(SITE_RSYNC_OPTS) build/ data/ $(SITE_REMOTE)
clean:
rm -rf build
build/%.html: $(SRC)/%.txt $(addprefix $(TMPL)/,$(addsuffix .html,header banner footer))
sh build.sh "$(SRC)/$(*).txt" "$(@)"
build/img:
sh img.sh $(IMG)
build/js/calendar.js: data/js/buildcalendar.js
sh calendar.sh; \