summaryrefslogtreecommitdiff
path: root/Makefile
blob: 248de1ec73941ed29bf50efa4118173dc71e43fc (about) (plain)
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
# SPDX-License-Identifier: CC0-1.0
#
# Copyright (C) 2024 Wojtek Kosior <koszko@koszko.org>

# Make sure you have Pandoc, a LaTeX distribution, Python as well as Python
# packages `BeautifulSoup4', `pyyaml' (YAML parser library) and `requests'
# installed.

PYTHON=python3
PANDOC=pandoc
LATEXMK=latexmk

DEFAULT_TARGETS = \
	profiles_with_scraped_info.yaml \
	tables.pdf \
	techniques_table_doc.pdf

all: $(DEFAULT_TARGETS)
.PHONY: all

.SUFFIXES: .pdf .md

.md.pdf:
	$(PANDOC) \
		-V geometry:margin=1.10in \
		-r markdown-auto_identifiers \
		--number-sections \
		--shift-heading-level-by=-1 \
		--columns=1 \
		-o $@ $<

tables.md: threats_by_sector_table.py profiles.yaml
	$(PYTHON) $^ > $@

profiles_with_scraped_info.yaml: scrape_groups_info.py profiles.yaml
	$(PYTHON) $^ > $@

techniques_table.tex: techniques_table.py profiles_with_scraped_info.yaml
	$(PYTHON) $^ > $@

techniques_table_doc.pdf: techniques_table_doc.tex tlp.tex techniques_table.tex
	$(LATEXMK) -pdf $<

th-proj-archive.tar.gz: Makefile profiles.yaml scrape_groups_info.py \
		tables.md techniques_table.py threats_by_sector_table.py \
		tlp.tex $(DEFAULT_TARGETS)
	tar --transform='s|^|th-proj-archive/|' \
		--mtime=1970-01-01T00:00:00-00:00 --group=0 --owner=0 \
		-czf $@ $^

clean:
	rm -rf tables.md techniques_table.tex th-proj-archive.tar.gz \
		$(DEFAULT_TARGETS)
	$(LATEXMK) -C
.PHONY: clean

magisterclean: clean
	rm -rf scraping/
.PHONY: magisterclean