-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
56 lines (42 loc) · 1.77 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
# Makefile for generating PDF from Markdown
# Variables
INFOSEC_MD = roar-data-privacy-and-infosec-manual.md
INFOSEC_PDF = $(patsubst %.md, %.pdf, $(INFOSEC_MD))
SDLC_MD = roar-sdlc.md
SDLC_PDF = $(patsubst %.md, %.pdf, $(SDLC_MD))
BCDR_MD = roar-bcdr.md
BCDR_PDF = $(patsubst %.md, %.pdf, $(BCDR_MD))
MD_FILES = $(wildcard vendor-assessments/*.md)
VENDOR_ASSESSMENTS_DIR = vendor-assessments
# Default target
all: infosec sldc bcdr
PANDOC_OPTS = -f gfm --template ./.tex-template/eisvogel.latex \
-V linkcolor=blue \
-V header-includes:'\usepackage[export]{adjustbox} \let\includegraphicsbak\includegraphics \renewcommand*{\includegraphics}[2][]{\includegraphicsbak[frame,\#1]{\#2}}'
infosec: $(INFOSEC_MD)
@pandoc $(INFOSEC_MD) $(PANDOC_OPTS) -o $(INFOSEC_PDF)
sdlc: $(SDLC_MD)
@pandoc $(SDLC_MD) $(PANDOC_OPTS) -o $(SDLC_PDF)
bcdr: $(BCDR_MD)
@pandoc $(BCDR_MD) $(PANDOC_OPTS) -o $(BCDR_PDF)
# Command to generate PDFs for all markdown files in the vendor-assessments folder
vendor-assessments: $(MD_FILES)
@mkdir -p $(VENDOR_ASSESSMENTS_DIR)
@for file in $(MD_FILES); do \
pandoc $$file $(PANDOC_OPTS) -o $(VENDOR_ASSESSMENTS_DIR)/$$(basename $$file .md).pdf; \
done
check-spelling:
@aspell --lang=en --mode=markdown -c $(INFOSEC_MD)
@aspell --lang=en --mode=markdown -c $(SDLC_MD)
@aspell --lang=en --mode=markdown -c $(BCDR_MD)
# Command to install Pandoc
install:
# Install pandoc (Linux or macOS). For Windows, use the installer from the official website
which pandoc || (sudo apt-get update && sudo apt-get install -y pandoc || brew install pandoc)
# Clean command to remove the generated PDFs
clean:
rm -f $(INFOSEC_PDF)
rm -f $(SDLC_PDF)
rm -f $(BCDR_PDF)
# Phony targets
.PHONY: all clean install vendor-assessments bcdr sdlc infosec check-spelling