Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 964f20c76295492e2dc5747cf909ead0661a4ee0 (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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# This variable's customisable to change the language of the outputted files.
# Permissible values: 'en' or 'es'
LANG = es

PDFS = presentation.pdf handout.pdf
EN_EXERCISES = \
	1_printing-names \
	2_arithmetic \
	3_squares \
	4_fibonacci \
	5_while \
	6_break \
	7_lists \
	8_lists-min \
	9_dicts \
	10_def \
	11_recursion \
	12_create-class \
	13_extend-class \
	14_property \
	15_private-methods \
	17_button-and-label \
	$(NULL)
ES_EXERCISES = \
	1_imprimir-nombres \
	2_aritmetica \
	3_cuadrados \
	4_fibonacci \
	5_while \
	6_break \
	7_listas \
	8_listas-min \
	9_dicts \
	10_def \
	11_recursividad \
	12_crear-clase \
	13_extender-clase \
	14_propiedad \
	15_metodos-privadas \
	$(NULL)

TEX_FILES = \
	slides.tex \
	introduction-to-python.tex \
	python-functions-and-classes.tex \
	writing-sugar-activities.tex \
	$(NULL)

IMAGE_FILES = \
	simple-gtk-program.png \
	$(NULL)

ZIPS = \
	python-ejercicios.zip \
	python-exercises.zip \
	$(NULL)

EN_PYTHON_FILES = \
	$(addprefix exercises/en/,$(addsuffix .py,$(EN_EXERCISES))) \
	$(addprefix exercises/en/,$(addsuffix _solution.py,$(EN_EXERCISES))) \
	$(NULL)

ES_PYTHON_FILES = \
	$(addprefix exercises/es/,$(addsuffix .py,$(ES_EXERCISES))) \
	$(addprefix exercises/es/,$(addsuffix _solucion.py,$(ES_EXERCISES))) \
	$(NULL)

EN_EXERCISE_FILES = \
	$(EN_PYTHON_FILES) \
    exercises/en/16_gnome-devel-demos.txt \
	exercises/en/17_button-and-label.py \
	exercises/en/17_button-and-label_solution.py \
	exercises/en/Exercise18.activity/ \
	exercises/en/18_gtk-to-activity.txt \
    exercises/en/Exercise19.activity/ \
	exercises/en/19_translation.txt \
	exercises/en/Exercise20.activity/ \
	exercises/en/20_packaging.txt \
	exercises/en/21_complete-activity.txt \
	$(NULL)

ES_EXERCISE_FILES = \
	$(ES_PYTHON_FILES) \
	exercises/es/16_gnome-devel-demos.txt \
	$(NULL)

all: $(PDFS) $(ZIPS)

presentation.pdf: presentation.tex $(TEX_FILES) $(IMAGE_FILES)
	pdflatex "\providecommand\locale{$(LANG)}\input{$<}"
	pdflatex "\providecommand\locale{$(LANG)}\input{$<}"

handout.pdf: handout.tex $(TEX_FILES) $(IMAGE_FILES)
	pdflatex "\providecommand\locale{$(LANG)}\input{$<}"
	pdflatex "\providecommand\locale{$(LANG)}\input{$<}"

# Zip up the exercises.
python-exercises.zip: $(EN_EXERCISE_FILES)
	zip --quiet --no-dir-entries $@ $^

python-ejercicios.zip: $(ES_EXERCISE_FILES)
	zip --quiet --no-dir-entries $@ $^

check:
	pep8 $(EN_PYTHON_FILES)
	pep8 $(ES_PYTHON_FILES)

clean:
	rm -f $(PDFS:.pdf=.aux)
	rm -f $(PDFS:.pdf=.log)
	rm -f $(PDFS:.pdf=.out)
	rm -f $(PDFS:.pdf=.nav)
	rm -f $(PDFS:.pdf=.snm)
	rm -f $(PDFS:.pdf=.toc)
	rm -f $(PDFS:.pdf=.vrb)
	rm -f $(PDFS)
	rm -f $(ZIPS)

.PHONY: all clean check