Add support for bibtex
Michael Grünewald
9 years ago
18 | 18 | SUBDIR+= test_graphicx |
19 | 19 | SUBDIR+= test_metapost |
20 | 20 | SUBDIR+= test_complex |
21 | SUBDIR+= test_bibtex | |
21 | 22 | |
22 | 23 | .include "subdir.mk" |
23 | 24 |
0 | ### Makefile -- Test bibtex support | |
1 | ||
2 | # Author: Michael Grünewald | |
3 | # Date: Thu Nov 27 09:33:31 CET 2014 | |
4 | ||
5 | # BSD Owl Scripts (https://github.com/michipili/bsdowl) | |
6 | # This file is part of BSD Owl Scripts | |
7 | # | |
8 | # Copyright © 2005–2014 Michael Grünewald | |
9 | # | |
10 | # This file must be used under the terms of the CeCILL-B. | |
11 | # This source file is licensed as described in the file COPYING, which | |
12 | # you should have received as part of this distribution. The terms | |
13 | # are also available at | |
14 | # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt | |
15 | ||
16 | TEST= TestBibtex | |
17 | ||
18 | .include "test.mk" | |
19 | ||
20 | ### End of file `Makefile' |
0 | ### TestBibtex.mk -- Test bibtex support | |
1 | ||
2 | # Author: Michael Grünewald | |
3 | # Date: Thu Nov 27 09:34:30 CET 2014 | |
4 | ||
5 | # BSD Owl Scripts (https://github.com/michipili/bsdowl) | |
6 | # This file is part of BSD Owl Scripts | |
7 | # | |
8 | # Copyright © 2005–2014 Michael Grünewald | |
9 | # | |
10 | # This file must be used under the terms of the CeCILL-B. | |
11 | # This source file is licensed as described in the file COPYING, which | |
12 | # you should have received as part of this distribution. The terms | |
13 | # are also available at | |
14 | # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt | |
15 | ||
16 | DOCUMENT= withbibtex.tex | |
17 | TEXDEVICE= pdf | |
18 | USES+= bibtex | |
19 | ||
20 | test: | |
21 | test -f ${DESTDIR}${DOCDIR}/withbibtex.pdf | |
22 | ||
23 | .include "latex.doc.mk" | |
24 | ||
25 | ### End of file `TestBibtex.mk' |
0 | %%% references.bib -- A short bibliographic database | |
1 | ||
2 | % Author: Michael Grünewald | |
3 | % Date: Thu Nov 27 10:11:37 CET 2014 | |
4 | ||
5 | % BSD Owl Scripts (https://github.com/michipili/bsdowl) | |
6 | % This file is part of BSD Owl Scripts | |
7 | % | |
8 | % Copyright © 2005–2014 Michael Grünewald | |
9 | % | |
10 | % This file must be used under the terms of the CeCILL-B. | |
11 | % This source file is licensed as described in the file COPYING, which | |
12 | % you should have received as part of this distribution. The terms | |
13 | % are also available at | |
14 | % http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt | |
15 | ||
16 | @book {TEXBOOK, | |
17 | AUTHOR = {Knuth, Donald E.}, | |
18 | TITLE = {The {\TeX book}}, | |
19 | PUBLISHER = {Addison-Wesley}, | |
20 | YEAR = {1984} | |
21 | } | |
22 | ||
23 | %%% End of file `references.bib' |
0 | %%% withbibtex.tex -- A LaTeX document using bibtex | |
1 | ||
2 | % Author: Michael Grünewald | |
3 | % Date: Thu Nov 27 09:35:52 CET 2014 | |
4 | ||
5 | % BSD Owl Scripts (https://github.com/michipili/bsdowl) | |
6 | % This file is part of BSD Owl Scripts | |
7 | % | |
8 | % Copyright © 2005–2014 Michael Grünewald | |
9 | % | |
10 | % This file must be used under the terms of the CeCILL-B. | |
11 | % This source file is licensed as described in the file COPYING, which | |
12 | % you should have received as part of this distribution. The terms | |
13 | % are also available at | |
14 | % http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt | |
15 | ||
16 | \documentclass{amsbook} | |
17 | \begin{document} | |
18 | A {\LaTeX} document using {bib\TeX} and using a reference to the | |
19 | \emph{\TeX book}~\cite{TEXBOOK}. | |
20 | \backmatter | |
21 | \bibliographystyle{plain} | |
22 | \bibliography{references} | |
23 | \end{document} | |
24 | ||
25 | %%% End of file `withbibtex.tex' |
22 | 22 | FILES+= texmf.build.mk |
23 | 23 | FILES+= texmf.mpost.mk |
24 | 24 | FILES+= texmf.draft.mk |
25 | FILES+= texmf.bibtex.mk | |
25 | 26 | |
26 | 27 | FILES+= tex.doc.mk |
27 | 28 | FILES+= latex.doc.mk |
29 | 30 | |
30 | 31 | OBSOLETE+= tex.files.mk |
31 | 32 | OBSOLETE+= tex.files.main.mk |
32 | OBSOLETE+= latex.bibtex.mk | |
33 | 33 | |
34 | 34 | .include "project.mk" |
35 | 35 |
47 | 47 | ) && ${ECHO} 'Everything seems in order' |
48 | 48 | |
49 | 49 | .include "texmf.build.mk" |
50 | .include "texmf.bibtex.mk" | |
50 | 51 | .include "texmf.mpost.mk" |
51 | 52 | .include "texmf.depend.mk" |
52 | 53 | .include "texmf.clean.mk" |
0 | ### texmf.bibtex.mk -- Support BibTeX | |
1 | ||
2 | # Author: Michael Grünewald | |
3 | # Date: Thu Nov 27 09:18:45 CET 2014 | |
4 | ||
5 | # BSD Owl Scripts (https://github.com/michipili/bsdowl) | |
6 | # This file is part of BSD Owl Scripts | |
7 | # | |
8 | # Copyright © 2005–2014 Michael Grünewald | |
9 | # | |
10 | # This file must be used under the terms of the CeCILL-B. | |
11 | # This source file is licensed as described in the file COPYING, which | |
12 | # you should have received as part of this distribution. The terms | |
13 | # are also available at | |
14 | # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt | |
15 | ||
16 | # Variables: | |
17 | # | |
18 | # | |
19 | # BSTINPUTS | |
20 | # Lookup path for bibiliography styles | |
21 | # | |
22 | # | |
23 | # BIBINPUTS | |
24 | # Lookup path for bibliography databases | |
25 | # | |
26 | # | |
27 | # BIBTEX | |
28 | # Our bibtex command | |
29 | ||
30 | # Uses: | |
31 | # | |
32 | # | |
33 | # bibtex: no argument | |
34 | # Require the use of bibtex | |
35 | ||
36 | .if !defined(THISMODULE) | |
37 | .error texmf.bibtex.mk cannot be included directly. | |
38 | .endif | |
39 | ||
40 | ||
41 | .if !target(__<texmf.bibtex.mk>__) | |
42 | __<texmf.bibtex.mk>__: | |
43 | ||
44 | BIBTEX?= bibtex | |
45 | ||
46 | .if "${.OBJDIR}" != "${.CURDIR}" | |
47 | BSTINPUTS+= ${.CURDIR} | |
48 | BIBINPUTS+= ${.CURDIR} | |
49 | .endif | |
50 | ||
51 | ||
52 | .if defined(BSTINPUTS) | |
53 | _BIBTEX_ENV+= BSTINPUTS='.:${BSTINPUTS:tW:S@ @:@g}:' | |
54 | .endif | |
55 | ||
56 | .if defined(BIBINPUTS) | |
57 | _BIBTEX_ENV+= BIBINPUTS='.:${BIBINPUTS:tW:S@ @:@g}:' | |
58 | .endif | |
59 | ||
60 | .if !empty(_BIBTEX_ENV) | |
61 | _BIBTEX_TOOL= ${ENVTOOL} ${_BIBTEX_ENV} ${BIBTEX} | |
62 | .else | |
63 | _BIBTEX_TOOL= ${BIBTEX} | |
64 | .endif | |
65 | ||
66 | ||
67 | .if !empty(_USES_OPTIONS:Mbibtex) | |
68 | .for document in ${_TEX_DOCUMENT} | |
69 | .for device in dvi pdf | |
70 | ${COOKIEPREFIX}${document:T}.${device}.toc: ${COOKIEPREFIX}${document:T}.${device}.bib | |
71 | ${COOKIEPREFIX}${document:T}.${device}.bib: ${COOKIEPREFIX}${document:T}.${device}.aux ${SRCS.${document:T}} | |
72 | ${INFO} 'Processing bibliography database information for ${document:T}' | |
73 | ${_BIBTEX_TOOL} ${document:T:R} | |
74 | @${TOUCH} ${.TARGET} | |
75 | HARDCOOKIEFILES+= ${COOKIEPREFIX}${document:T}.${device}.bib | |
76 | REALCLEANFILES+= ${document:R}.bbl | |
77 | CLEANFILES+= ${document:R}.blg | |
78 | .endfor | |
79 | .endfor | |
80 | .endif | |
81 | ||
82 | .endif # !target(__<texmf.bibtex.mk>__) | |
83 | ||
84 | ### End of file `texmf.bibtex.mk' |