summaryrefslogtreecommitdiff
path: root/ma/Makefile
blob: 3926de28f7bffc84ff609d45e7f4027f88ca9a99 (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
60
61
62
63
64
65
66
67
68
69
70
LAB_PATH ?= ../lab-windows

SHELL := bash
.ONESHELL:
.SHELLFLAGS := -eu -o pipefail -c
.DELETE_ON_ERROR:
MAKEFLAGS += --warn-undefined-variables
MAKEFLAGS += --no-builtin-rules

VERSION_STRING := $(shell git describe --tags --long --dirty)

all: safety_reset.pdf

#safety_reset.pdf: resources/grid_freq_estimation.pdf
#safety_reset.pdf: resources/gps_clock_jitter_analysis.pdf
#safety_reset.pdf: resources/dsss_experiments-ber.pdf
#safety_reset.pdf: resources/freq_meas_validation_rocof_testsuite.pdf

%.pdf %-extra-appendices.pdf: %.tex %.bib version.tex
	pdflatex -shell-escape $<
	biber $* 
	pdflatex -shell-escape $<
	pdflatex -shell-escape -jobname $*-extra-appendices "\def\includenotebooks{1} \def\includefirmwaresources{1} \input{$<}"
	biber $*-extra-appendices 
	pdflatex -shell-escape -jobname $*-extra-appendices "\def\includenotebooks{1} \def\includefirmwaresources{1} \input{$<}"
	pdflatex -shell-escape -jobname $*-print-private-data "\def\includeprivatedata{1} \input{$<}"
	biber $*-extra-appendices 
	pdflatex -shell-escape -jobname $*-print-private-data "\def\includeprivatedata{1} \input{$<}"

.PHONY: preview
preview:
	pdflatex -shell-escape safety_reset.tex

version.tex: safety_reset.tex safety_reset.bib
	echo "${VERSION_STRING}" > $@

resources/%.pdf: $(LAB_PATH)/%.ipynb
	jupyter-nbconvert --to=pdf --output-dir=resources --output=$* --LatexExporter.template_file=resources/nbexport.tplx $^

sdcard: safety_reset.pdf
	rm -rf sdcard
	mkdir -p sdcard
	git clone .. sdcard/git
	cp safety_reset.pdf sdcard/thesis-goette-${VERSION_STRING}.pdf
	cp safety_reset-extra-appendices.pdf sdcard/thesis-goette-with-sources-${VERSION_STRING}.pdf
	mkdir -p sdcard/data
	cp ../controller/fw/src/EasyMeter_Q3DA1002_V3.03_fw_dump_0xc000.h \
		'../lab-windows/dsss_experiments_res-2020-04-11 13:54:54.json' \
		'../lab-windows/dsss_experiments_res-2020-04-16 16:55:49.json' \
		'../lab-windows/dsss_experiments_res-2020-04-16 16:56:46.json' \
		'../lab-windows/dsss_experiments_res-2020-04-16 17:24:04.json' \
		'../lab-windows/dsss_experiments_res-2020-05-06 19:35:22.json' \
		'../lab-windows/dsss_experiments_res-2020-07-04 16:43:39.json' \
		../lab-windows/dsss_test_signals/dsss_test_noisy_padded.bin \
		../lab-windows/emulated_adc_readings_01.bin \
		../lab-windows/filtered_freq.bin \
		../lab-windows/grid_freq_psd_spl_108pt.json \
		../lab-windows/raw_freq.bin \
		../lab-windows/synth_sig_test_0123_01.flac \
		../lab-windows/synth_sig_test_0123_02.flac \
		../lab-windows/waveform.sqlite3 \
		sdcard/data/
	cp ../data/* sdcard/data/

.PHONY: clean
clean:
	rm -f safety_reset.aux safety_reset.bbl safety_reset.bcf safety_reset.log safety_reset.blg
	rm -f safety_reset.out safety_reset.run.xml texput.log