summaryrefslogtreecommitdiff
path: root/main/component.mk
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2018-05-27 22:49:27 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2018-05-27 22:49:27 +0200
commit8bc4865669ae030f355d1bea29b32bf673565cf1 (patch)
tree667e01299e9181d8e9915557887f8090f6891feb /main/component.mk
parentf79851a748e0156f21025e2f5f3b21e7c1ce3ed9 (diff)
downloadmodern-esp-sandbox-8bc4865669ae030f355d1bea29b32bf673565cf1.tar.gz
modern-esp-sandbox-8bc4865669ae030f355d1bea29b32bf673565cf1.tar.bz2
modern-esp-sandbox-8bc4865669ae030f355d1bea29b32bf673565cf1.tar.xz
modern-esp-sandbox-8bc4865669ae030f355d1bea29b32bf673565cf1.zip
wip
Diffstat (limited to 'main/component.mk')
-rw-r--r--main/component.mk21
1 files changed, 13 insertions, 8 deletions
diff --git a/main/component.mk b/main/component.mk
index 500a63f..e102e7e 100644
--- a/main/component.mk
+++ b/main/component.mk
@@ -1,9 +1,14 @@
-
-ifdef WIFI_SSID
-CFLAGS += '-DWIFI_SSID="$(WIFI_SSID)"'
-CPPFLAGS += '-DWIFI_SSID="$(WIFI_SSID)"'
-endif
-ifdef WIFI_PASSWORD
-CFLAGS += '-DWIFI_PASSWORD="$(WIFI_PASSWORD)"'
-CPPFLAGS += '-DWIFI_PASSWORD="$(WIFI_PASSWORD)"'
+define FIX =
+ifdef $(1)
+CFLAGS += '-D$(1)="$$($(1))"'
+CPPFLAGS += '-D$(1)="$$($(1))"'
+#$$(info USING $(1)=$$($(1)))
endif
+endef
+
+$(eval $(call FIX,WIFI_SSID))
+$(eval $(call FIX,WIFI_PASSWORD))
+$(eval $(call FIX,MQTT_HOST))
+$(eval $(call FIX,MQTT_PORT))
+
+fix: