]> ToastFreeware Gitweb - toast/airingbutler.git/blob - Makefile
Makefile: remove negative temperature values when creating log.csv
[toast/airingbutler.git] / Makefile
1 BOARD_TAG=uno
2
3 HOSTNAME=$(shell hostname)
4 ifeq ($(HOSTNAME),jadzia)
5 MONITOR_PORT=/dev/ttyACM1
6 else
7 MONITOR_PORT=/dev/ttyACM0
8 endif
9
10 # ARDUINO_SKETCHBOOK=~/sketchbook
11 include /usr/share/arduino/Arduino.mk
12
13 all: $(CURDIR)
14
15 # log is the result of
16 # annotate-output ./log_mhz19.py -d /dev/ttyACM3 | tee -a log
17 # and we want log.csv for plot_mhz19.py
18 log.csv: log
19         cp $< $@
20         fromdos $@
21         sed -i -e '/Started/ d' -e '/Finished/ d ' -e '/-[0-9]/ d' -e 's/ O: /,/g' $@
22         perl -ni -e 'BEGIN{$$i=0}; print if ($$_ !~ /CO2/ || $$i == 0); $$i++;' $@
23
24 STARTDATE=$(shell date "+%F" --date @$$(stat --format "%Y" $$(find -name "log-*.gz" | sort | tail -n 1)))
25 plot: log.csv
26         ./plot_mhz19.py --startdate $(STARTDATE) $<
27
28 .PHONY: log.csv plot