-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
65 lines (57 loc) · 2.38 KB
/
Makefile
File metadata and controls
65 lines (57 loc) · 2.38 KB
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
# Makefile para construir los Trabajos Practicos de Administracion y Gestion de Redes
# Mauro A. Meloni <maurom@unlu.edu.ar>
REQUIRED_PACKAGES := pandoc lmodern texlive-xetex texlive-latex-recommended texlive-fonts-recommended fonts-dejavu
# define los argumentos de pandoc segun la version, pues hay diferencia entre v1 y v2
PANDOC_VERSION_MAJOR := $(shell pandoc --version | head -1 | cut -d' ' -f2 | cut -d'.' -f1)
ifeq "$(PANDOC_VERSION_MAJOR)" "3"
PANDOC_FLAGS := --pdf-engine=xelatex
else ifeq "$(PANDOC_VERSION_MAJOR)" "2"
PANDOC_FLAGS := --pdf-engine=xelatex
else
PANDOC_FLAGS := --latex-engine=xelatex
endif
$(foreach package,$(REQUIRED_PACKAGES),\
$(if $(shell dpkg -s $(package) 2> /dev/null),,$(error "Please execute 'apt-get install $(REQUIRED_PACKAGES)' and try again")))
.PHONY: all clean
all: \
pdf/cheatsheet.pdf \
pdf/gl-introduccion.pdf \
pdf/guiadeestilo_TPs.pdf \
pdf/missing-semester-command-line.pdf \
pdf/missing-semester-course-shell.pdf \
pdf/practica_autoguiada_sockets.pdf \
pdf/tp-eficiencia-enlace.pdf \
pdf/tp-final-2024.pdf \
pdf/tp-final-2025.pdf \
pdf/tp-ethernet.pdf \
pdf/tp-transmision-datos.pdf \
pdf/tpe-sockets.pdf \
pdf/tpl00-AKA_Los_Labos_de_Pierre.pdf \
pdf/tpl-adicional.pdf \
pdf/tpl1-configuracion-inicial.pdf \
pdf/tpl2-telnet.pdf \
pdf/tpl3-dns.pdf \
pdf/tpl4-correo-electronico.pdf \
pdf/tpl5-http.pdf \
pdf/tpl6-http-parte2.pdf \
pdf/tpl7-ipv6-opcional.pdf
pdf/%.pdf: markdown/%.md header.tex
mkdir -p pdf
cp "$<" /tmp/output.md
sed -i '/Notas para ayudantes/,/Fin notas para ayudantes/d' /tmp/output.md
pandoc -f markdown -t latex $(PANDOC_FLAGS) --include-in-header header.tex \
-V lang=es-AR -V geometry:a4paper -V fontsize=11pt -V documentclass=article \
-V geometry:headheight=1in -V geometry:margin=1in -V geometry:top=1.5in \
-V mainfont="DejaVu Serif" -V colorlinks=true -V graphics=true \
-V monofont="Latin Modern Mono" \
-V author-meta=$(shell whoami) \
-V mainfontoptions="Scale=MatchLowercase" \
/tmp/output.md -o "$@"
sha256sum "$@" > "$@.sha256"
#evince "$@" &
%.html: markdown/%.md
pandoc -f markdown -t html5 -s "$<" -o "$@"
clean:
- rm -v pdf/*.pdf
- rm -v pdf/*.sha256
- rmdir pdf