| 1 |
############################################################################### |
| 2 |
# |
| 3 |
# Makefile to build the package and documentation |
| 4 |
# |
| 5 |
# Requires GNU Make. |
| 6 |
# |
| 7 |
# Copyright (C) Andrey Vihrov <[email protected]>, 2010-2011 |
| 8 |
# |
| 9 |
# This work may be distributed and/or modified under the |
| 10 |
# conditions of the LaTeX Project Public License, either version 1.3 |
| 11 |
# of this license or (at your option) any later version. |
| 12 |
# The latest version of this license is in |
| 13 |
# |
| 14 |
# http://www.latex-project.org/lppl.txt |
| 15 |
# |
| 16 |
# and version 1.3 or later is part of all distributions of LaTeX |
| 17 |
# version 2005/12/01 or later. |
| 18 |
# |
| 19 |
# This work has the LPPL maintenance status `maintained'. |
| 20 |
# |
| 21 |
# See the README for a list of files that constitute this work. |
| 22 |
# |
| 23 |
|
| 24 |
# Package name |
| 25 |
PACK = fixlatvian |
| 26 |
|
| 27 |
# Files to generate |
| 28 |
FILES = $(PACK).sty lv.ist |
| 29 |
|
| 30 |
# Program names |
| 31 |
LATEX ?= xelatex -halt-on-error |
| 32 |
MAKEINDEX ?= makeindex |
| 33 |
KPSEWHICH ?= kpsewhich |
| 34 |
PDFOPT ?= pdfopt |
| 35 |
|
| 36 |
############################################################################### |
| 37 |
|
| 38 |
# Need to inhibit parallelism to avoid double .ins processing |
| 39 |
.NOTPARALLEL: |
| 40 |
|
| 41 |
.DELETE_ON_ERROR: |
| 42 |
|
| 43 |
.PHONY: all package doc clean clean-all |
| 44 |
|
| 45 |
all: package doc |
| 46 |
package: $(FILES) |
| 47 |
doc: $(PACK).pdf |
| 48 |
|
| 49 |
$(FILES): $(PACK).ins $(PACK).dtx |
| 50 |
$(LATEX) $< |
| 51 |
|
| 52 |
gind.lv.ist: lv.ist |
| 53 |
cat $$($(KPSEWHICH) gind.ist) $< > $@ |
| 54 |
|
| 55 |
define extra-latex-pass |
| 56 |
$(MAKEINDEX) -s gglo.ist -o $(PACK).gls $(PACK).glo |
| 57 |
$(MAKEINDEX) -s gind.lv.ist -o $(PACK).ind $(PACK).idx |
| 58 |
$(LATEX) $< |
| 59 |
endef |
| 60 |
$(PACK).pdf: $(PACK).dtx $(PACK).sty gind.lv.ist |
| 61 |
$(LATEX) $< |
| 62 |
$(extra-latex-pass) |
| 63 |
$(extra-latex-pass) |
| 64 |
$(PDFOPT) $@ [email protected] |
| 65 |
mv [email protected] $@ |
| 66 |
|
| 67 |
clean: |
| 68 |
$(RM) $(addprefix $(PACK),.aux .glo .gls .idx .ilg .ind .log .out .toc) |
| 69 |
$(RM) gind.lv.ist |
| 70 |
|
| 71 |
clean-all: clean |
| 72 |
$(RM) $(FILES) $(PACK).pdf |
| 73 |
|
| 74 |
############################################################################### |