Latex Makefile does not see changes in include files
I had a Makefile template to generate my latex documents, but there is an issue I don't understand...
My main latex file include other latex files located in ./includes/. The thing is whenever I make a modification in one of these files MAKE just don't see it and won't recompile.
The relevant part of the Makefile is this :
DOC ?= report.tex
PDF := $(DOC:.tex=.pdf)
INCLUDES ?=
IMG_DIRS ?= img
IMG_FILES := $(wildcard $(IMG_DIRS)/*.svg $(IMG_DIRS)/*.png)
IMG_EPS := $(patsubst %svg, %eps, $(patsubst %png, %eps, $(IMG_FILES)))
all: pdf
pdf: $(DOC) $(INCLUDES) $(BIBLIOS) $(STYLES) $(IMG_FILES) $(IMG_EPS) $(PDF)
%pdf: %tex
$(TEX) '$(PWD)/$<'
$(BIB) '$(PWD)/$(shell basename $(DOC) .tex)'
$(TEX) '$(PWD)/$<'
$(TEX) '$(PWD)/$<'
$(INCLUDES) is a dependency for the mane target so it should recompile. I have tried many configurations with the same result.
There is just som开发者_开发知识库ething I'm missing, thanks to enlighten me.
Your $(INCLUDES)
variable expands to nothing (it is empty). It should contain a list of files included by the .pdf.
The following initializes it with all .tex files from includes/
directory:
INCLUDES := $(wildcard includes/*.tex)
精彩评论