Makefile: add targets to build images from XZed logs

This commit is contained in:
Thomas Kolb 2023-07-02 16:34:06 +02:00
parent cb26f47e5f
commit 0ca98b1ba3

View file

@ -33,3 +33,25 @@ imgs/%-avg_pwr-highres.webp: logs/%.csv
./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, %-avg_pwr-fromxz.webp, $(SRCS_XZ))
IMGS2_XZ:=$(patsubst %.csv, %-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