summaryrefslogtreecommitdiff
path: root/Build/extra/bibtex/Makefile
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-01-23 23:56:59 +0000
committerKarl Berry <karl@freefriends.org>2018-01-23 23:56:59 +0000
commit6372ddbab3389d1e44cb013fd178b6e4b2a10763 (patch)
treea6e7be6f92da154a893e5581294fea27a2029982 /Build/extra/bibtex/Makefile
parent8294cc19d41a8405e05ec257dd5111b8c18ed4e8 (diff)
move source/extra up a level to Build/extra, to clarify that they are not part of TL
git-svn-id: svn://tug.org/texlive/trunk@46418 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/extra/bibtex/Makefile')
-rw-r--r--Build/extra/bibtex/Makefile67
1 files changed, 67 insertions, 0 deletions
diff --git a/Build/extra/bibtex/Makefile b/Build/extra/bibtex/Makefile
new file mode 100644
index 00000000000..44a6e34a4e5
--- /dev/null
+++ b/Build/extra/bibtex/Makefile
@@ -0,0 +1,67 @@
+# (Public domain. Originally written by Karl Berry, 2010.)
+# This is just about creating the derived bst files, checking for
+# changes, making the distribution for CTAN, etc. It does not actually
+# build a BibTeX executable. So we keep it in the source repository.
+# We're using the TL repo (source/extra/bibtex) purely for convenience.
+
+all: pdf bst
+
+#############################################################################
+# documentation
+#
+pdflatex = pdflatex --file-line-error
+bibtex = bibtex
+
+%.pdf: %.tex %.bbl
+ $(pdflatex) '\nonstopmode \input $<'
+
+%.bbl: %.tex %.aux btxdoc.bib
+ $(bibtex) $*
+ $(pdflatex) '\nonstopmode \input $<'
+
+%.aux: %.tex
+ $(pdflatex) '\nonstopmode \input $<'
+
+pdf: btxdoc.pdf btxhak.pdf
+
+.PRECIOUS: %.bbl
+
+#############################################################################
+#
+# bst files
+#
+bst: plain.bst unsrt.bst alpha.bst abbrv.bst
+
+%.bst: btxbst.doc
+# First line, substitute in bare style name.
+ echo "% BibTeX standard bibliography style \``basename $@ .bst`'" >$@
+#
+# About this cpp invocation:
+# -traditional so bst integers #1, etc., don't get preprocessed away.
+# -w since we know that we have unterminated ', ec.
+# -P since we don't want #line in the output.
+# -DBSTNAME taken from the target.
+#
+# Then we grep away the comments without leading whitespace,
+# and fold multiple blank lines into one.
+ cpp -traditional -w -P -D`basename $@ .bst|tr a-z A-Z` btxbst.doc \
+ | grep -v '^%' \
+ | uniq \
+ >>$@
+#
+# For diff purposes, expand the original (which might have tabs)
+# to the result (which shouldn't have any).
+ -grep ' ' $@
+ -expand ORIG/$@ | diff - $@
+
+#############################################################################
+check:
+ -grep ' ' [a-z]*
+
+dist: all
+ rm -f *.blg *.log bibtex.tar.gz
+ tar --exclude=\*.aux --exclude=\*.bbl -cvzf bibtex.tar.gz README *.*
+
+clean:
+ rm -f *.blg *.log *.aux *.bbl bibtex.tar.gz
+ rm -f abbrv.bst alpha.bst plain.bst unsrt.bst