-
Notifications
You must be signed in to change notification settings - Fork 225
Expand file tree
/
Copy pathMakefile
More file actions
475 lines (396 loc) · 16.8 KB
/
Copy pathMakefile
File metadata and controls
475 lines (396 loc) · 16.8 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
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
# See the README file for usage instructions
# SELF_CALL avoids checking other instances, which fails with --jobs > 1.
# https://gitlab.com/inkscape/inkscape/-/issues/4716#note_1898150983
INKSCAPE = SELF_CALL=true inkscape
PDFLATEX = xelatex
DIA = dia
EPSTOPDF = epstopdf
PDFTYPST = typst compile
MAGICK = $(or $(shell which magick 2>/dev/null),$(shell which convert 2>/dev/null))
INKSCAPE_IS_NEW = $(shell $(INKSCAPE) --version | grep -q "^Inkscape 1" && echo YES)
ifeq ($(INKSCAPE_IS_NEW),YES)
INKSCAPE_PDF_OPT = -o
else
INKSCAPE_PDF_OPT = -A
endif
# Needed macros
UPPERCASE = $(shell echo $1 | tr "[:lower:]-" "[:upper:]_")
define sep
endef
include $(wildcard mk/*.mk)
# Output directory
OUTDIR = $(shell pwd)/out
# Latex variable definitions
VARS = $(OUTDIR)/vars
# Environment for pdflatex, which allows it to find the stylesheet in the
# common/ directory.
PDFLATEX_ENV = TEXINPUTS=.:$(shell pwd):$(shell pwd)/common: texfot --tee /tmp/fot.`id -u`
# Arguments passed to pdflatex
PDFLATEX_OPT = -shell-escape -file-line-error -halt-on-error
# Arguments passed to typst
PDFTYPST_OPT = --root . --package-path ./typst --font-path=typst/fonts
TRAINING_OPT = --input training
# Stylesheets
LATEX_STYLESHEET = common/beamerthemeBootlin.sty
TYPST_STYLESHEET = typst/local/bootlin/0.1.0/lib.typ
ALL_TRAININGS_MKS = $(sort $(notdir $(wildcard mk/*.mk)))
ALL_TRAININGS = $(patsubst %.mk,%,$(ALL_TRAININGS_MKS))
#
# === Picture lookup ===
#
# Function that computes the list of pictures of the extension given
# in $(2) from the directories in $(1), and transforms the filenames
# in .pdf in the output directory. This is used to compute the list of
# .pdf files that need to be generated from .dia or .svg files.
PICTURES_WITH_TRANSFORMATION = \
$(patsubst %.$(2),$(OUTDIR)/%.pdf,$(foreach s,$(1),$(wildcard $(s)/*.$(2))))
# Function that computes the list of pictures of the extension given
# in $(2) from the directories in $(1). This is used for pictures that
# to not need any transformation, such as bitmap files in the .png or
# .jpg formats.
PICTURES_NO_TRANSFORMATION = \
$(patsubst %,$(OUTDIR)/%,$(foreach s,$(1),$(wildcard $(s)/*.$(2))))
# Function that transforms .dia files to .svg in the output directory.
# Used by the Typst backend (LaTeX uses dia→eps→pdf instead).
PICTURES_DIA_TO_SVG = \
$(patsubst %.dia,$(OUTDIR)/%.svg,$(foreach s,$(1),$(wildcard $(s)/*.dia)))
# Function that computes the list of pictures from the directories in
# $(1) and returns output filenames in the output directory.
# This variant produces .pdf from .dia (used by LaTeX backend).
PICTURES = \
$(call PICTURES_WITH_TRANSFORMATION,$(1),svg) \
$(call PICTURES_WITH_TRANSFORMATION,$(1),dia) \
$(call PICTURES_NO_TRANSFORMATION,$(1),png) \
$(call PICTURES_NO_TRANSFORMATION,$(1),jpg) \
$(call PICTURES_NO_TRANSFORMATION,$(1),pdf)
# Same as PICTURES but copies .svg as-is and produces .svg from .dia (Typst backend).
PICTURES_TYPST = \
$(call PICTURES_NO_TRANSFORMATION,$(1),svg) \
$(call PICTURES_DIA_TO_SVG,$(1)) \
$(call PICTURES_NO_TRANSFORMATION,$(1),png) \
$(call PICTURES_NO_TRANSFORMATION,$(1),jpg) \
$(call PICTURES_NO_TRANSFORMATION,$(1),pdf)
# List of common pictures
COMMON_PICTURES = $(call PICTURES,common)
COMMON_PICTURES_TYPST = $(call PICTURES_TYPST,common)
default: help
#
# === Compilation of slides ===
#
# Target pattern: <course>-slides.pdf
# Examples: make full-linux-kernel-slides.pdf
# make linux-kernel-driver-slides.pdf
#
# The backend (Typst or LaTeX/Beamer) is selected automatically:
# - If .typ files are found for the resolved chapters → Typst
# - Otherwise → LaTeX/Beamer
#
# This rule is done in two parts with make calling itself because it is
# not possible to compute a list of prerequisites depending on the target
# name. See https://stackoverflow.com/questions/3381497/dynamic-targets-in-makefiles
# for details.
#
ifdef SLIDES
# ---------------------------------------------------------------------------
# Resolve training name and chapter list from the SLIDES variable.
# ---------------------------------------------------------------------------
ifeq ($(firstword $(subst -, , $(SLIDES))),full)
SLIDES_TRAINING = $(strip $(subst -slides, , $(subst full-, , $(SLIDES))))
SLIDES_CHAPTERS = $($(call UPPERCASE, $(subst -,_, $(SLIDES_TRAINING)))_SLIDES)
else
SLIDES_TRAINING = $(firstword $(subst -, , $(SLIDES)))
ifeq ($(SLIDES_TRAINING),sysdev)
SLIDES_TRAINING = embedded-linux
endif
ifeq ($(SLIDES_TRAINING),kernel)
SLIDES_TRAINING = linux-kernel
endif
ifeq ($(SLIDES_TRAINING),realtime)
SLIDES_TRAINING = preempt-rt
endif
# We might be building multiple chapters that share a common prefix.
# Build them in the order listed in the <training>_SLIDES variable.
SLIDES_CHAPTERS = $(filter $(SLIDES)%, $($(call UPPERCASE, $(SLIDES_TRAINING))_SLIDES))
endif
ifeq ($(SLIDES_CHAPTERS),)
$(error "No chapter to build, maybe you're building a single chapter whose name doesn't start with a training session name")
endif
# ---------------------------------------------------------------------------
# Backend detection: use Typst only when every chapter has a .typ file.
# If even one chapter is missing its .typ counterpart, fall back to LaTeX.
# This avoids misdetection when only common or partial files exist in Typst.boot-sequence-initramfs
# ---------------------------------------------------------------------------
COMMON_CHAPTERS = first-slides about-us last-slides initramfs beaglecam beagleboneblack-board boot-sequence-initramfs setup-lab board-setup-lab
SLIDES_SPECIFIC = $(filter-out $(COMMON_CHAPTERS) shopping-list% course-information%,$(SLIDES_CHAPTERS))
SLIDES_TYP_FOUND := $(strip $(foreach s,$(SLIDES_SPECIFIC),$(wildcard slides/$(s)/*.typ)))
$(info SLIDES_CHAPTERS = $(SLIDES_CHAPTERS))
ifneq ($(SLIDES_TYP_FOUND),)
# ===========================================================================
# Typst backend
# ===========================================================================
SLIDES_TYP = $(wildcard slides/first-slides/first-slides.typ)
SLIDES_TYP += $(foreach s,$(filter-out first-slides,$(SLIDES_CHAPTERS)),$(wildcard slides/$(s)/*.typ))
ifneq ($(TRAINER),)
SLIDES_TYP += slides/first-slides/$(TRAINER).typ
endif
SLIDES_PICTURES = $(call PICTURES_TYPST,$(foreach s,$(SLIDES_CHAPTERS),slides/$(s))) $(COMMON_PICTURES_TYPST)
ifeq ($(TRAINER),)
TRAINER_OPT =
else
TRAINER_OPT = --input trainer=
endif
ifeq ($(SESSION_URL),)
SESSION_URL_OPT =
else
SESSION_URL_OPT = --input session_url=
endif
$(foreach file,$(SLIDES_TYP),$(if $(wildcard $(file)),,$(error Missing file $(file) !)))
%-slides.pdf: $(SLIDES_TYP) $(SLIDES_PICTURES) $(TYPST_STYLESHEET)
@mkdir -p $(OUTDIR)/common
rm -f $(OUTDIR)/$(basename $@).typ
cp -r typst out/
cp $(wildcard common/*.typ) $(OUTDIR)/common/
for f in $(filter %.typ,$^) ; do \
mkdir -p $(OUTDIR)/`dirname $$f` ; \
cp $$f $(OUTDIR)/$$f ; \
sed -i 's%__SESSION_NAME__%$(SLIDES_TRAINING)%' $(OUTDIR)/$$f ; \
chapter=$$(basename `dirname $$f`) ; \
filename=$$(basename $$f .typ) ; \
if [ "$$f" != "slides/first-slides/$(TRAINER).typ" ] && \
[ "$$filename" = "$$chapter" -o "$$filename" = "first-slides" ] ; then \
printf "#include \"$$f\"\n" >> $(OUTDIR)/$(basename $@).typ ; \
fi ; \
done
(cd $(OUTDIR); $(PDFTYPST) $(PDFTYPST_OPT) $(TRAINING_OPT)=$(SLIDES_TRAINING) $(TRAINER_OPT)$(TRAINER) $(SESSION_URL_OPT)$(SESSION_URL) $(basename $@).typ)
# Use cat instead of mv so that evince detects the change and reloads
# ('Maxime's feature').
cat out/$@ > $@
else
# ===========================================================================
# LaTeX/Beamer backend
# ===========================================================================
ifeq ($(firstword $(subst -, , $(SLIDES))),full)
SLIDES_COMMON_BEFORE = common/slide-header.tex \
common/$(SLIDES_TRAINING)-vars.tex
else
ifeq ($(words $(SLIDES_CHAPTERS)),1)
SLIDES_COMMON_BEFORE = common/slide-header.tex common/single-subsection-slide-vars.tex
else
SLIDES_COMMON_BEFORE = common/slide-header.tex common/single-slide-vars.tex
endif
endif
SLIDES_COMMON_AFTER = common/slide-footer.tex
SLIDES_TEX = \
$(SLIDES_COMMON_BEFORE) \
$(foreach s,$(SLIDES_CHAPTERS),$(wildcard slides/$(s)/$(s).tex)) \
$(SLIDES_COMMON_AFTER)
SLIDES_PICTURES = $(call PICTURES,$(foreach s,$(SLIDES_CHAPTERS),slides/$(s))) $(COMMON_PICTURES)
$(foreach file,$(SLIDES_TEX),$(if $(wildcard $(file)),,$(error Missing file $(file) !)))
%-slides.pdf: $(VARS) $(SLIDES_TEX) $(SLIDES_PICTURES) $(LATEX_STYLESHEET) $(OUTDIR)/last-update.tex
@mkdir -p $(OUTDIR)
rm -f $(OUTDIR)/$(basename $@).tex
echo "\input{last-update}" >> $(OUTDIR)/$(basename $@).tex
echo "\input{$(VARS)}" >> $(OUTDIR)/$(basename $@).tex
for f in $(filter %.tex,$^) ; do \
cp $$f $(OUTDIR)/`basename $$f` ; \
sed -i 's%__SESSION_NAME__%$(SLIDES_TRAINING)%' $(OUTDIR)/`basename $$f` ; \
printf "\input{%s}\n" `basename $$f .tex` >> $(OUTDIR)/$(basename $@).tex ; \
done
(cd $(OUTDIR); $(PDFLATEX_ENV) $(PDFLATEX) $(PDFLATEX_OPT) $(basename $@).tex)
# Second pass for correct table of contents and index.
(cd $(OUTDIR); $(PDFLATEX_ENV) $(PDFLATEX) $(PDFLATEX_OPT) $(basename $@).tex > /dev/null 2>&1)
# Use cat instead of mv so that evince detects the change and reloads
# ('Maxime's feature').
cat out/$@ > $@
endif # backend selection
else # ifndef SLIDES
FORCE:
%-slides.pdf: FORCE
@$(MAKE) $@ SLIDES=$*
endif # ifdef SLIDES
#
# === Compilation of labs ===
#
ifdef LABS
ifeq ($(firstword $(subst -, , $(LABS))),full)
LABS_TRAINING = $(strip $(subst -labs, , $(subst full-, , $(LABS))))
LABS_TRAINING_NO_BOARD = $(strip $(foreach c,$(ALL_TRAININGS),$(if $(filter full-$(c)-%,$(LABS)),$(c))))
LABS_HEADER = common/labs-header.tex
LABS_VARSFILE = common/$(LABS_TRAINING_NO_BOARD)-vars.tex common/$(LABS_TRAINING)-labs-vars.tex
LABS_CHAPTERS = $($(call UPPERCASE, $(subst -,_, $(LABS_TRAINING)))_LABS)
LABS_FOOTER = common/labs-footer.tex
else
LABS_TRAINING = $(firstword $(subst -, , $(LABS)))
LABS_VARSFILE = common/$(LABS_TRAINING_NO_BOARD)-vars.tex common/single-lab-vars.tex
LABS_CHAPTERS = $(LABS)
LABS_HEADER = common/single-lab-header.tex
LABS_FOOTER = common/labs-footer.tex
endif
# Compute the set of corresponding .tex files and pictures
LABS_TEX = \
$(LABS_VARSFILE) \
$(LABS_HEADER) \
$(foreach s,$(LABS_CHAPTERS),labs/$(s)/$(s).tex) \
$(LABS_FOOTER)
LABS_PICTURES = $(call PICTURES,$(foreach s,$(LABS_CHAPTERS),labs/$(s))) $(COMMON_PICTURES)
# Check for all labs .tex file to exist
$(foreach file,$(LABS_TEX),$(if $(wildcard $(file)),,$(error Missing file $(file) for $(LABS) !)))
%-labs.pdf: common/labs.sty $(VARS) $(LABS_TEX) $(LABS_PICTURES) $(OUTDIR)/last-update.tex
@mkdir -p $(OUTDIR)
# We generate a .tex file with \input{} directives (instead of just
# concatenating all files) so that when there is an error, we are
# pointed at the right original file and the right line in that file.
rm -f $(OUTDIR)/$(basename $@).tex
echo "\input{last-update}" >> $(OUTDIR)/$(basename $@).tex
echo "\input{$(VARS)}" >> $(OUTDIR)/$(basename $@).tex
for f in $(filter %.tex,$^) ; do \
cp $$f $(OUTDIR)/`basename $$f` ; \
sed -i 's%__SESSION_NAME__%$(LABS_TRAINING)%' $(OUTDIR)/`basename $$f` ; \
printf "\input{%s}\n" `basename $$f .tex` >> $(OUTDIR)/$(basename $@).tex ; \
done
(cd $(OUTDIR); $(PDFLATEX_ENV) $(PDFLATEX) $(basename $@).tex)
# The second call to pdflatex is to be sure that we have a correct table of
# content and index
(cd $(OUTDIR); $(PDFLATEX_ENV) $(PDFLATEX) $(basename $@).tex > /dev/null 2>&1)
# We use cat to overwrite the final destination file instead of mv, so
# that evince notices that the file has changed and automatically
# reloads it (which doesn't happen if we use mv here). This is called
# 'Maxime's feature'.
cat out/$@ > $@
else
FORCE:
%-labs.pdf: FORCE
@$(MAKE) $@ LABS=$*
endif
#
# Lab data archive generation
#
%-labs.tar.xz: LAB_DATA=$(patsubst %-labs.tar.xz,%,$@)
%-labs.tar.xz: OUT_LAB_DATA=$(OUTDIR)/$(LAB_DATA)-labs
%-labs.tar.xz:
rm -rf $(OUT_LAB_DATA)
mkdir -p $(OUT_LAB_DATA)
rsync --exclude=.git -a -k --delete --copy-links lab-data/$(LAB_DATA)/ $(OUT_LAB_DATA)
fakeroot common/process-lab-data.sh $(OUT_LAB_DATA)
find $(OUT_LAB_DATA) -name '*.xz' -exec unxz {} \;
(cd $(OUTDIR); tar Jcf $@ $(LAB_DATA)-labs)
mv $(OUTDIR)/$@ $@
#
# === Compilation of agendas ===
#
ifdef AGENDA
AGENDA_TEX = agenda/$(AGENDA)-agenda.tex
AGENDA_TRAINING = $(subst -online,,$(subst -fr,,$(AGENDA)))
AGENDA_TRAINING_VARS = common/$(AGENDA_TRAINING)-vars.tex
AGENDA_PICTURES = $(COMMON_PICTURES) $(call PICTURES,agenda)
%-agenda.pdf: common/agenda_old.sty common/agenda.sty $(AGENDA_TRAINING_VARS) $(VARS) $(AGENDA_TEX) $(AGENDA_PICTURES) $(OUTDIR)/last-update.tex
rm -f $(OUTDIR)/$(basename $@).tex
echo "\input{$(AGENDA_TRAINING_VARS)}" >> $(OUTDIR)/$(basename $@).tex
echo "\input{$(VARS)}" >> $(OUTDIR)/$(basename $@).tex
echo "\input{$(filter %-agenda.tex,$^)}" >> $(OUTDIR)/$(basename $@).tex
(cd $(OUTDIR); $(PDFLATEX_ENV) $(PDFLATEX) $(basename $@).tex)
(cd $(OUTDIR); $(PDFLATEX_ENV) $(PDFLATEX) $(basename $@).tex > /dev/null 2>&1)
cat $(OUTDIR)/$@ > $@
else
FORCE:
%-agenda.pdf: FORCE
@$(MAKE) $@ AGENDA=$*
endif
#
# === Last update file generation ===
#
$(OUTDIR)/last-update.tex: FORCE
mkdir -p $(@D)
t=`git log -1 --format=%ct` && printf "\def \lastupdateen{%s}\n" "`(LANG=en_EN.UTF-8 date -d @$${t} +'%B %d, %Y')`" > $@.tmp
t=`git log -1 --format=%ct` && printf "\def \lastupdatefr{%s}\n" "`(LANG=fr_FR.UTF-8 date -d @$${t} +'%d %B %Y')`" >> $@.tmp
if ! cmp $@ $@.tmp ; then mv $@.tmp $@ ; fi
#
# === Picture generation ===
#
.PRECIOUS: $(OUTDIR)/%.pdf
$(OUTDIR)/%.pdf: %.svg
@printf "%-15s%-20s->%20s\n" INKSCAPE $(notdir $^) $(notdir $@)
@mkdir -p $(dir $@)
ifeq ($(V),)
$(INKSCAPE) -D $(INKSCAPE_PDF_OPT) $@ $< > /dev/null 2>&1
else
$(INKSCAPE) -D $(INKSCAPE_PDF_OPT) $@ $<
endif
$(OUTDIR)/%.pdf: $(OUTDIR)/%.eps
@printf "%-15s%-20s->%20s\n" EPSTOPDF $(notdir $^) $(notdir $@)
@mkdir -p $(dir $@)
$(EPSTOPDF) --outfile=$@ $^
.PRECIOUS: $(OUTDIR)/%.eps
$(OUTDIR)/%.eps: %.dia
@printf "%-15s%-20s->%20s\n" DIA $(notdir $^) $(notdir $@)
@mkdir -p $(dir $@)
$(DIA) -e $@ -t eps $^
.PRECIOUS: $(OUTDIR)/%.svg
$(OUTDIR)/%.svg: %.svg
@mkdir -p $(dir $@)
@cp $^ $@
$(OUTDIR)/%.svg: %.dia
@printf "%-15s%-20s->%20s\n" DIA-SVG $(notdir $^) $(notdir $@)
@mkdir -p $(dir $@)
$(DIA) -e $@ -t svg $^
.PRECIOUS: $(OUTDIR)/%.png
$(OUTDIR)/%.png: %.png
@mkdir -p $(dir $@)
@cp $^ $@
.PRECIOUS: $(OUTDIR)/%.jpg
$(OUTDIR)/%.jpg: %.jpg
@mkdir -p $(dir $@)
$(MAGICK) $^ -colorspace sRGB -resize '987x1754>' -filter Cubic -quality 65 -sampling-factor 2x2 -strip $@
$(OUTDIR)/%.pdf: %.pdf
mkdir -p $(dir $@)
@cp $^ $@
#
# === Misc targets ===
#
$(VARS): FORCE
@mkdir -p $(dir $@)
/bin/echo "\def \sessionurl {$(patsubst %/,%,$(SESSION_URL))}" > $@.tmp
/bin/echo "\def \trainer {$(TRAINER)}" >> $@.tmp
if ! cmp $@ $@.tmp ; then mv $@.tmp $@ ; fi
clean:
$(RM) -rf $(OUTDIR) *.pdf *-labs *.xz
ALL_SLIDES = $(foreach p,$(ALL_TRAININGS),$(if $($(call UPPERCASE,$(p)_SLIDES)),full-$(p)-slides.pdf))
ALL_LABS = $(patsubst common/%-labs-vars.tex,full-%-labs.pdf,$(wildcard common/*-labs-vars.tex))
ALL_AGENDAS = $(patsubst %.tex,%.pdf,$(filter-out %.inc.tex,$(notdir $(wildcard agenda/*.tex))))
ALL_LABS_TARBALLS = $(patsubst %,%-labs.tar.xz,$(filter-out common,$(notdir $(wildcard lab-data/*))))
all: $(ALL_SLIDES) $(ALL_LABS) $(ALL_AGENDAS) $(ALL_LABS_TARBALLS)
list-courses:
@echo $(ALL_TRAININGS)
.PHONY: $(ALL_TRAININGS)
$(ALL_TRAININGS):
$(MAKE) \
$(filter full-$@%,$(ALL_SLIDES)) \
$(filter full-$@%,$(ALL_LABS)) \
$(filter $@%,$(ALL_AGENDAS)) \
$(filter $@%,$(ALL_LABS_TARBALLS))
HELP_FIELD_FORMAT = " %-36s %s\n"
help:
@echo "Available targets:"
@echo
@echo "Slides (backend selected automatically: Typst if .typ files exist, LaTeX otherwise):"
$(foreach p,$(ALL_SLIDES),\
@printf $(HELP_FIELD_FORMAT) "$(p)" "Complete slides for the '$(patsubst full-%-slides.pdf,%,$(p))' course"$(sep))
@echo
@echo "Labs:"
$(foreach p,$(ALL_LABS),\
@printf $(HELP_FIELD_FORMAT) "$(p)" "Complete labs for the '$(patsubst full-%-labs.pdf,%,$(p))' course"$(sep))
@echo
@echo "Agendas:"
$(foreach p,$(ALL_AGENDAS),\
@printf $(HELP_FIELD_FORMAT) "$(p)" "Agenda for the '$(patsubst %-agenda.pdf,%,$(p))' course"$(sep))
@echo
@echo "Tarballs:"
$(foreach p,$(ALL_LABS_TARBALLS),\
@printf $(HELP_FIELD_FORMAT) "$(p)" "Lab data for the '$(patsubst %-labs.tar.xz,%,$(p))' course"$(sep))
@echo
@printf $(HELP_FIELD_FORMAT) "<some-chapter>-slides.pdf" "Slides for a particular chapter in slides/"
@printf $(HELP_FIELD_FORMAT) "<some-chapter>-labs.pdf" "Labs for a particular chapter in labs/"
@echo
@printf $(HELP_FIELD_FORMAT) "list-courses" "List all courses"
@printf $(HELP_FIELD_FORMAT) "<course>" "Slides, labs, agendas and tarballs for the course"
@printf $(HELP_FIELD_FORMAT) "linux-kernel" "Slides, labs, agendas and tarballs for all variants of the course"