summaryrefslogtreecommitdiff
path: root/GNUmakefile
diff options
context:
space:
mode:
Diffstat (limited to 'GNUmakefile')
-rw-r--r--GNUmakefile30
1 files changed, 19 insertions, 11 deletions
diff --git a/GNUmakefile b/GNUmakefile
index 26ca3e9..0d49d96 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -1,17 +1,25 @@
-MARKDOWN = $(shell find . -name '*.md')
-HTML = $(patsubst ./%.md, %.html, $(MARKDOWN))
+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))
-all: $(HTML)
+# Calling make is used for making sure that index pages are build first
+all:
+ $(MAKE) -f index_pages.mk
+ $(MAKE) pages
-%.html: %.md build-page
- sh build-page $< > $@
+pages: $(HTML) $(PUBLICASSETS)
-output/: $(HTML)
- echo $? | xargs -n 1 dirname | xargs -I _ mkdir -p $@_
- echo $? | xargs -n 1 | xargs -I _ cp _ $@_
- cp favicon.ico style.css $@
+public/%.html: content/%.md
+ mkdir -p $$(dirname $@)
+ scripts/build_page $< > $@
+
+$(PUBLICASSETS): public/%: static/%
+ mkdir -p $$(dirname $@)
+ cp $< $@
clean:
- rm -rf $(HTML) output/
+ rm -rf public
-.PHONY: all clean
+.PHONY: all clean pages