add RTC support
[julm/air-duino.git] / GNUmakefile
index 7ab4aaa794487d348a872aeaf687df387b67ba33..1e7b150b6d0f62bf98802e994139fb04de792a84 100644 (file)
@@ -22,13 +22,15 @@ all: $(views)
 
 SENSOR_LABEL_temperature=Température (°C)
 SENSOR_LABEL_humidity=Humidité (%)
-SENSOR_LABEL_particles=Particules
-SENSOR_LABEL_quality=Qualité de l’air
+SENSOR_LABEL_dust=Particules
+SENSOR_LABEL_air=Qualité de l’air
+SENSOR_LABEL_co_ch4_lpg=CO/CH4/LPG
 sensors := \
  temperature \
  humidity \
- quality \
- particles
+ air \
+ dust \
+ co_ch4_lpg
 
 #
 ## Round Robin Database (RRD)
@@ -54,11 +56,14 @@ ARDUINO_LIBS := \
  DustSensor \
  Humidity_Temperature_Sensor \
  LCD_Display9696 \
+ RTC \
  Wire
 
-USER_LIB_PATH := $(abspath ./libraries)
+USER_LIB_PATH := $(realpath ./libraries)
 
+ifeq ($(NO_INO),)
 include $(ARDMK_DIR)/Arduino.mk
+endif
 
 ino: $(TARGET_EEP) $(TARGET_HEX)
 
@@ -107,6 +112,15 @@ rrd/$(year)/$(month).rrd
         LINE1:$(sensor)'#ff0000':"$(sensor)";
 endef
 
+define view/year/month/png
+view/$(year)/$(month)/png: \
+$(foreach sensor,$(sensors), view/$(sensor)/$(year)/$(month)/png)
+endef
+define view/year/month/day/png
+view/$(year)/$(month)/$(day)/png: \
+$(foreach sensor,$(sensors), view/$(sensor)/$(year)/$(month)/$(day)/png)
+endef
+
 #
 ## HTML5
 ###
@@ -139,7 +153,7 @@ view/$(year)/$(month)/html5: \
 view/$(year)/$(month).html5
 
 view/$(year)/$(month).html5: \
-$(foreach sensor,$(sensors), view/$(sensor)/$(year)/$(month)/png)
+view/$(year)/$(month)/png
        mkdir -p $$(@D)
        printf ' \
        <report year="$(year)" month="$(month)"> \
@@ -156,12 +170,6 @@ $(foreach sensor,$(sensors), view/$(sensor)/$(year)/$(month)/png)
         xsl/year/month.html5.xsl -
 endef
 
-define view/sensor/year/month/day/html5
-#view/$(sensor)/$(year)/$(month)/$(day)/html5: \
-#view/$(sensor)/$(year)/$(month)/$(day).html5
-
-endef
-
 #
 ## Dates
 ###
@@ -188,7 +196,7 @@ $(call view/sensor/year/$(view))
 endef
 
 define foreach/year/month/sensor/view
-.PHONY:                       view/$(sensor)/$(year)/$(month)/$(view)
+.PHONY:                         view/$(sensor)/$(year)/$(month)/$(view)
 view/$(sensor)/$(year)/$(view): view/$(sensor)/$(year)/$(month)/$(view)
 $(call view/sensor/year/month/$(view))
 endef
@@ -199,10 +207,15 @@ $(call view/year/month/$(view))
 endef
 
 define foreach/year/month/day/sensor/view
-.PHONY:                                view/$(sensor)/$(year)/$(month)/$(day)/$(view)
+.PHONY:                                  view/$(sensor)/$(year)/$(month)/$(day)/$(view)
 view/$(sensor)/$(year)/$(month)/$(view): view/$(sensor)/$(year)/$(month)/$(day)/$(view)
 $(call view/sensor/year/month/day/$(view))
 endef
+define foreach/year/month/day/view
+.PHONY:                        view/$(year)/$(month)/$(day)/$(view)
+view/$(year)/$(month)/$(view): view/$(year)/$(month)/$(day)/$(view)
+$(call view/year/month/day/$(view))
+endef
 
 $(foreach sensor,$(sensors), \
        $(foreach view,$(views), \