aboutsummaryrefslogtreecommitdiff
path: root/code/makefile
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2022-08-29 16:59:57 +0200
committermetamuffin <metamuffin@disroot.org>2022-08-29 16:59:57 +0200
commit7853c8a551806007c3697a38fa5f929ca45a0985 (patch)
tree52152d615d88a5ef5ca795a58722c4e6a52882e6 /code/makefile
parentddc681c7793a990a67ae61ec183bb1a1138ea3ef (diff)
downloadmetamuffin-blog-7853c8a551806007c3697a38fa5f929ca45a0985.tar
metamuffin-blog-7853c8a551806007c3697a38fa5f929ca45a0985.tar.bz2
metamuffin-blog-7853c8a551806007c3697a38fa5f929ca45a0985.tar.zst
rename tools to code
Diffstat (limited to 'code/makefile')
-rw-r--r--code/makefile20
1 files changed, 20 insertions, 0 deletions
diff --git a/code/makefile b/code/makefile
new file mode 100644
index 0000000..fa1464d
--- /dev/null
+++ b/code/makefile
@@ -0,0 +1,20 @@
+
+TOOL := ../code/target/debug/blog-tool
+
+SRC_ARTICLES := $(shell find articles -type f)
+OUT_ARTICLES := $(SRC_ARTICLES:articles/%.md=out/%.html)
+
+all: $(OUT_ARTICLES) out/index.html
+
+out/style.css: style.css
+ cp $< $@
+
+out/index.html: $(TOOL) $(SRC_ARTICLES)
+ $(TOOL) render-index ./articles > $@
+
+out/%.html: articles/%.md $(TOOL) out/style.css
+ mkdir -p out
+ $(TOOL) render-article $< > $@
+
+$(TOOL): $(shell find ../code/src -type f)
+ sh -c 'cd ../code; cargo build'