]> ToastFreeware Gitweb - toast/airingbutler.git/commitdiff
Makefile: add 'plot' target, passing startdate from last rotated log to plot_mhz19.py
authorgregor herrmann <gregor@toastfreeware.priv.at>
Thu, 9 Mar 2023 23:54:11 +0000 (00:54 +0100)
committergregor herrmann <gregor@toastfreeware.priv.at>
Thu, 9 Mar 2023 23:54:11 +0000 (00:54 +0100)
Makefile

index a7a2877c81ae5def525b24fe8ba68709f115d8d2..a067d2bbe917a8bad7edea3efbb8b718fac519b1 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -21,4 +21,8 @@ log.csv: log
        sed -i -e '/Started/ d' -e '/Finished/ d ' -e 's/ O: /,/g' $@
        perl -ni -e 'BEGIN{$$i=0}; print if ($$_ !~ /CO2/ || $$i == 0); $$i++;' $@
 
-.PHONY: log.csv
+STARTDATE=$(shell date "+%F" --date @$$(stat --format "%Y" $$(find -name "log-*.gz" | sort | tail -n 1)))
+plot: log.csv
+       ./plot_mhz19.py --startdate $(STARTDATE) $<
+
+.PHONY: log.csv plot