diff --git a/docs/Makefile b/docs/Makefile index 701157ee6..8be970391 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -250,6 +250,7 @@ test-macros: .PHONY: images images: $(MAKE) -C source/_images + $(MAKE) -C source/_images convert .PHONY: reqs reqs: diff --git a/docs/source/_images/Makefile b/docs/source/_images/Makefile index 955805f9c..26cc47284 100644 --- a/docs/source/_images/Makefile +++ b/docs/source/_images/Makefile @@ -8,24 +8,22 @@ FAKETIME := TZ='Z' faketime -f '2022-01-01 00:00:00 x0,001' CODE_EXAMPLES := ../code_examples/*/Makefile examples: $(CODE_EXAMPLES) -# target to convert specified dot file(s) +# target to convert all dot files +# needs to be run *after* examples, otherwise no dot files will be found .PHONY: convert -TARG_DOT ?= -convert: $(TARG_DOT:.dot=.pdf) $(TARG_DOT:.dot=.svg) +DOT_FILES := $(shell find . -name *.dot) +convert: $(DOT_FILES:.dot=.pdf) $(DOT_FILES:.dot=.svg) -# use empty FORCE target because .PHONY ignores % expansion, using find allows -# us to generate everything in one pass, since we don't know all of the possible -# outputs until the sub-makes run +# use empty FORCE target because .PHONY ignores % expansion FORCE: ../%/Makefile: FORCE @make -C $(@D) dots @mkdir -p $* - @find $(@D) -name *.dot -exec cp -u {} -t $* \; - @find $* -name *.dot -printf "%p " | xargs -i make --no-print-directory convert TARG_DOT="{}" + @find $(@D) -name *.dot -exec rsync -t {} $* \; # find and build all tex files .PHONY: all_tex -TEX_FILES := $(wildcard **/*.tex) +TEX_FILES := $(shell find . -name *.tex) all_tex: $(TEX_FILES:.tex=.pdf) $(TEX_FILES:.tex=.svg) %.pdf: %.dot