| 1 |
### Makefile --- |
| 2 |
# |
| 3 |
# This file generates files required to use the listings package. |
| 4 |
# |
| 5 |
# Time-stamp: <2025-01-26 22:07:31 ax006ho> |
| 6 |
# |
| 7 |
# (c) 2007 Brooks Moses |
| 8 |
# (c) 2013- Jobst Hoffmann |
| 9 |
# |
| 10 |
# This file is distributed under the terms of the LaTeX Project Public |
| 11 |
# License from CTAN archives in directory macros/latex/base/lppl.txt. |
| 12 |
# Either version 1.3c or, at your option, any later version. |
| 13 |
|
| 14 |
# remember: |
| 15 |
# $<: first element of list of dependees |
| 16 |
# $^: list of (all) dependees |
| 17 |
# $@: target |
| 18 |
|
| 19 |
# formatting tools |
| 20 |
LATEX = pdflatex |
| 21 |
MAKEINDEX = makeindex |
| 22 |
TEX = tex |
| 23 |
# tarring options |
| 24 |
ifneq "$(wildcard listings.version)" "" |
| 25 |
include listings.version # version and date of the package |
| 26 |
endif |
| 27 |
TAR_SRC = $(PACKAGE)-$(VERSION)_source.tgz |
| 28 |
EXsvn = --exclude .svn --exclude auto --exclude contrib --exclude requests \ |
| 29 |
--exclude support --exclude testing \ |
| 30 |
--exclude *.tgz --exclude *.txt |
| 31 |
|
| 32 |
DISTRIBUTION_FILES = ../$(PACKAGE)/$(PACKAGE).pdf \ |
| 33 |
../$(PACKAGE)/$(PACKAGE)-devel.pdf \ |
| 34 |
../$(PACKAGE)/$(PACKAGE).dtx \ |
| 35 |
../$(PACKAGE)/$(PACKAGE).ins \ |
| 36 |
../$(PACKAGE)/README \ |
| 37 |
../$(PACKAGE)/Makefile \ |
| 38 |
../$(PACKAGE)/lstdrvrs.dtx \ |
| 39 |
../$(PACKAGE)/lstdrvrs.pdf |
| 40 |
PACKAGE_FILES = $(subst ../$(PACKAGE)/,,$(DISTRIBUTION_FILES)) |
| 41 |
STY_FILES = listings.cfg listings.sty lstmisc.sty \ |
| 42 |
lstlang0.sty lstlang1.sty lstlang2.sty |
| 43 |
|
| 44 |
.SUFFIXES: # Delete the default suffixes |
| 45 |
.SUFFIXES: .dtx .ins .pdf .sty # Define our own suffix list |
| 46 |
|
| 47 |
.PHONY: listings pdf pdf-devel tests all |
| 48 |
|
| 49 |
listings: listings.sty |
| 50 |
|
| 51 |
pdf: listings.pdf lstdrvrs.pdf |
| 52 |
|
| 53 |
pdf-devel: listings-devel.pdf |
| 54 |
|
| 55 |
all: listings pdf pdf-devel |
| 56 |
|
| 57 |
listings.sty: listings.ins listings.dtx lstdrvrs.dtx |
| 58 |
$(TEX) $< |
| 59 |
|
| 60 |
listings.pdf: listings.sty |
| 61 |
echo "\PassOptionsToClass{a4paper}{ltxdoc}" > ltxdoc.cfg |
| 62 |
$(LATEX) ${<:.sty=.dtx} |
| 63 |
$(MAKEINDEX) -s gind.ist ${@:.pdf=} |
| 64 |
$(LATEX) ${<:.sty=.dtx} |
| 65 |
$(LATEX) ${<:.sty=.dtx} |
| 66 |
rm -f ltxdoc.cfg |
| 67 |
|
| 68 |
listings-devel.pdf: listings.sty |
| 69 |
echo "\PassOptionsToClass{a4paper}{ltxdoc}" > ltxdoc.cfg |
| 70 |
echo "\AtBeginDocument{\AlsoImplementation\EnableCrossrefs\CodelineIndex}" >> ltxdoc.cfg |
| 71 |
$(LATEX) -jobname=${@:.pdf=} ${<:.sty=.dtx} |
| 72 |
$(MAKEINDEX) -s gind.ist ${@:.pdf=} |
| 73 |
$(LATEX) -jobname=${@:.pdf=} ${<:.sty=.dtx} |
| 74 |
$(LATEX) -jobname=${@:.pdf=} ${<:.sty=.dtx} |
| 75 |
# rm -f ltxdoc.cfg |
| 76 |
|
| 77 |
lstdrvrs.pdf: lstdrvrs.dtx |
| 78 |
echo "\PassOptionsToClass{a4paper}{ltxdoc}" > ltxdoc.cfg |
| 79 |
$(LATEX) ${<:.sty=.dtx} |
| 80 |
$(MAKEINDEX) -s gind.ist lstdrvrs |
| 81 |
$(LATEX) ${<:.sty=.dtx} |
| 82 |
$(LATEX) ${<:.sty=.dtx} |
| 83 |
rm -f ltxdoc.cfg |
| 84 |
|
| 85 |
## Testing targets |
| 86 |
acm-tests: |
| 87 |
cd testing; make acm |
| 88 |
|
| 89 |
algol-tests: |
| 90 |
cd testing; make algol |
| 91 |
|
| 92 |
bash-tests: |
| 93 |
cd testing; make bash |
| 94 |
|
| 95 |
c++11-tests: |
| 96 |
cd testing; make c++11 |
| 97 |
|
| 98 |
cobol-tests: |
| 99 |
cd testing; make cobol |
| 100 |
|
| 101 |
fortran-tests: |
| 102 |
cd testing; make fortran |
| 103 |
|
| 104 |
elisp-tests: |
| 105 |
cd testing; make elisp |
| 106 |
|
| 107 |
gap-tests: |
| 108 |
cd testing; make gap |
| 109 |
|
| 110 |
go-tests: |
| 111 |
cd testing; make go |
| 112 |
|
| 113 |
hansl-tests: |
| 114 |
cd testing; make hansl |
| 115 |
|
| 116 |
llvm-tests: |
| 117 |
cd testing; make llvm |
| 118 |
|
| 119 |
lua-tests: |
| 120 |
cd testing; make lua |
| 121 |
|
| 122 |
mathematica-tests: |
| 123 |
cd testing; make mathematica |
| 124 |
|
| 125 |
python-tests: |
| 126 |
cd testing; make python |
| 127 |
|
| 128 |
scala-tests: |
| 129 |
cd testing; make scala |
| 130 |
|
| 131 |
swift-tests: |
| 132 |
cd testing; make swift |
| 133 |
|
| 134 |
vbscript-tests: |
| 135 |
cd testing; make vbscript |
| 136 |
|
| 137 |
xml-tests: |
| 138 |
cd testing; make xml |
| 139 |
|
| 140 |
tests: |
| 141 |
cd testing; make all |
| 142 |
|
| 143 |
## Clean targets |
| 144 |
clean: |
| 145 |
-rm -f *~ *.aux *.lof *.log *.lot *.tmp *.toc |
| 146 |
-rm -f *.idx *.ind *.glg *.glo *.gls *.ilg *.out |
| 147 |
-rm -f *.bbl *.blg *.brf |
| 148 |
|
| 149 |
clean-results: |
| 150 |
-rm -f *.cfg *.pdf *.prf *.sty |
| 151 |
|
| 152 |
realclean: clean clean-results |
| 153 |
|
| 154 |
### create packed files |
| 155 |
tar-src: |
| 156 |
@$(MAKE) realclean; \ |
| 157 |
sed -i -e "s+fileversion{[a-z0-9\.\-]*}+fileversion{$(VERSION)}+g" \ |
| 158 |
-e "s+filedate{[0-9/]*}+filedate{$(DATE)}+g" \ |
| 159 |
-e "s+date{[0-9/]*\\\\enspace+date{$(DATE)\\\\enspace+g" \ |
| 160 |
-e "s+Version [a-z0-9\.\-]*\\\\+Version $(VERSION)\\\\+g" \ |
| 161 |
-e "s+Package [a-z0-9\.\-]*\\\\+Package $(VERSION)\\\\+g" \ |
| 162 |
listings.dtx; \ |
| 163 |
sed -i -e "s+date{[0-9/]*\\\\enspace+date{$(DATE)\\\\enspace+g" \ |
| 164 |
-e "s+Version [a-z0-9\.\-]*\\\\+Version $(VERSION)\\\\+g" \ |
| 165 |
-e "s+\[[0-9/]* [a-z0-9\.\-]* listings+[$(DATE) $(VERSION) listings+g" \ |
| 166 |
lstdrvrs.dtx; \ |
| 167 |
cd ..; tar $(EXsvn) -czvf $(PACKAGE)/$(TAR_SRC) $(PACKAGE) |
| 168 |
|
| 169 |
tar-dist: $(PACKAGE_FILES) |
| 170 |
@$(MAKE) realclean; \ |
| 171 |
sed -i -e "s+fileversion{[a-z0-9\.\-]*}+fileversion{$(VERSION)}+g" \ |
| 172 |
-e "s+filedate{[0-9/]*}+filedate{$(DATE)}+g" \ |
| 173 |
-e "s+date{[0-9/]*\\\\enspace+date{$(DATE)\\\\enspace+g" \ |
| 174 |
-e "s+Version [a-z0-9\.\-]*\\\\+Version $(VERSION)\\\\+g" \ |
| 175 |
listings.dtx; \ |
| 176 |
sed -i -e "s+date{[0-9/]*\\\\enspace+date{$(DATE)\\\\enspace+g" \ |
| 177 |
-e "s+Version [a-z0-9\.\-]*\\\\+Version $(VERSION)\\\\+g" \ |
| 178 |
-e "s+\[[0-9/]* [a-z0-9\.\-]* listings+[$(DATE) $(VERSION) listings+g" \ |
| 179 |
lstdrvrs.dtx; \ |
| 180 |
$(MAKE) listings.pdf; \ |
| 181 |
$(MAKE) listings-devel.pdf; \ |
| 182 |
$(MAKE) lstdrvrs.pdf; \ |
| 183 |
tar cfvz $(PACKAGE)-$(VERSION).tgz $(DISTRIBUTION_FILES); |
| 184 |
|
| 185 |
tagged-release: |
| 186 |
sed -n -e "/Version $(VERSION)/,$$$$w announcement_text.log" \ |
| 187 |
announcement_text.txt |
| 188 |
svn copy --file ./announcement_text.log \ |
| 189 |
svn+ssh://[email protected]/listings/trunk \ |
| 190 |
svn+ssh://[email protected]/listings/tags/$(VERSION) |
| 191 |
rm announcement_text.log |
| 192 |
|
| 193 |
|
| 194 |
## Documentation target |
| 195 |
help:: |
| 196 |
$(info Usage:) |
| 197 |
$(info ) |
| 198 |
$(info make [all] generates listings.sty and [all] the .pdf versions) |
| 199 |
$(info $(empty) (user/developer) of the documentation) |
| 200 |
$(info ) |
| 201 |
$(info make <file name>) |
| 202 |
$(info $(empty) creates the corresponding file denoted by <file name>) |
| 203 |
$(info ) |
| 204 |
$(info make help shows this help) |
| 205 |
$(info ) |
| 206 |
$(info make tests performs a little test suite) |
| 207 |
$(info ) |
| 208 |
$(info make clean removes all intermediate files created by a LaTeX run) |
| 209 |
$(info ) |
| 210 |
$(info make clean-results) |
| 211 |
$(info $(empty) removes .cfg, .sty, and .pdf files) |
| 212 |
$(info ) |
| 213 |
$(info make realclean) |
| 214 |
$(info $(empty) performs clean and clean-results) |
| 215 |
$(info ) |
| 216 |
$(info make tar-src) |
| 217 |
$(info $(empty) generates a tarred version of the current directory) |
| 218 |
$(info ) |
| 219 |
$(info make tar-dist) |
| 220 |
$(info $(empty) generates a distributable version of the listings) |
| 221 |
$(info $(empty) package) |
| 222 |
$(info ) |
| 223 |
$(info make tagged-release) |
| 224 |
$(info $(empty) creates a new tagged version of the package based on) |
| 225 |
$(info $(empty) the contents of listings.version and announcement_text.txt) |
| 226 |
@echo "" # prevents message "nothing to do ..." |
| 227 |
|
| 228 |
### Makefile ends here --- |