SRCS:=$(wildcard logs/*.csv) IMGS1:=$(patsubst %.csv, %-avg_pwr.webp, $(SRCS)) IMGS2:=$(patsubst %.csv, %-peak.webp, $(SRCS)) IMGS:=$(patsubst logs/%, imgs/%, $(IMGS1) $(IMGS2)) .PHONY: default all: imgs/ $(IMGS) imgs/: mkdir -p $@ imgs/%-avg_pwr.webp: logs/%.csv tmpfile=$$(mktemp /tmp/spec.XXXXX.png) && \ ./plot_wf_longterm.py -a avg_pwr -r 60 -o $$tmpfile $< && \ convert $$tmpfile -quality 100 $@ && \ rm $$tmpfile imgs/%-peak.webp: logs/%.csv tmpfile=$$(mktemp /tmp/spec.XXXXX.png) && \ ./plot_wf_longterm.py -a peak -r 60 -o $$tmpfile $< && \ convert $$tmpfile -quality 100 $@ && \ rm $$tmpfile # high-resolution (in time) images, not generated by default IMGS_HIGHRES:=$(patsubst %.csv, %-avg_pwr-highres.webp, $(SRCS)) .PHONY: highres highres: imgs/ $(IMGS_HIGHRES) imgs/%-avg_pwr-highres.webp: logs/%.csv tmpfile=$$(mktemp /tmp/spec.XXXXX.png) && \ ./plot_wf_longterm.py -a avg_pwr -r 10 -o $$tmpfile $< && \ convert $$tmpfile -quality 100 $@ && \ rm $$tmpfile # Targets to re-build images from xz-ed logs SRCS_XZ:=$(wildcard logs/*.csv.xz) IMGS1_XZ:=$(patsubst %.csv.xz, %-avg_pwr-fromxz.webp, $(SRCS_XZ)) IMGS2_XZ:=$(patsubst %.csv.xz, %-peak-fromxz.webp, $(SRCS_XZ)) IMGS_XZ:=$(patsubst logs/%, imgs/%, $(IMGS1_XZ) $(IMGS2_XZ)) .PHONY: from_xz from_xz: imgs/ $(IMGS_XZ) imgs/%-avg_pwr-fromxz.webp: logs/%.csv.xz tmpfile=$$(mktemp /tmp/spec.XXXXX.png) && \ ./plot_wf_longterm.py -a avg_pwr -r 60 -o $$tmpfile $< && \ convert $$tmpfile -quality 100 $@ && \ rm $$tmpfile imgs/%-peak-fromxz.webp: logs/%.csv.xz tmpfile=$$(mktemp /tmp/spec.XXXXX.png) && \ ./plot_wf_longterm.py -a peak -r 60 -o $$tmpfile $< && \ convert $$tmpfile -quality 100 $@ && \ rm $$tmpfile