Skip to content

Commit bceb2a8

Browse files
committed
Makefile updated to version 2.2.1
1 parent 76e31ec commit bceb2a8

1 file changed

Lines changed: 24 additions & 3 deletions

File tree

Source/Makefile

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#
3131
fileinfo := LaTeX Makefile
3232
author := Chris Monson
33-
version := 2.2.1-alpha10
33+
version := 2.2.1
3434
#
3535
.DEFAULT_GOAL := all
3636
# Note that the user-global version is imported *after* the source directory,
@@ -126,6 +126,10 @@ export LC_ALL ?= C
126126
#
127127
#
128128
# CHANGES:
129+
# Chris Monson (2020-12-11):
130+
# * Fix bcf datasource collection, add some tests, thanks to k4rtik on issue 126
131+
# Chris Monson (2018-11-28):
132+
# * Add bcf datasource collection for biber - thanks to llbit on issue 126
129133
# Chris Monson (2014-09-04):
130134
# * Allow graphic dependencies in texmf directories (anything .fls knows about).
131135
# Chris Monson (2014-02-14):
@@ -1001,13 +1005,15 @@ cleanse-filename = $(subst .,_,$(subst /,__,$1))
10011005

10021006
# Escape dots and forward slashes.
10031007
# $(call escape-fname-regex,str)
1004-
escape-fname-regex = $(subst /,\\/,$(subst .,\\.,$1))
1008+
escape-fname-regex = $(subst /,\/,$(subst .,\.,$1))
10051009

10061010
# Test that a file exists
10071011
# $(call test-exists,file)
10081012
test-exists = [ -e '$1' ]
10091013
# $(call test-not-exists,file)
10101014
test-not-exists = [ ! -e '$1' ]
1015+
# $(call test-non-empty,file)
1016+
test-non-empty = [ -s '$1' ]
10111017

10121018
# $(call move-files,source,destination)
10131019
move-if-exists = $(call test-exists,$1) && $(MV) '$1' '$2'
@@ -2044,6 +2050,20 @@ $(SED) \
20442050
$(SORT) | $(UNIQ)
20452051
endef
20462052

2053+
# Outputs bcf bibs to stdout. Arg 1 is the bcf file stem, arg 2 is the
2054+
# list of targets for each dependency found.
2055+
define get-bcf-bibs
2056+
if $(call test-non-empty,$1); then \
2057+
$(SED) \
2058+
-e '/datasource/!d' \
2059+
-e 's/^[^>]*>//g' \
2060+
-e 's/<.*$$//g' \
2061+
-e '/\.bib$$/!s/$$/.bib/' \
2062+
-e 's!^!$2: !' \
2063+
'$1' | $(SORT) | $(UNIQ); \
2064+
fi
2065+
endef
2066+
20472067
# Makes a an aux file that only has stuff relevant to the target in it
20482068
# $(call make-auxtarget-file,<flattened-aux>,<new-aux>)
20492069
define make-auxtarget-file
@@ -2818,7 +2838,7 @@ endef
28182838
# $(call make-ps,<dvi file>,<ps file>,<log file>,[<paper size>],[<beamer info>])
28192839
make-ps = \
28202840
$(DVIPS) -z -o '$2' $(if $(strip $4),-t$(strip $4),) '$1' \
2821-
$(if $5,| $(enlarge_beamer)) > $3 2>&1
2841+
$(if $(strip $5),| $(enlarge_beamer)) > $3 2>&1
28222842

28232843
# Convert Postscript to PDF
28242844
# $(call make-pdf,<ps file>,<pdf file>,<log file>,<embed file>)
@@ -3334,6 +3354,7 @@ endif
33343354
$(call get-graphics,$*) >> $*.d; \
33353355
$(call get-log-index,$*,$(addprefix $*.,aux aux.make)) >> $*.d; \
33363356
$(call get-bibs,$*.aux.make,$(addprefix $*.,bbl aux aux.make)) >> $*.d; \
3357+
$(call get-bcf-bibs,$*.bcf,$(addprefix $*.,bbl aux aux.make)) >> $*.d; \
33373358
$(EGREP) -q "# MISSING stem" $*.d && $(SLEEP) 1 && $(RM) $*.pdf; \
33383359
$(EGREP) -q "# MISSING format" $*.d && $(RM) $*.pdf; \
33393360
$(call move-if-exists,$*.$(build_target_extension),$*.$(build_target_extension).1st.make); \

0 commit comments

Comments
 (0)