Debian Codegraph @

texmf-dist/doc/latex/listings-ext/listings-ext.mk

raw symbols SCIP
1 #-----------------------------------------------------------------------
2 # Purpose: generation of the documentation of the listings-ext package
3 # Notice: this file can be used without any change only with dmake and
4 # the option "-B", this option lets dmake interpret the leading
5 # spaces as distinguishing characters for commands in the make
6 # rules.
7 # The necessary changes for the common make can be applied by
8 # the script listings-ext.makemake
9 #
10 # Rules:
11 # - all: generate all the files and the basic
12 # documentation
13 # - develop: generate the documentation with revision
14 # - develop-pdf: history and source code (the latter provides
15 # a .pdf file as output)
16 # - history: generate the documentation with revision
17 # - history-pdf: history (the latter provides a .pdf file as
18 # output)
19 # - examples: format the examples
20 # - install: install the package in a standard TDS tree
21 # - uninstall: uninstall the package from a standard TDS
22 # tree
23 # - clean: clean the directory of intermediate files
24 # - clean-examples: example and test files
25 # - clean-support: support files
26 # - realclean: all but the pure source
27 # files
28 # - tar-src: create a gzipped .tar-file of the pure
29 # source files
30 # - tar-dist: create a gzipped .tar-file containing
31 # version information
32 #
33 # Author: Jobst Hoffmann, Fachhochschule Aachen, Campus Juelich
34 # $Date: 2010-06-29 18:38:12 +0200 (Di, 29 Jun 2010) $
35 #-----------------------------------------------------------------------
36
37 # The texmf-directory, where to install new stuff (see texmf.cnf)
38 # If you don't know what to do, search for directory texmf at /usr.
39 # With teTeX and linux often one of following is used:
40 #INSTALLTEXMF=/usr/TeX/texmf
41 #INSTALLTEXMF=/usr/local/TeX/texmf
42 #INSTALLTEXMF=/usr/share/texmf
43 #INSTALLTEXMF=/usr/local/share/texmf
44 # user tree:
45 #INSTALLTEXMF=$(HOME)/texmf
46 # Try to use user's tree known by kpsewhich:
47 INSTALLTEXMF=`kpsewhich --expand-var '$$TEXMFHOME'`
48 # Try to use the local tree known by kpsewhich:
49 #INSTALLTEXMF=`kpsewhich --expand-var '$$TEXMFLOCAL'`
50 # But you may set INSTALLTEXMF to every directory you want.
51 # Use the following, if you only want to test the installation:
52 #INSTALLTEXMF=/tmp/texmf
53
54 # If texhash must run after installation, you can invoke this:
55 TEXHASH=texhash
56
57 # change this to the directory which contains the graphic files
58 GRAPHICPATH=.
59
60 ######### Edit the following only, if you want to change defaults!
61
62 # The directory, where to install *.cls and *.sty
63 CLSDIR=$(INSTALLTEXMF)/tex/latex/jhf/$(PACKAGE)
64
65 # The directory, where to install documentation
66 DOCDIR=$(INSTALLTEXMF)/doc/latex/jhf/$(PACKAGE)
67
68 # The directory, where to install the sources
69 SRCDIR=$(INSTALLTEXMF)/source/latex/jhf/$(PACKAGE)
70
71 # The directory, where to install demo-files
72 # If we have some, we have to add following 2 lines to install rule:
73 # $(MKDIR) $(DEMODIR); \
74 # $(INSTALL) $(DEMO_FILES) $(DEMODIR); \
75 DEMODIR=$(DOCDIR)/demo
76
77 # We need this, because the documentation needs the classes and packages
78 # It's not really a good solution, but it's a working solution.
79 TEXINPUTS := $(PWD):$(TEXINPUTS)
80
81 # To generate the version number of the distribution from the source
82 VERSION_L := latex getversion | grep '^VERSION'
83 VERSION_S := `latex getversion | grep '^VERSION' | \
84 sed 's+^VERSION \\(.*\\) of .*+\\1+'`
85 ########################################################################
86 # End of customization section
87 ########################################################################
88
89 # formatting tools
90 BIBTEX = bibtex
91 DVIPS = dvips
92 LATEX = latex
93 PDFLATEX = pdflatex
94 TEX = tex
95 PS2PDF = ps2pdf
96
97 # postscript viewer
98 GV = gv
99
100 # tarring options
101 DATE = `date +%Y-%m-%d`
102 TAR_SRC = $(PACKAGE)_$(DATE)_source.tar.gz
103 EXsvn = --exclude .svn --exclude auto
104
105 # formatting options
106 COMMON_OPTIONS =
107 HISTORY_OPTIONS = \RecordChanges
108 DEVELOPER_OPTIONS = \AlsoImplementation\RecordChanges\CodelineIndex\EnableCrossrefs
109 DEVELOPER_OPTIONS_FINAL = \AlsoImplementation\CodelineIndex\DisableCrossrefs\RecordChanges
110
111 PACKAGE = listings-ext
112
113 DISTRIBUTION_FILES = $(PACKAGE).pdf $(PACKAGE).dtx \
114 $(PACKAGE).ins README
115
116 .SUFFIXES: # Delete the default suffixes
117 .SUFFIXES: .dtx .dvi .ins .ps .pdf .sty # Define our suffix list
118
119 ## Main Targets
120
121 # strip off the comments from the package
122 $(PACKAGE).sty $(PACKAGE)-test-*.tex: $(PACKAGE).ins $(PACKAGE).dtx
123 +$(LATEX) $<; \
124 sh $(PACKAGE).makemake
125
126 all: $(PACKAGE).dvi
127
128 # generate the documentation
129 $(PACKAGE).dvi: $(PACKAGE).dtx $(PACKAGE).sty
130 +rm -f *.ind *.gls
131 +$(LATEX) "\AtBeginDocument{$(COMMON_OPTIONS)}\input{$<}"
132 +$(BIBTEX) $(PACKAGE)
133 +$(LATEX) "\AtBeginDocument{$(COMMON_OPTIONS)}\input{$<}"
134 +$(LATEX) "\AtBeginDocument{$(COMMON_OPTIONS)}\input{$<}"
135
136 # generate the documentation with revision history
137 history: $(PACKAGE).dtx $(PACKAGE).sty
138 +$(LATEX) "\AtBeginDocument{$(COMMON_OPTIONS)$(HISTORY_OPTIONS)}\input{$<}"
139 +$(BIBTEX) $(PACKAGE)
140 +$(LATEX) "\AtBeginDocument{$(COMMON_OPTIONS)$(HISTORY_OPTIONS)}\input{$<}"
141 +makeindex -s gind.ist $(PACKAGE).idx
142 +makeindex -s gglo.ist -o $(PACKAGE).gls -t $(PACKAGE).glg $(PACKAGE).glo
143 +$(LATEX) "\AtBeginDocument{$(COMMON_OPTIONS)$(HISTORY_OPTIONS)}\input{$<}"
144
145 # generate the documentation for the developer
146 develop: $(PACKAGE).dtx $(PACKAGE).sty
147 +$(LATEX) "\AtBeginDocument{$(DEVELOPER_OPTIONS)}\input{$<}"
148 +$(BIBTEX) $(PACKAGE)
149 +$(LATEX) "\AtBeginDocument{$(DEVELOPER_OPTIONS)}\input{$<}"
150 +makeindex -s gind.ist $(PACKAGE).idx
151 +makeindex -s gglo.ist -o $(PACKAGE).gls -t $(PACKAGE).glg $(PACKAGE).glo
152 +$(LATEX) "\AtBeginDocument{$(DEVELOPER_OPTIONS_FINAL)}\input{$<}"
153
154 develop-pdf: develop
155 +$(DVIPS) $(PACKAGE).dvi; \
156 $(PS2PDF) $(PACKAGE).ps; \
157 rm $(PACKAGE).ps
158
159 history-pdf: history
160 +$(DVIPS) $(PACKAGE).dvi; \
161 $(PS2PDF) $(PACKAGE).ps; \
162 rm $(PACKAGE).ps
163
164 # implicit rule for generating the .pdf files
165 %.pdf: %.dvi
166 +$(DVIPS) $<; \
167 $(PS2PDF) $(<:.dvi=.ps); \
168 rm $(<:.dvi=.ps)
169
170 # format the example/test files
171 examples:
172 sh listings-ext.sh -c -o *.java; \
173 for i in $(PACKAGE)*test*.tex; do \
174 f=$${i%.tex}; \
175 $(LATEX) "\nofiles\input{$$f}"; \
176 $(DVIPS) -o $$f.ps $$f.dvi; \
177 $(PS2PDF) $$f.ps; \
178 rm $$f.dvi $$f.ps; \
179 done
180
181 install: $(PACKAGE).dtx $(PACKAGE).pdf
182 [ -d $(CLSDIR) ] || mkdir -p $(CLSDIR)
183 [ -d $(DOCDIR) ] || mkdir -p $(DOCDIR)
184 [ -d $(SRCDIR) ] || mkdir -p $(SRCDIR)
185 cp $(PACKAGE).sty $(CLSDIR)
186 cp $(PACKAGE).pdf $(DOCDIR)
187 cp $(PACKAGE).ins $(SRCDIR)
188 cp $(PACKAGE).dtx $(SRCDIR)
189 cp $(PACKAGE)_{exmpl,test}_* $(SRCDIR)
190 cp README $(SRCDIR)
191 cp THIS-IS-VERSION-$(VERSION) $(SRCDIR)
192
193 uninstall:
194 rm -f $(CLSDIR)/$(PACKAGE).sty
195 rm -fr $(DOCDIR)
196 rm -fr $(SRCDIR)
197
198 ## Clean Targets
199 clean:
200 -rm -f *.aux *.dvi *.hd *.lof *.log *.lot *.tmp *.toc
201 -rm -f *.idx *.ilg *.ind *.glg *.glo *.gls *.out
202 -rm -f *.bbl *.blg *.bm *.brf *.hd
203 -rm -f *.pdf *.ps
204 -rm -f *.rel *.thm
205
206 clean-examples:
207 -rm -f $(PACKAGE)_test* $(PACKAGE)_exmpl*
208
209 clean-support:
210 -rm -f *.el *.sh
211 -rm -f *.mk *.makemake
212
213 realclean: clean clean-examples clean-support
214 -rm -f *~ *.bib *.cfg *.sty *.tex
215 -rm -f Makefile
216
217 ### create packed files
218 tar-src:
219 $(MAKE) realclean
220 @cd ..; tar $(EXsvn) -czvf $(PACKAGE)/$(TAR_SRC) $(PACKAGE)
221
222 tar-dist: $(DISTRIBUTION_FILES)
223 +rm -f THIS_IS_VERSION_* *.tgz; \
224 $(VERSION_L) > THIS_IS_VERSION_$(VERSION_S); \
225 tar cfvz $(PACKAGE)-$(VERSION_S).tgz $^ THIS_IS_VERSION_*; \
226 rm getversion.log