Commit 16513323 authored by Michael Eischer's avatar Michael Eischer
Browse files

Fix dependency on cache dir

The dependency on the cache dir only serves to ensure that the cache
directory exists. Using a normal dependency, however, causes make to
rerun every dependent task once any file in the directory has changed.
This usually causes lots of unnecessary rebuilds. Fix this by specifying
the cache directory as order-only dependency which avoids rebuilds due
to changed dependencies.
parent 85a0d339
Pipeline #30030 passed with stage
in 29 seconds
......@@ -35,19 +35,19 @@ clean::
mrproper:: clean
@rm -f $(PACKAGE_TGT) $(DOC_PDF) $(patsubst %.tex,%.pdfpc,$(wildcard $(DOC_DIR)/*.tex))
$(PACKAGE_TGT): $(wildcard $(PACKAGE_DIR)/*.ins) $(PACKAGE_SRC) $(CACHE_DIR)
$(PACKAGE_TGT): $(wildcard $(PACKAGE_DIR)/*.ins) $(PACKAGE_SRC) | $(CACHE_DIR)
@cd $(PACKAGE_DIR) && latex -output-directory=$(CACHE_DIR) $(notdir $<)
@cp $(addprefix $(CACHE_DIR)/,$(PACKAGE_STY)) $(LOCAL_DIR)/
$(CACHE_DIR):; @mkdir -p $(CACHE_DIR)
%_handout.pdf: %.tex $(wildcard *.bib) $(PACKAGE_TGT) $(CACHE_DIR)
%_handout.pdf: %.tex $(wildcard *.bib) $(PACKAGE_TGT) | $(CACHE_DIR)
@cd $(dir $< ) && $(COMPILE_TEX) -jobname=$*_handout $(notdir $<)
@cp $(CACHE_DIR)/$(notdir $@) $@
@cp $(CACHE_DIR)/$(notdir $*_handout.synctex.gz) $*_handout.synctex.gz
@test ! -f $@pc -a -f $(CACHE_DIR)/$(notdir $@)pc && ( /bin/echo "[file]"; /bin/echo "$@"; /bin/echo "[font_size]"; /bin/echo "$(PDFPC_SIZE)"; cat $(CACHE_DIR)/$(notdir $@)pc | sed 's/\\\\/\n/g' | sed 's/\\par/\n\n/g' ) > $@pc || echo "ignoring PDFPC file" && exit 0
%.pdf: %.tex $(wildcard *.bib) $(PACKAGE_TGT) $(CACHE_DIR)
%.pdf: %.tex $(wildcard *.bib) $(PACKAGE_TGT) | $(CACHE_DIR)
@cd $(dir $< ) && $(COMPILE_TEX) $(notdir $<)
@cp $(CACHE_DIR)/$(notdir $@) $@
@cp $(CACHE_DIR)/$(notdir $*.synctex.gz) $*.synctex.gz
......@@ -56,7 +56,7 @@ $(CACHE_DIR):; @mkdir -p $(CACHE_DIR)
%.tex: %.md $(PANDOC_TEMPLATE)
pandoc $< --natbib --slide-level=2 --to=beamer --template="$(PANDOC_TEMPLATE)" --to=beamer | sed -e "s/\\\\citep{/\\\\cite{/g" > $@
preview-%: %.tex $(wildcard *.bib) $(PACKAGE_TGT) $(CACHE_DIR)
preview-%: %.tex $(wildcard *.bib) $(PACKAGE_TGT) | $(CACHE_DIR)
@cd $(dir $< ) && $(COMPILE_TEX) $(notdir $<) -pvc -interaction=nonstopmode -view=pdf
pdfpc-%: %.pdf
......
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