38 lines
987 B
Makefile
38 lines
987 B
Makefile
PYTHON=python
|
|
|
|
SRCS:=$(wildcard logs/*.csv)
|
|
IMGS1:=$(patsubst %.csv, %-avg.webp, $(SRCS))
|
|
IMGS2:=$(patsubst %.csv, %-peak.webp, $(SRCS))
|
|
IMGS:=$(patsubst logs/%, imgs/%, $(IMGS1) $(IMGS2))
|
|
|
|
.PHONY: default
|
|
all: imgs/ $(IMGS)
|
|
|
|
imgs/:
|
|
mkdir -p $@
|
|
|
|
imgs/%-avg.webp: logs/%.csv
|
|
tmpfile=$$(mktemp /tmp/spec.XXXXX.png) && \
|
|
$(PYTHON) ./plot_wf.py avg 60 $< $$tmpfile && \
|
|
convert $$tmpfile -quality 100 $@ && \
|
|
rm $$tmpfile
|
|
|
|
imgs/%-peak.webp: logs/%.csv
|
|
tmpfile=$$(mktemp /tmp/spec.XXXXX.png) && \
|
|
$(PYTHON) ./plot_wf.py peak 60 $< $$tmpfile && \
|
|
convert $$tmpfile -quality 100 $@ && \
|
|
rm $$tmpfile
|
|
|
|
# high-resolution (in time) images, not generated by default
|
|
|
|
IMGS_HIGHRES:=$(patsubst %.csv, %-highres.webp, $(SRCS))
|
|
|
|
.PHONY: highres
|
|
highres: imgs/ $(IMGS_HIGHRES)
|
|
|
|
imgs/%-highres.webp: logs/%.csv
|
|
tmpfile=$$(mktemp /tmp/spec.XXXXX.png) && \
|
|
$(PYTHON) ./plot_wf.py avg 10 $< $$tmpfile && \
|
|
convert $$tmpfile -quality 100 $@ && \
|
|
rm $$tmpfile
|