-# hyperrefパッケージ読み込みをTeXファイルから検索する
-hyperref = \
- $(shell \
- $(SED) -e '/^\s*%/d' -e 's/\([^\]\)\s*%.*/\1/g' $(BASE).tex $(intex) | \
- $(SED) -e '/\\begin{verbatim}/,/\\end{verbatim}/d' | \
- $(SED) -n -e 's/.*\(\\usepackage\(\[[^]]*\]\)\{0,1\}{hyperref}\)/\1/p'\
- )
-
-# $(BASE).texで使われるLaTeX中間ファイル
-INTERFILES = \
- $(strip \
- $(if $(toc),$(BASE).toc) \
- $(if $(lof),$(BASE).lof) \
- $(if $(lot),$(BASE).lot) \
- $(if $(makeindex),$(BASE).ind) \
- $(if $(bibdb),$(BASE).bbl) \
- $(if $(hyperref),$(BASE).out) \
- )
-
-INTERFILES_PREV = $(addsuffix _prev,$(INTERFILES))
-
-# \include命令で読み込まれるTeXファイル
-includetex = \
- $(strip $(addsuffix .tex,$(shell \
- $(SED) -e '/^\s*%/d' -e 's/\([^\]\)\s*%.*/\1/g' $(BASE).tex | \
- $(SED) -e '/\\begin{verbatim}/,/\\end{verbatim}/d' | \
- $(SED) -n -e 's/\\include\(\[[^]]*\]\)\{0,1\}{[^}]*}/&\n/pg' | \
- $(SED) -n -e 's/.*{\([^}]*\)}$$/\1/p' \
- )))
-
-# \input命令で読み込まれるTeXファイル
-define get_inputtex
- $(strip $(shell \
- $(SED) -e '/^\s*%/d' -e 's/\([^\]\)\s*%.*/\1/g' $1 | \
- $(SED) -e '/\\begin{verbatim}/,/\\end{verbatim}/d' | \
- $(SED) -n -e 's/\\input\(\[[^]]*\]\)\{0,1\}{[^}]*}/&\n/pg' | \
- $(SED) -n -e 's/.*{\([^}]*\)}$$/\1/p' \
- ))
-endef
-
-inputtex = $(call get_inputtex,$(BASE).tex $(includetex))
-
-# \include命令または\input命令で読み込まれるTeXファイル
-intex = $(strip $(includetex) $(inputtex))
-
-# \includegraphics命令で読み込まれるグラフィックファイル
-ingraphics = \
- $(strip $(shell \
- $(SED) -e '/^\s*%/d' -e 's/\([^\]\)\s*%.*/\1/g' $(BASE).tex $(intex) | \
- $(SED) -e '/\\begin{verbatim}/,/\\end{verbatim}/d' | \
- $(SED) -n -e 's/\\includegraphics\(\[[^]]*\]\)\{0,1\}{[^}]*}/&\n/pg' | \
- $(SED) -n -e 's/.*{\([^}]*\)}$$/\1/p' \
- ))
-