Commit ae54b807 authored by Sergey Goncharov's avatar Sergey Goncharov
Browse files

handling multiple bbl

parent 491eeabc
Pipeline #58887 passed with stage
in 18 seconds
......@@ -11,11 +11,11 @@ endif
PDFNAMES = $(foreach FILE, $(SRCNAMES:.tex=.pdf), $(FILE))
DVINAMES = $(foreach FILE, $(SRCNAMES:.tex=.dvi), $(FILE))
BBLNAMES = $(foreach FILE, $(SRCNAMES:.tex=.bbl), $(FILE))
BBLNAMES = $(foreach FILE, $(wildcard *.aux), $(FILE:.aux=.bbl))
#$(warning SRCNAMES: $(SRCNAMES))
#$(warning PDFNAMES: $(PDFNAMES))
#$(warning BBLNAMES: $(BBLNAMES))
$(warning BBLNAMES: $(BBLNAMES))
#$(warning SRCNAME: $(SRCNAME))
# The resource file for bibtool
......@@ -79,8 +79,8 @@ edit: $(SRCNAMES)
for file in $(SRCNAMES); do $(OPEN) $$file; done
%.bbl: $(BIBSRC)
@echo Recreate the .aux file
$(PDF) $(@:.bbl=.tex) >/dev/null || cat $(@:.bbl=.log)
# @echo Recreate the .aux file
# $(PDF) $(@:.bbl=.tex) >/dev/null || cat $(@:.bbl=.log)
@echo Recreate the .bbl file
$(BIBTEX) $(@:.bbl=.aux) | true
......@@ -107,7 +107,7 @@ edit: $(SRCNAMES)
%.pdf: %.tex # Cancel the default rule
%.pdf: $(TEXSRC) $(wildcard $(THISDIR)*.tex) %.bbl
%.pdf: $(TEXSRC) $(wildcard $(THISDIR)*.tex) $(BBLNAMES)
@echo Compiling $@
($(PDF) $(@:.pdf=.tex) >/dev/null) || (touch --date="`date -R -r $(@:.pdf=.tex)`" $@ & cat $(@:.pdf=.log) & false)
......@@ -122,7 +122,7 @@ edit: $(SRCNAMES)
test -s $(@:.pdf=.cit) || echo '' | $(MD5SUM) > $(@:.pdf=.cit)
@echo If the citations were updated recompile the .bbl file
grep -o -G "Citation \`[^']*" $(@:.pdf=.log) | $(MD5SUM) -c --status $(@:.pdf=.cit) || ($(BIBTEX) $(@:.pdf=.aux); $(PDF) $(@:.pdf=.tex) >/dev/null)
grep -o -G "Citation \`[^']*" $(@:.pdf=.log) | $(MD5SUM) -c --status $(@:.pdf=.cit) || rm *.bbl; $(MAKE) bibtex; $(PDF) $(@:.pdf=.tex) >/dev/null
@echo -n "Search for dangling references.. "
@if grep -q "Rerun to get cross-references right." $(@:.pdf=.log); \
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment