summaryrefslogtreecommitdiff
path: root/GNUmakefile
blob: 0d49d96a618bbb2f74735df9a6dbf71fadaa8447 (plain)
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
MD           = $(shell find content/ -name '*.md')
PROPERMD     = $(shell scripts/filter_proper_md $(MD))
HTML         = $(patsubst content/%.md, public/%.html, $(PROPERMD))
STATICASSETS = $(shell find static -type f)
PUBLICASSETS = $(patsubst static/%, public/%, $(STATICASSETS))

# Calling make is used for making sure that index pages are build first
all:
	$(MAKE) -f index_pages.mk
	$(MAKE) pages

pages: $(HTML) $(PUBLICASSETS)

public/%.html: content/%.md
	mkdir -p $$(dirname $@)
	scripts/build_page $< > $@

$(PUBLICASSETS): public/%: static/%
	mkdir -p $$(dirname $@)
	cp $< $@

clean:
	rm -rf public

.PHONY: all clean pages