| 1 |
# /usr/share/doc/python-recommonmark-doc/examples/jgm/Makefile |
| 2 |
# |
| 3 |
# Ad hoc Makefile for building and playing with the sample sources |
| 4 |
# distributed within the debian package python-recommonmark-doc. |
| 5 |
# |
| 6 |
# Recommended usage: |
| 7 |
# create a dedicated folder somewhere in your HOME directory; |
| 8 |
# link all the files in /usr/share/doc/python-recommonmark-doc/examples/jgm |
| 9 |
# in the dedicated folder; launch this Makefile in the dedicated folder: |
| 10 |
# $ make ; |
| 11 |
# for a basic cleanup, consider the clean target: |
| 12 |
# $ make clean ; |
| 13 |
# for an entire cleanup, the maintainer-clean target: |
| 14 |
# $ make maintainer-clean ; |
| 15 |
# for other targets, just read the Makefile. |
| 16 |
# |
| 17 |
# written for Debian by Jerome Benoit <[email protected]> |
| 18 |
# on behalf of the Debian Python Modules Team |
| 19 |
# copyright: 2016 Jerome Benoit <[email protected]> |
| 20 |
# distributed under the terms and conditions of the MIT License |
| 21 |
# |
| 22 |
|
| 23 |
CMSHEETS = README.md |
| 24 |
|
| 25 |
LISTOF_FORMAT_EXTENSION = \ |
| 26 |
-ltx.pdf \ |
| 27 |
-xltx.pdf \ |
| 28 |
.html \ |
| 29 |
.pseudoxml \ |
| 30 |
.xml \ |
| 31 |
.man |
| 32 |
|
| 33 |
DOCUMENTS = $(foreach _fmtext,$(LISTOF_FORMAT_EXTENSION),$(patsubst %.md,%$(_fmtext),$(CMSHEETS))) |
| 34 |
|
| 35 |
default: all |
| 36 |
|
| 37 |
all: build |
| 38 |
|
| 39 |
build: $(DOCUMENTS) |
| 40 |
|
| 41 |
check: build |
| 42 |
|
| 43 |
clean: |
| 44 |
$(RM) -r pdfbuild |
| 45 |
@$(RM) *.aux *.out *.log |
| 46 |
|
| 47 |
composer-clean: clean |
| 48 |
$(RM) $(DOCUMENTS) |
| 49 |
|
| 50 |
maintainer-clean: clean |
| 51 |
|
| 52 |
%.man : %.md |
| 53 |
cm2man $< $@ |
| 54 |
|
| 55 |
%.xml : %.md |
| 56 |
cm2xml $< $@ |
| 57 |
|
| 58 |
%.pseudoxml : %.md |
| 59 |
cm2pseudoxml $< $@ |
| 60 |
|
| 61 |
%.html : %.md |
| 62 |
cm2html $< $@ |
| 63 |
|
| 64 |
%-xltx.tex : %.md |
| 65 |
cm2xetex $< $@ |
| 66 |
|
| 67 |
%-ltx.tex : %.md |
| 68 |
cm2latex $< $@ |
| 69 |
|
| 70 |
%-xltx.pdf : %-xltx.tex |
| 71 |
$(MKDIR_P) pdfbuild/$(*F)-xltx |
| 72 |
cp -l $< pdfbuild |
| 73 |
$(XELATEX) $(TEXFLAGS) -output-directory pdfbuild/$(*F)-xltx $< |
| 74 |
cp -l pdfbuild/$(*F)-xltx/$@ . |
| 75 |
|
| 76 |
%-ltx.pdf : %-ltx.tex |
| 77 |
$(MKDIR_P) pdfbuild/$(*F)-ltx |
| 78 |
cp -l $< pdfbuild |
| 79 |
$(LUALATEX) $(TEXFLAGS) -output-directory pdfbuild/$(*F)-ltx $< |
| 80 |
cp -l pdfbuild/$(*F)-ltx/$@ . |
| 81 |
|
| 82 |
TEXFLAGS = -interaction batchmode |
| 83 |
|
| 84 |
LUALATEX ?= /usr/bin/lualatex |
| 85 |
XELATEX ?= /usr/bin/xelatex |
| 86 |
|
| 87 |
MKDIR_P ?= /bin/mkdir -p |