aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Makefile')
-rw-r--r--lib/Makefile78
1 files changed, 78 insertions, 0 deletions
diff --git a/lib/Makefile b/lib/Makefile
new file mode 100644
index 0000000..bb8b55f
--- /dev/null
+++ b/lib/Makefile
@@ -0,0 +1,78 @@
+#!/usr/bin/env make -f
+#
+# General library Makefile for Fripost meeting minutes and policy
+# documents.
+
+SLIDES ?= # will be compiled with beamer
+MINUTES ?= # will be compiled with *minutes* template
+POLICY ?= # will be compiled with *by-laws* template
+
+# Targets
+
+.PHONY: all
+
+ALL = \
+ $(addsuffix .pdf, $(SLIDES)) \
+ $(addsuffix .pdf, $(POLICY)) \
+ $(addsuffix .pdf, $(MINUTES)) \
+
+all: $(ALL)
+
+# Compilation using pandoc
+
+$(addsuffix .pdf, $(SLIDES)): %.pdf: %.md
+ pandoc -s -f markdown -t beamer -o $@ < $<
+
+$(addsuffix .pdf, $(MINUTES)): %.pdf: %.md
+ pandoc -f markdown -t latex \
+ --template=fripost-minutes \
+ $$(test -f $*.yml && echo --metadata-file=$*.yml) \
+ -o $@ $*.md
+
+$(addsuffix .pdf, $(POLICY)): %.pdf: %.yml %.md
+ pandoc -f markdown -t latex \
+ --template=fripost-by-laws \
+ $$(test -f $*.yml && echo --metadata-file=$*.yml) \
+ -o $@ $*.md
+
+# Archive
+
+.PHONY: archive
+
+ARCHIVE ?= archive
+ROOT ?= $(shell git rev-parse --show-toplevel)
+SUFFIX ?= -$(subst /,,$(dir $(subst $(ROOT),,$(PWD))))
+PDF = $(basename $(wildcard *.pdf))
+
+print:
+ @echo ARCHIVE = $(ARCHIVE)
+ @echo ROOT = $(ROOT)
+ @echo SUFFIX = $(SUFFIX)
+
+archive:
+ for p in $(PDF); do \
+ rsync $$p.pdf $(ROOT)/$(ARCHIVE)/$$p$(SUFFIX).pdf; \
+ done
+
+# Upload to server
+
+.PHONY: send
+
+SEND ?= # files to send
+
+send:
+ rsync -ruvp --chmod=Dugo+rx,Fugo+r $(SEND)\
+ www.fripost.org:/var/www/fripost.org/minutes
+ @echo; echo Now avialable as; \
+ for f in $(SEND); do echo " - https://fripost.org/minutes/$$f"; done
+
+# Clean
+
+.PHONY: clean
+
+clean:
+ rm -f $(ALL)
+ rm -f *~
+
+# Sends to fripost.org for publication
+