diff options
author | Philip Withnall <philip@tecnocode.co.uk> | 2013-08-28 16:18:35 (GMT) |
---|---|---|
committer | Philip Withnall <philip@tecnocode.co.uk> | 2013-08-28 16:18:35 (GMT) |
commit | d4a3292093500cc8295738f3eaf6141ef79998fd (patch) | |
tree | f43bc3b285f670c6def66ecb2eee58d37593b3ef | |
parent | 781a1a6c1da5e5fbb1c6182e88252c44835edc98 (diff) |
Add Make recipes to package exercises
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | Makefile | 24 |
2 files changed, 25 insertions, 1 deletions
@@ -11,3 +11,5 @@ presentation.snm presentation.toc presentation.vrb .be/id-cache +python-ejercicios.zip +python-exercises.zip @@ -43,7 +43,21 @@ IMAGE_FILES = \ simple-gtk-program.png \ $(NULL) -all: $(PDFS) +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) + +all: $(PDFS) $(ZIPS) presentation.pdf: presentation.tex $(TEX_FILES) $(IMAGE_FILES) pdflatex "\providecommand\locale{$(LANG)}\input{$<}" @@ -53,6 +67,13 @@ 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_PYTHON_FILES) + zip --quiet --no-dir-entries $@ $^ + +python-ejercicios.zip: $(ES_PYTHON_FILES) + zip --quiet --no-dir-entries $@ $^ + check: $(foreach ex,$(EN_EXERCISES),pep8 exercises/en/${ex}.py exercises/en/${ex}_solution.py;) $(foreach ex,$(ES_EXERCISES),pep8 exercises/es/${ex}.py exercises/es/${ex}_solucion.py;) @@ -66,5 +87,6 @@ clean: rm -f $(PDFS:.pdf=.toc) rm -f $(PDFS:.pdf=.vrb) rm -f $(PDFS) + rm -f $(ZIPS) .PHONY: all clean check |