From: j8takagi Date: Mon, 9 Dec 2013 00:52:52 +0000 (+0900) Subject: *.dファイルへ出力する$(COMPILES.tex)の内容を変更 X-Git-Url: https://j8takagi.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=523d69c6653033c2b1fadc25c8c81c6264446c16;p=makefiles.git *.dファイルへ出力する$(COMPILES.tex)の内容を変更 --- diff --git a/latex_mk/latex.mk b/latex_mk/latex.mk index 780e238..c04cadf 100644 --- a/latex_mk/latex.mk +++ b/latex_mk/latex.mk @@ -159,7 +159,7 @@ BIBDBre = $(eval BIBDB := \ $(ECHO) '# LaTeX Intermediate Files'; \ $(ECHO) '#'; \ $(ECHO) '# $$(COMPILE.tex) := $(LATEXCMD)'; \ - $(ECHO) '# $$(COMPILES.tex) := $(subst $(COMPILE.tex),$(LATEXCMD),$(COMPILES.tex))'; \ + $(ECHO) '# $$(COMPILES.tex) := $(subst $(EXITWARN),exit 1,$(subst $(EXITNOWARN),exit 0,$(subst $(COMPILE.tex),$(LATEXCMD),$(COMPILES.tex))))'; \ $(ECHO) '#'; \ $(ECHO) '$(BASE).dvi:: $(sort $(LATEXINTFILES_PREV) $(if $(BIBDB),$(BASE).bbl_prev))'; \ $(ECHO) ' @$$(COMPILE.tex)'; \ @@ -229,23 +229,29 @@ WARN_UNDEFREF := There were undefined references. CNT := 3 CNTMSG := $(LATEX) is run $(CNT) times, but there are still undefined references. +EXITNOWARN = \ + if test $$? -eq 1; then \ + exit 0; \ + else \ + exit $$?; \ + fi + +EXITWARN = \ + $(ECHO) "$(CNTMSG)" 1>&2; \ + $(SED) -n -e "/^LaTeX Warning:/,/^$$/p" $(BASE).log | \ + $(SED) -e "s/.*\s*line \([0-9]*\)\s*.*/$(BASE).tex:\1: &/" 1>&2; \ + exit 1 + COMPILES.tex = \ for i in `$(SEQ) 0 $(CNT)`; do \ if test $$i -lt $(CNT); then \ if $(GREP) -F "$(WARN_UNDEFREF)" $(BASE).log; then \ $(COMPILE.tex); \ else \ - if test $$? -eq 1; then \ - exit 0; \ - else \ - exit $$?; \ - fi \ + $(EXITNOWARN); \ fi; \ else \ - $(ECHO) "$(CNTMSG)"; \ - $(SED) -n -e "/^LaTeX Warning:/,/^$$/p" $(BASE).log | \ - $(SED) -e "s/.*\s*line \([0-9]*\)\s*.*/$(BASE).tex:\1: &/" 1>&2; \ - exit 1; \ + $(EXITWARN); \ fi; \ done;