From 0ca98b1ba32b3145ac4e8e48d53c1f016c44808a Mon Sep 17 00:00:00 2001 From: Thomas Kolb Date: Sun, 2 Jul 2023 16:34:06 +0200 Subject: [PATCH] Makefile: add targets to build images from XZed logs --- Makefile | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/Makefile b/Makefile index 0d4404c..9b65601 100644 --- a/Makefile +++ b/Makefile @@ -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