Debian Codegraph @

texmf-dist/source/latex/ximera/Makefile

raw
1 NAME = ximera
2 SHELL = bash
3 PWD = $(shell pwd)
4 VERS = $(shell ltxfileinfo -v $(NAME).dtx|sed -e 's/^v//')
5 LOCAL = $(shell kpsewhich --var-value TEXMFLOCAL)
6 UTREE = $(shell kpsewhich --var-value TEXMFHOME)
7 INPUTS = $(wildcard src/*.dtx) $(wildcard src/interactives/*.dtx) $(NAME).dtx
8 OUTPUTS = ximera.cls xourse.cls ximera.4ht xourse.4ht ximera.cfg
9
10 # based on
11 #
12 # https://stackoverflow.com/questions/2973445/gnu-makefile-rule-generating-a-few-targets-from-a-single-source-file
13 #
14 # I use a silly pattern rule to convince GNU make that multiple
15 # outputs are created with a single invocation
16
17 all: $(NAME).pdf $(OUTPUTS)
18 test -e README.txt && mv README.txt README || exit 0
19
20 $(NAME)%pdf ximera%cls xourse%cls ximera%4ht xourse%4ht ximera%cfg: $(INPUTS)
21 pdflatex -shell-escape -recorder -interaction=batchmode $(NAME).dtx >/dev/null
22 if [ -f $(NAME).glo ]; then makeindex -q -s gglo.ist -o $(NAME).gls $(NAME).glo; fi
23 if [ -f $(NAME).idx ]; then makeindex -q -s gind.ist -o $(NAME).ind $(NAME).idx; fi
24 pdflatex --recorder --interaction=nonstopmode $(NAME).dtx > /dev/null
25 pdflatex --recorder --interaction=nonstopmode $(NAME).dtx > /dev/null
26
27 clean:
28 rm -f $(NAME).{aux,fls,glo,gls,hd,idx,ilg,ind,ins,log,out}
29
30 distclean: clean
31 rm -f ximera.pdf README $(OUTPUTS)
32
33 # BADBAD: The code below still needs to be fixed
34
35 inst: all
36 mkdir -p $(UTREE)/{tex,source,doc}/latex/$(NAME)
37 cp $(NAME).dtx $(UTREE)/source/latex/$(NAME)
38 cp $(NAME).cls $(UTREE)/tex/latex/$(NAME)
39 cp $(NAME).pdf $(UTREE)/doc/latex/$(NAME)
40
41 install: all
42 sudo mkdir -p $(LOCAL)/{tex,source,doc}/latex/$(NAME)
43 sudo cp $(NAME).dtx $(LOCAL)/source/latex/$(NAME)
44 sudo cp $(NAME).cls $(LOCAL)/tex/latex/$(NAME)
45 sudo cp $(NAME).pdf $(LOCAL)/doc/latex/$(NAME)
46
47 zip: all
48 ln -sf . $(NAME)
49 zip -Drq $(PWD)/$(NAME)-$(VERS).zip $(NAME)/{README,$(NAME).{pdf,dtx}}
50 rm $(NAME)