-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
59 lines (46 loc) · 1.46 KB
/
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Makefile for CMBA bylaws, inspired by the Github gists below
# https://gist.github.com/kristopherjohnson/7466917
# https://gist.github.com/claudioperez/e8929a16d0c872a7e2063a5e3c04ed49
SHELL = /bin/bash
RM=/bin/rm
PANDOC=/usr/local/bin/pandoc
# --- Source ---
SOURCEDIR := src
# SOURCEFILENAME should not include extenstion
SOURCEFILENAME := cmba-bylaws
# --- Build---
BUILDDIR := build
# SOURCEFILENAME should not include extenstion
BUILDFILENAME := cmba-bylaws
PANDOC_OPTIONS= \
--standalone \
--number-sections \
--toc \
--toc-depth=2 \
--lua-filter $(SOURCEDIR)/shift-numbering.lua\
--metadata-file $(SOURCEDIR)/metadata.yml
PANDOC_PDF_OPTIONS= -V "geometry:left=.75in,right=.75in,top=1in,bottom=1in" \
-V "colorlinks:true"
PANDOC_HTML_OPTIONS=
PANDOC_EPUB_OPTIONS=
ALL=\
pdf \
html \
epub
default: all;
pdf: $(SOURCEDIR)/$(SOURCEFILENAME).md
$(PANDOC) $(PANDOC_OPTIONS) $(PANDOC_PDF_OPTIONS) '$<' -o $(BUILDDIR)/$(BUILDFILENAME).$@
html: $(SOURCEDIR)/$(SOURCEFILENAME).md
$(PANDOC) $(PANDOC_OPTIONS) $(PANDOC_HTML_OPTIONS) '$<' -o $(BUILDDIR)/$(BUILDFILENAME).$@
epub: $(SOURCEDIR)/$(SOURCEFILENAME).md
$(PANDOC) $(PANDOC_OPTIONS) $(PANDOC_EPUB_OPTIONS) '$<' -o $(BUILDDIR)/$(BUILDFILENAME).$@
github:
@make html
@cp -a $(BUILDDIR)/$(BUILDFILENAME).html ./index.html
# Targets and dependencies
.PHONY: all clean
all: $(ALL);
clean:
- $(RM) $(BUILDDIR)/$(BUILDFILENAME).pdf
- $(RM) $(BUILDDIR)/$(BUILDFILENAME).html
- $(RM) $(BUILDDIR)/$(BUILDFILENAME).epub