From 5b0675584cf8e0bd5b1c6da7d0bff5425928a72a Mon Sep 17 00:00:00 2001 From: "Sergio R. Caprile" Date: Wed, 11 Nov 2026 17:48:03 -0300 Subject: [PATCH] Remove symlinks --- test/arduino/Makefile | 39 ++++++++++++++++--- tutorials/arduino/esp32-http/mongoose.c | 1 - tutorials/arduino/esp32-http/mongoose.h | 1 - tutorials/arduino/esp32-mqtt/mongoose.c | 1 - tutorials/arduino/esp32-mqtt/mongoose.h | 1 - tutorials/arduino/nano-w5500-mqtt/mongoose.c | 1 - tutorials/arduino/nano-w5500-mqtt/mongoose.h | 1 - tutorials/arduino/sim800-mqtt/mongoose.c | 1 - tutorials/arduino/sim800-mqtt/mongoose.h | 1 - tutorials/arduino/teensy41-http/mongoose.c | 1 - tutorials/arduino/teensy41-http/mongoose.h | 1 - tutorials/arduino/teensy41-http/net.c | 1 - tutorials/arduino/teensy41-http/net.h | 1 - tutorials/arduino/teensy41-http/packed_fs.c | 1 - tutorials/arduino/w5500-http/mongoose.c | 1 - tutorials/arduino/w5500-http/mongoose.h | 1 - tutorials/arduino/w5500-mqtt/mongoose.c | 1 - tutorials/arduino/w5500-mqtt/mongoose.h | 1 - tutorials/core/embedded-filesystem/Makefile | 5 ++- tutorials/core/embedded-filesystem/mongoose.c | 1 - tutorials/core/embedded-filesystem/mongoose.h | 1 - tutorials/core/memory/o1heap/Makefile | 5 ++- tutorials/core/memory/o1heap/mongoose.c | 1 - tutorials/core/memory/o1heap/mongoose.h | 1 - tutorials/core/multi-threaded-12m/Makefile | 5 ++- tutorials/core/multi-threaded-12m/mongoose.c | 1 - tutorials/core/multi-threaded-12m/mongoose.h | 1 - tutorials/core/multi-threaded/Makefile | 5 ++- tutorials/core/multi-threaded/mongoose.c | 1 - tutorials/core/multi-threaded/mongoose.h | 1 - tutorials/core/timers/Makefile | 5 ++- tutorials/core/timers/mongoose.c | 1 - tutorials/core/timers/mongoose.h | 1 - tutorials/esp32/device-dashboard/Makefile | 12 +++++- .../device-dashboard/main/CMakeLists.txt | 4 +- .../esp32/device-dashboard/main/mongoose.c | 1 - .../esp32/device-dashboard/main/mongoose.h | 1 - tutorials/esp32/device-dashboard/main/net.c | 1 - tutorials/esp32/device-dashboard/main/net.h | 1 - .../esp32/device-dashboard/main/packed_fs.c | 1 - tutorials/esp32/uart-bridge/Makefile | 10 ++++- .../esp32/uart-bridge/main/CMakeLists.txt | 4 +- tutorials/esp32/uart-bridge/main/mongoose.c | 1 - tutorials/esp32/uart-bridge/main/mongoose.h | 1 - tutorials/esp32/uart-bridge/main/net.c | 1 - tutorials/esp32/uart-bridge/main/packed_fs.c | 1 - tutorials/http/device-dashboard/Makefile | 4 +- tutorials/http/device-dashboard/pack.js | 1 - tutorials/http/http-client/Makefile | 8 +++- tutorials/http/http-client/certs/ca.pem | 1 - tutorials/http/http-proxy-client/Makefile | 5 ++- tutorials/http/http-proxy-client/packed_fs.c | 1 - tutorials/http/http-reverse-proxy/Makefile | 5 ++- tutorials/http/http-reverse-proxy/packed_fs.c | 1 - tutorials/http/http-server/Makefile | 12 +++++- tutorials/http/http-server/certs | 1 - tutorials/http/http-streaming-client/Makefile | 5 ++- .../http/http-streaming-client/packed_fs.c | 1 - tutorials/http/wifi-router-dashboard/Makefile | 19 ++++++--- tutorials/http/wifi-router-dashboard/pack.js | 1 - .../wifi-router-dashboard/web_root/bundle.js | 1 - .../web_root/components.js | 1 - .../web_root/history.min.js | 1 - .../wifi-router-dashboard/web_root/index.html | 1 - .../same54-xpro/device-dashboard/Makefile | 16 ++++++-- .../same54-xpro/device-dashboard/mongoose.c | 1 - .../same54-xpro/device-dashboard/mongoose.h | 1 - .../same54-xpro/device-dashboard/net.c | 1 - .../same54-xpro/device-dashboard/net.h | 1 - .../same54-xpro/device-dashboard/packed_fs.c | 1 - .../same54-xpro/mqtt-client/Makefile | 5 ++- .../same54-xpro/mqtt-client/mongoose.c | 1 - .../same54-xpro/mqtt-client/mongoose.h | 1 - tutorials/micropython/esp32/Makefile | 2 +- .../esp32/mongoose/micropython.cmake | 1 - .../micropython/esp32/mongoose/micropython.mk | 1 - tutorials/micropython/esp32/mongoose/module.c | 1 - .../micropython/esp32/mongoose/mongoose.c | 1 - .../micropython/esp32/mongoose/mongoose.h | 1 - .../micropython/mongoose/micropython.cmake | 3 +- tutorials/micropython/mongoose/micropython.mk | 4 +- tutorials/micropython/mongoose/mongoose.c | 1 - tutorials/micropython/mongoose/mongoose.h | 1 - tutorials/mqtt/mqtt-over-ws-client/Makefile | 5 ++- .../mqtt/mqtt-over-ws-client/packed_fs.c | 1 - tutorials/nxp/teensy-4.1/arduino/mongoose.c | 1 - tutorials/nxp/teensy-4.1/arduino/mongoose.h | 1 - .../ek-ra6m4-make-baremetal-builtin/Makefile | 16 ++++++-- .../mongoose.c | 1 - .../mongoose.h | 1 - .../ek-ra6m4-make-baremetal-builtin/net.c | 1 - .../ek-ra6m4-make-baremetal-builtin/net.h | 1 - .../packed_fs.c | 1 - tutorials/rp/pico-rndis-device/Makefile | 10 ++++- tutorials/rp/pico-rndis-device/net.c | 1 - tutorials/rp/pico-rndis-device/net.h | 1 - tutorials/smtp/smtp-client/Makefile | 5 ++- tutorials/smtp/smtp-client/packed_fs.c | 1 - tutorials/tcp/modbus-dashboard/Makefile | 14 +++++-- tutorials/tcp/modbus-dashboard/certs | 1 - tutorials/tcp/modbus-dashboard/pack.js | 1 - tutorials/tcp/tcp/Makefile | 16 +++++++- tutorials/tcp/tcp/certs/ss_ca.pem | 1 - tutorials/tcp/tcp/certs/ss_client.pem | 1 - tutorials/tcp/tcp/certs/ss_server.pem | 1 - tutorials/tcp/uart-bridge | 1 - tutorials/tcpip/pcap-driver/Makefile | 5 ++- tutorials/tcpip/pcap-driver/mongoose.c | 1 - tutorials/tcpip/pcap-driver/mongoose.h | 1 - tutorials/tcpip/tap-driver/Makefile | 16 ++++++-- tutorials/tcpip/tap-driver/mongoose.c | 1 - tutorials/tcpip/tap-driver/mongoose.h | 1 - tutorials/tcpip/tap-driver/net.c | 1 - tutorials/tcpip/tap-driver/net.h | 1 - tutorials/tcpip/tap-driver/packed_fs.c | 1 - .../Makefile | 5 ++- .../mongoose.c | 1 - .../mongoose.h | 1 - .../ch32v307-make-baremetal-builtin/Makefile | 15 +++++-- .../mongoose.c | 1 - .../mongoose.h | 1 - .../wch/ch32v307-make-baremetal-builtin/net.c | 1 - .../wch/ch32v307-make-baremetal-builtin/net.h | 1 - .../packed_fs.c | 1 - tutorials/websocket/uart-bridge | 1 - tutorials/webui/webui-preact/Makefile | 5 ++- tutorials/webui/webui-preact/main.c | 1 - tutorials/zephyr/device-dashboard/README.md | 16 +++++++- tutorials/zephyr/http-client/README.md | 16 +++++++- tutorials/zephyr/http-server/README.md | 16 +++++++- tutorials/zephyr/mqtt-aws-client/README.md | 16 +++++++- tutorials/zephyr/websocket-server/README.md | 16 +++++++- 132 files changed, 303 insertions(+), 165 deletions(-) delete mode 120000 tutorials/arduino/esp32-http/mongoose.c delete mode 120000 tutorials/arduino/esp32-http/mongoose.h delete mode 120000 tutorials/arduino/esp32-mqtt/mongoose.c delete mode 120000 tutorials/arduino/esp32-mqtt/mongoose.h delete mode 120000 tutorials/arduino/nano-w5500-mqtt/mongoose.c delete mode 120000 tutorials/arduino/nano-w5500-mqtt/mongoose.h delete mode 120000 tutorials/arduino/sim800-mqtt/mongoose.c delete mode 120000 tutorials/arduino/sim800-mqtt/mongoose.h delete mode 120000 tutorials/arduino/teensy41-http/mongoose.c delete mode 120000 tutorials/arduino/teensy41-http/mongoose.h delete mode 120000 tutorials/arduino/teensy41-http/net.c delete mode 120000 tutorials/arduino/teensy41-http/net.h delete mode 120000 tutorials/arduino/teensy41-http/packed_fs.c delete mode 120000 tutorials/arduino/w5500-http/mongoose.c delete mode 120000 tutorials/arduino/w5500-http/mongoose.h delete mode 120000 tutorials/arduino/w5500-mqtt/mongoose.c delete mode 120000 tutorials/arduino/w5500-mqtt/mongoose.h delete mode 120000 tutorials/core/embedded-filesystem/mongoose.c delete mode 120000 tutorials/core/embedded-filesystem/mongoose.h delete mode 120000 tutorials/core/memory/o1heap/mongoose.c delete mode 120000 tutorials/core/memory/o1heap/mongoose.h delete mode 120000 tutorials/core/multi-threaded-12m/mongoose.c delete mode 120000 tutorials/core/multi-threaded-12m/mongoose.h delete mode 120000 tutorials/core/multi-threaded/mongoose.c delete mode 120000 tutorials/core/multi-threaded/mongoose.h delete mode 120000 tutorials/core/timers/mongoose.c delete mode 120000 tutorials/core/timers/mongoose.h delete mode 120000 tutorials/esp32/device-dashboard/main/mongoose.c delete mode 120000 tutorials/esp32/device-dashboard/main/mongoose.h delete mode 120000 tutorials/esp32/device-dashboard/main/net.c delete mode 120000 tutorials/esp32/device-dashboard/main/net.h delete mode 120000 tutorials/esp32/device-dashboard/main/packed_fs.c delete mode 120000 tutorials/esp32/uart-bridge/main/mongoose.c delete mode 120000 tutorials/esp32/uart-bridge/main/mongoose.h delete mode 120000 tutorials/esp32/uart-bridge/main/net.c delete mode 120000 tutorials/esp32/uart-bridge/main/packed_fs.c delete mode 120000 tutorials/http/device-dashboard/pack.js delete mode 120000 tutorials/http/http-client/certs/ca.pem delete mode 120000 tutorials/http/http-proxy-client/packed_fs.c delete mode 120000 tutorials/http/http-reverse-proxy/packed_fs.c delete mode 120000 tutorials/http/http-server/certs delete mode 120000 tutorials/http/http-streaming-client/packed_fs.c delete mode 120000 tutorials/http/wifi-router-dashboard/pack.js delete mode 120000 tutorials/http/wifi-router-dashboard/web_root/bundle.js delete mode 120000 tutorials/http/wifi-router-dashboard/web_root/components.js delete mode 120000 tutorials/http/wifi-router-dashboard/web_root/history.min.js delete mode 120000 tutorials/http/wifi-router-dashboard/web_root/index.html delete mode 120000 tutorials/microchip/same54-xpro/device-dashboard/mongoose.c delete mode 120000 tutorials/microchip/same54-xpro/device-dashboard/mongoose.h delete mode 120000 tutorials/microchip/same54-xpro/device-dashboard/net.c delete mode 120000 tutorials/microchip/same54-xpro/device-dashboard/net.h delete mode 120000 tutorials/microchip/same54-xpro/device-dashboard/packed_fs.c delete mode 120000 tutorials/microchip/same54-xpro/mqtt-client/mongoose.c delete mode 120000 tutorials/microchip/same54-xpro/mqtt-client/mongoose.h delete mode 120000 tutorials/micropython/esp32/mongoose/micropython.cmake delete mode 120000 tutorials/micropython/esp32/mongoose/micropython.mk delete mode 120000 tutorials/micropython/esp32/mongoose/module.c delete mode 120000 tutorials/micropython/esp32/mongoose/mongoose.c delete mode 120000 tutorials/micropython/esp32/mongoose/mongoose.h delete mode 120000 tutorials/micropython/mongoose/mongoose.c delete mode 120000 tutorials/micropython/mongoose/mongoose.h delete mode 120000 tutorials/mqtt/mqtt-over-ws-client/packed_fs.c delete mode 120000 tutorials/nxp/teensy-4.1/arduino/mongoose.c delete mode 120000 tutorials/nxp/teensy-4.1/arduino/mongoose.h delete mode 120000 tutorials/renesas/ek-ra6m4-make-baremetal-builtin/mongoose.c delete mode 120000 tutorials/renesas/ek-ra6m4-make-baremetal-builtin/mongoose.h delete mode 120000 tutorials/renesas/ek-ra6m4-make-baremetal-builtin/net.c delete mode 120000 tutorials/renesas/ek-ra6m4-make-baremetal-builtin/net.h delete mode 120000 tutorials/renesas/ek-ra6m4-make-baremetal-builtin/packed_fs.c delete mode 120000 tutorials/rp/pico-rndis-device/net.c delete mode 120000 tutorials/rp/pico-rndis-device/net.h delete mode 120000 tutorials/smtp/smtp-client/packed_fs.c delete mode 120000 tutorials/tcp/modbus-dashboard/certs delete mode 120000 tutorials/tcp/modbus-dashboard/pack.js delete mode 120000 tutorials/tcp/tcp/certs/ss_ca.pem delete mode 120000 tutorials/tcp/tcp/certs/ss_client.pem delete mode 120000 tutorials/tcp/tcp/certs/ss_server.pem delete mode 120000 tutorials/tcp/uart-bridge delete mode 120000 tutorials/tcpip/pcap-driver/mongoose.c delete mode 120000 tutorials/tcpip/pcap-driver/mongoose.h delete mode 120000 tutorials/tcpip/tap-driver/mongoose.c delete mode 120000 tutorials/tcpip/tap-driver/mongoose.h delete mode 120000 tutorials/tcpip/tap-driver/net.c delete mode 120000 tutorials/tcpip/tap-driver/net.h delete mode 120000 tutorials/tcpip/tap-driver/packed_fs.c delete mode 120000 tutorials/ti/ek-tm4c1294xl-make-baremetal-builtin-rndis/mongoose.c delete mode 120000 tutorials/ti/ek-tm4c1294xl-make-baremetal-builtin-rndis/mongoose.h delete mode 120000 tutorials/wch/ch32v307-make-baremetal-builtin/mongoose.c delete mode 120000 tutorials/wch/ch32v307-make-baremetal-builtin/mongoose.h delete mode 120000 tutorials/wch/ch32v307-make-baremetal-builtin/net.c delete mode 120000 tutorials/wch/ch32v307-make-baremetal-builtin/net.h delete mode 120000 tutorials/wch/ch32v307-make-baremetal-builtin/packed_fs.c delete mode 120000 tutorials/websocket/uart-bridge delete mode 120000 tutorials/webui/webui-preact/main.c mode change 120000 => 100644 tutorials/zephyr/device-dashboard/README.md mode change 120000 => 100644 tutorials/zephyr/http-client/README.md mode change 120000 => 100644 tutorials/zephyr/http-server/README.md mode change 120000 => 100644 tutorials/zephyr/mqtt-aws-client/README.md mode change 120000 => 100644 tutorials/zephyr/websocket-server/README.md diff --git a/test/arduino/Makefile b/test/arduino/Makefile index fc2ef8f5..2d37cfd0 100644 --- a/test/arduino/Makefile +++ b/test/arduino/Makefile @@ -3,10 +3,39 @@ PROJECTS ?= seeeduino-xiao esp32 ROOT ?= $(realpath $(CURDIR)/../..) ARD ?= $(realpath $(CURDIR)) +MONGOOSE_C = $(ROOT)/tutorials/arduino/esp32-http/mongoose.c \ + $(ROOT)/tutorials/arduino/esp32-mqtt/mongoose.c \ + $(ROOT)/tutorials/arduino/nano-w5500-mqtt/mongoose.c \ + $(ROOT)/tutorials/arduino/sim800-mqtt/mongoose.c \ + $(ROOT)/tutorials/arduino/teensy41-http/mongoose.c \ + $(ROOT)/tutorials/arduino/w5500-http/mongoose.c \ + $(ROOT)/tutorials/arduino/w5500-mqtt/mongoose.c \ + $(ROOT)/tutorials/nxp/teensy-4.1/arduino/mongoose.c +MONGOOSE_H = $(MONGOOSE_C:.c=.h) +TEENSY_FILES = $(ROOT)/tutorials/arduino/teensy41-http/net.c $(ROOT)/tutorials/arduino/teensy41-http/net.h $(ROOT)/tutorials/arduino/teensy41-http/packed_fs.c all: $(PROJECTS) echo +prepare: $(MONGOOSE_C) $(MONGOOSE_H) $(TEENSY_FILES) + +.PHONY: prepare + +$(MONGOOSE_C): $(ROOT)/mongoose.c + cp $< $@ + +$(MONGOOSE_H): $(ROOT)/mongoose.h + cp $< $@ + +$(ROOT)/tutorials/arduino/teensy41-http/net.c: $(ROOT)/tutorials/http/device-dashboard/net.c $(ROOT)/tutorials/arduino/teensy41-http/net.h + cp $< $@ + +$(ROOT)/tutorials/arduino/teensy41-http/net.h: $(ROOT)/tutorials/http/device-dashboard/net.h + cp $< $@ + +$(ROOT)/tutorials/arduino/teensy41-http/packed_fs.c: $(ROOT)/tutorials/http/device-dashboard/packed_fs.c + cp $< $@ + arduino: ENV = -v $(CWD):/root arduino: curl -sL http://downloads.arduino.cc/arduino-1.8.19-linux64.tar.xz | unxz | tar -xf - @@ -28,26 +57,26 @@ teensy-board: ./arduino/arduino --install-boards teensy:avr touch teensy-board -seeeduino-xiao: arduino seeeduino-xiao-board +seeeduino-xiao: prepare arduino seeeduino-xiao-board cd $(ROOT)/tutorials/arduino/sim800-mqtt && $(ARD)/arduino/arduino --verbose --verify --board Seeeduino:samd:seeed_XIAO_m0 sim800-mqtt.ino cd $(ROOT)/tutorials/arduino/w5500-http && $(ARD)/arduino/arduino --verbose --verify --board Seeeduino:samd:seeed_XIAO_m0 w5500-http.ino cd $(ROOT)/tutorials/arduino/w5500-mqtt && $(ARD)/arduino/arduino --verbose --verify --board Seeeduino:samd:seeed_XIAO_m0 w5500-mqtt.ino -arduino-nano: arduino +arduino-nano: prepare arduino cd $(ROOT)/tutorials/arduino/nano-w5500-mqtt && $(ARD)/arduino/arduino --pref compiler.cpp.extra_flags=-DMG_ENABLE_LOG=0 --verbose --verify --board arduino:avr:nano nano-w5500-mqtt.ino -esp32: arduino esp32-board +esp32: prepare arduino esp32-board cd $(ROOT)/tutorials/arduino/esp32-mqtt && $(ARD)/arduino/arduino --verbose --verify --board esp32:esp32:node32s esp32-mqtt.ino # Needs a board with 'LED_BUILTIN', yet somehow invocation is missing that definition (lack of include somehow amended by the IDE) #cd $(ROOT)/tutorials/arduino/esp32-http && $(ARD)/arduino/arduino --verbose --verify --board esp32:esp32:esp32 esp32-http.ino -teensy41: arduino teensy-board +teensy41: prepare arduino teensy-board cd $(ROOT)/tutorials/arduino/teensy41-http && $(ARD)/arduino/arduino --verbose --verify --board teensy41-http.ino clean: - rm -rf arduino + rm -rf arduino $(MONGOOSE_C) $(MONGOOSE_H) $(TEENSY_FILES) # Board support gets installed in your home dir. # We fool make satisfying a dependency using touch above, otherwise board installation fails as it is already installed diff --git a/tutorials/arduino/esp32-http/mongoose.c b/tutorials/arduino/esp32-http/mongoose.c deleted file mode 120000 index 5e522bbc..00000000 --- a/tutorials/arduino/esp32-http/mongoose.c +++ /dev/null @@ -1 +0,0 @@ -../../../mongoose.c \ No newline at end of file diff --git a/tutorials/arduino/esp32-http/mongoose.h b/tutorials/arduino/esp32-http/mongoose.h deleted file mode 120000 index ee4ac823..00000000 --- a/tutorials/arduino/esp32-http/mongoose.h +++ /dev/null @@ -1 +0,0 @@ -../../../mongoose.h \ No newline at end of file diff --git a/tutorials/arduino/esp32-mqtt/mongoose.c b/tutorials/arduino/esp32-mqtt/mongoose.c deleted file mode 120000 index 5e522bbc..00000000 --- a/tutorials/arduino/esp32-mqtt/mongoose.c +++ /dev/null @@ -1 +0,0 @@ -../../../mongoose.c \ No newline at end of file diff --git a/tutorials/arduino/esp32-mqtt/mongoose.h b/tutorials/arduino/esp32-mqtt/mongoose.h deleted file mode 120000 index ee4ac823..00000000 --- a/tutorials/arduino/esp32-mqtt/mongoose.h +++ /dev/null @@ -1 +0,0 @@ -../../../mongoose.h \ No newline at end of file diff --git a/tutorials/arduino/nano-w5500-mqtt/mongoose.c b/tutorials/arduino/nano-w5500-mqtt/mongoose.c deleted file mode 120000 index 5e522bbc..00000000 --- a/tutorials/arduino/nano-w5500-mqtt/mongoose.c +++ /dev/null @@ -1 +0,0 @@ -../../../mongoose.c \ No newline at end of file diff --git a/tutorials/arduino/nano-w5500-mqtt/mongoose.h b/tutorials/arduino/nano-w5500-mqtt/mongoose.h deleted file mode 120000 index ee4ac823..00000000 --- a/tutorials/arduino/nano-w5500-mqtt/mongoose.h +++ /dev/null @@ -1 +0,0 @@ -../../../mongoose.h \ No newline at end of file diff --git a/tutorials/arduino/sim800-mqtt/mongoose.c b/tutorials/arduino/sim800-mqtt/mongoose.c deleted file mode 120000 index 5e522bbc..00000000 --- a/tutorials/arduino/sim800-mqtt/mongoose.c +++ /dev/null @@ -1 +0,0 @@ -../../../mongoose.c \ No newline at end of file diff --git a/tutorials/arduino/sim800-mqtt/mongoose.h b/tutorials/arduino/sim800-mqtt/mongoose.h deleted file mode 120000 index ee4ac823..00000000 --- a/tutorials/arduino/sim800-mqtt/mongoose.h +++ /dev/null @@ -1 +0,0 @@ -../../../mongoose.h \ No newline at end of file diff --git a/tutorials/arduino/teensy41-http/mongoose.c b/tutorials/arduino/teensy41-http/mongoose.c deleted file mode 120000 index 5e522bbc..00000000 --- a/tutorials/arduino/teensy41-http/mongoose.c +++ /dev/null @@ -1 +0,0 @@ -../../../mongoose.c \ No newline at end of file diff --git a/tutorials/arduino/teensy41-http/mongoose.h b/tutorials/arduino/teensy41-http/mongoose.h deleted file mode 120000 index ee4ac823..00000000 --- a/tutorials/arduino/teensy41-http/mongoose.h +++ /dev/null @@ -1 +0,0 @@ -../../../mongoose.h \ No newline at end of file diff --git a/tutorials/arduino/teensy41-http/net.c b/tutorials/arduino/teensy41-http/net.c deleted file mode 120000 index d40995ff..00000000 --- a/tutorials/arduino/teensy41-http/net.c +++ /dev/null @@ -1 +0,0 @@ -../../http/device-dashboard/net.c \ No newline at end of file diff --git a/tutorials/arduino/teensy41-http/net.h b/tutorials/arduino/teensy41-http/net.h deleted file mode 120000 index 290e3068..00000000 --- a/tutorials/arduino/teensy41-http/net.h +++ /dev/null @@ -1 +0,0 @@ -../../http/device-dashboard/net.h \ No newline at end of file diff --git a/tutorials/arduino/teensy41-http/packed_fs.c b/tutorials/arduino/teensy41-http/packed_fs.c deleted file mode 120000 index 41f8c7d9..00000000 --- a/tutorials/arduino/teensy41-http/packed_fs.c +++ /dev/null @@ -1 +0,0 @@ -../../http/device-dashboard/packed_fs.c \ No newline at end of file diff --git a/tutorials/arduino/w5500-http/mongoose.c b/tutorials/arduino/w5500-http/mongoose.c deleted file mode 120000 index 5e522bbc..00000000 --- a/tutorials/arduino/w5500-http/mongoose.c +++ /dev/null @@ -1 +0,0 @@ -../../../mongoose.c \ No newline at end of file diff --git a/tutorials/arduino/w5500-http/mongoose.h b/tutorials/arduino/w5500-http/mongoose.h deleted file mode 120000 index ee4ac823..00000000 --- a/tutorials/arduino/w5500-http/mongoose.h +++ /dev/null @@ -1 +0,0 @@ -../../../mongoose.h \ No newline at end of file diff --git a/tutorials/arduino/w5500-mqtt/mongoose.c b/tutorials/arduino/w5500-mqtt/mongoose.c deleted file mode 120000 index 5e522bbc..00000000 --- a/tutorials/arduino/w5500-mqtt/mongoose.c +++ /dev/null @@ -1 +0,0 @@ -../../../mongoose.c \ No newline at end of file diff --git a/tutorials/arduino/w5500-mqtt/mongoose.h b/tutorials/arduino/w5500-mqtt/mongoose.h deleted file mode 120000 index ee4ac823..00000000 --- a/tutorials/arduino/w5500-mqtt/mongoose.h +++ /dev/null @@ -1 +0,0 @@ -../../../mongoose.h \ No newline at end of file diff --git a/tutorials/core/embedded-filesystem/Makefile b/tutorials/core/embedded-filesystem/Makefile index 197d3166..3fa75e89 100644 --- a/tutorials/core/embedded-filesystem/Makefile +++ b/tutorials/core/embedded-filesystem/Makefile @@ -1,8 +1,9 @@ PROG ?= example # Program we are building DELETE = rm -rf # Command to remove files OUT ?= -o $(PROG) # Compiler argument for output file -SOURCES = main.c mongoose.c packed_fs.c # Source code files -CFLAGS = -W -Wall -Wextra -g -I. # Build options +REPO_ROOT ?= ../../.. +SOURCES = main.c $(REPO_ROOT)/mongoose.c packed_fs.c # Source code files +CFLAGS = -I$(REPO_ROOT) -W -Wall -Wextra -g -I. # Build options PACK = ./pack # Utility to pack files into a packed filesystem # Mongoose build options. See https://mongoose.ws/docs/getting-started/build-environment/ diff --git a/tutorials/core/embedded-filesystem/mongoose.c b/tutorials/core/embedded-filesystem/mongoose.c deleted file mode 120000 index 5e522bbc..00000000 --- a/tutorials/core/embedded-filesystem/mongoose.c +++ /dev/null @@ -1 +0,0 @@ -../../../mongoose.c \ No newline at end of file diff --git a/tutorials/core/embedded-filesystem/mongoose.h b/tutorials/core/embedded-filesystem/mongoose.h deleted file mode 120000 index ee4ac823..00000000 --- a/tutorials/core/embedded-filesystem/mongoose.h +++ /dev/null @@ -1 +0,0 @@ -../../../mongoose.h \ No newline at end of file diff --git a/tutorials/core/memory/o1heap/Makefile b/tutorials/core/memory/o1heap/Makefile index 017b89ff..08012d70 100644 --- a/tutorials/core/memory/o1heap/Makefile +++ b/tutorials/core/memory/o1heap/Makefile @@ -1,5 +1,6 @@ -SOURCES = main.c mongoose.c # Source code files -CFLAGS = -W -Wall -Wextra -g -I. # Build options +REPO_ROOT ?= ../../../.. +SOURCES = main.c $(REPO_ROOT)/mongoose.c # Source code files +CFLAGS = -I$(REPO_ROOT) -W -Wall -Wextra -g -I. # Build options # O(1) Heap SOURCES += o1heap/o1heap/o1heap.c diff --git a/tutorials/core/memory/o1heap/mongoose.c b/tutorials/core/memory/o1heap/mongoose.c deleted file mode 120000 index 7a2752cb..00000000 --- a/tutorials/core/memory/o1heap/mongoose.c +++ /dev/null @@ -1 +0,0 @@ -../../../../mongoose.c \ No newline at end of file diff --git a/tutorials/core/memory/o1heap/mongoose.h b/tutorials/core/memory/o1heap/mongoose.h deleted file mode 120000 index daff1633..00000000 --- a/tutorials/core/memory/o1heap/mongoose.h +++ /dev/null @@ -1 +0,0 @@ -../../../../mongoose.h \ No newline at end of file diff --git a/tutorials/core/multi-threaded-12m/Makefile b/tutorials/core/multi-threaded-12m/Makefile index a1988d2f..5f346151 100644 --- a/tutorials/core/multi-threaded-12m/Makefile +++ b/tutorials/core/multi-threaded-12m/Makefile @@ -1,5 +1,6 @@ -SOURCES = main.c mongoose.c # Source code files -CFLAGS = -W -Wall -Wextra -g -I. # Build options +REPO_ROOT ?= ../../.. +SOURCES = main.c $(REPO_ROOT)/mongoose.c # Source code files +CFLAGS = -I$(REPO_ROOT) -W -Wall -Wextra -g -I. # Build options # Mongoose build options. See https://mongoose.ws/docs/getting-started/build-environment/ CFLAGS_MONGOOSE += diff --git a/tutorials/core/multi-threaded-12m/mongoose.c b/tutorials/core/multi-threaded-12m/mongoose.c deleted file mode 120000 index 5e522bbc..00000000 --- a/tutorials/core/multi-threaded-12m/mongoose.c +++ /dev/null @@ -1 +0,0 @@ -../../../mongoose.c \ No newline at end of file diff --git a/tutorials/core/multi-threaded-12m/mongoose.h b/tutorials/core/multi-threaded-12m/mongoose.h deleted file mode 120000 index ee4ac823..00000000 --- a/tutorials/core/multi-threaded-12m/mongoose.h +++ /dev/null @@ -1 +0,0 @@ -../../../mongoose.h \ No newline at end of file diff --git a/tutorials/core/multi-threaded/Makefile b/tutorials/core/multi-threaded/Makefile index a1988d2f..5f346151 100644 --- a/tutorials/core/multi-threaded/Makefile +++ b/tutorials/core/multi-threaded/Makefile @@ -1,5 +1,6 @@ -SOURCES = main.c mongoose.c # Source code files -CFLAGS = -W -Wall -Wextra -g -I. # Build options +REPO_ROOT ?= ../../.. +SOURCES = main.c $(REPO_ROOT)/mongoose.c # Source code files +CFLAGS = -I$(REPO_ROOT) -W -Wall -Wextra -g -I. # Build options # Mongoose build options. See https://mongoose.ws/docs/getting-started/build-environment/ CFLAGS_MONGOOSE += diff --git a/tutorials/core/multi-threaded/mongoose.c b/tutorials/core/multi-threaded/mongoose.c deleted file mode 120000 index 5e522bbc..00000000 --- a/tutorials/core/multi-threaded/mongoose.c +++ /dev/null @@ -1 +0,0 @@ -../../../mongoose.c \ No newline at end of file diff --git a/tutorials/core/multi-threaded/mongoose.h b/tutorials/core/multi-threaded/mongoose.h deleted file mode 120000 index ee4ac823..00000000 --- a/tutorials/core/multi-threaded/mongoose.h +++ /dev/null @@ -1 +0,0 @@ -../../../mongoose.h \ No newline at end of file diff --git a/tutorials/core/timers/Makefile b/tutorials/core/timers/Makefile index 0f38857b..fe1f183f 100644 --- a/tutorials/core/timers/Makefile +++ b/tutorials/core/timers/Makefile @@ -1,8 +1,9 @@ PROG ?= example # Program we are building DELETE = rm -rf # Command to remove files OUT ?= -o $(PROG) # Compiler argument for output file -SOURCES = main.c mongoose.c # Source code files -CFLAGS = -W -Wall -Wextra -g -I. # Build options +REPO_ROOT ?= ../../.. +SOURCES = main.c $(REPO_ROOT)/mongoose.c # Source code files +CFLAGS = -I$(REPO_ROOT) -W -Wall -Wextra -g -I. # Build options # Mongoose build options. See https://mongoose.ws/docs/getting-started/build-environment/ CFLAGS_MONGOOSE += -DMG_ENABLE_LINES diff --git a/tutorials/core/timers/mongoose.c b/tutorials/core/timers/mongoose.c deleted file mode 120000 index 5e522bbc..00000000 --- a/tutorials/core/timers/mongoose.c +++ /dev/null @@ -1 +0,0 @@ -../../../mongoose.c \ No newline at end of file diff --git a/tutorials/core/timers/mongoose.h b/tutorials/core/timers/mongoose.h deleted file mode 120000 index ee4ac823..00000000 --- a/tutorials/core/timers/mongoose.h +++ /dev/null @@ -1 +0,0 @@ -../../../mongoose.h \ No newline at end of file diff --git a/tutorials/esp32/device-dashboard/Makefile b/tutorials/esp32/device-dashboard/Makefile index 657c2e32..10f01f36 100644 --- a/tutorials/esp32/device-dashboard/Makefile +++ b/tutorials/esp32/device-dashboard/Makefile @@ -9,9 +9,18 @@ all: example example: true -build: Makefile $(wildcard main/*) +build: Makefile $(wildcard main/*) main/net.c main/net.h main/packed_fs.c $(DOCKER) $(CMD) +main/net.c: ../../http/device-dashboard/net.c main/net.h + cp $< $@ + +main/net.h: ../../http/device-dashboard/net.h + cp $< $@ + +main/packed_fs.c: ../../http/device-dashboard/packed_fs.c + cp $< $@ + flash: flash: CMD = idf.py flash flash: DA = --device $(PORT) @@ -36,3 +45,4 @@ flash3: clean: test -d build && $(DOCKER) rm -rf build sdkconfig || true + rm -f main/net.c main/net.h main/packed_fs.c diff --git a/tutorials/esp32/device-dashboard/main/CMakeLists.txt b/tutorials/esp32/device-dashboard/main/CMakeLists.txt index fb1e9d9e..8efc2111 100644 --- a/tutorials/esp32/device-dashboard/main/CMakeLists.txt +++ b/tutorials/esp32/device-dashboard/main/CMakeLists.txt @@ -2,6 +2,8 @@ idf_component_register(SRCS "main.c" "wifi.c" "net.c" "packed_fs.c" - "mongoose.c") + "../../../../mongoose.c" + INCLUDE_DIRS "." + "../../../..") component_compile_options(-DHTTP_URL="http://0.0.0.0:80") component_compile_options(-DHTTPS_URL="https://0.0.0.0:443") diff --git a/tutorials/esp32/device-dashboard/main/mongoose.c b/tutorials/esp32/device-dashboard/main/mongoose.c deleted file mode 120000 index 7a2752cb..00000000 --- a/tutorials/esp32/device-dashboard/main/mongoose.c +++ /dev/null @@ -1 +0,0 @@ -../../../../mongoose.c \ No newline at end of file diff --git a/tutorials/esp32/device-dashboard/main/mongoose.h b/tutorials/esp32/device-dashboard/main/mongoose.h deleted file mode 120000 index daff1633..00000000 --- a/tutorials/esp32/device-dashboard/main/mongoose.h +++ /dev/null @@ -1 +0,0 @@ -../../../../mongoose.h \ No newline at end of file diff --git a/tutorials/esp32/device-dashboard/main/net.c b/tutorials/esp32/device-dashboard/main/net.c deleted file mode 120000 index f9d6d5e0..00000000 --- a/tutorials/esp32/device-dashboard/main/net.c +++ /dev/null @@ -1 +0,0 @@ -../../../http/device-dashboard/net.c \ No newline at end of file diff --git a/tutorials/esp32/device-dashboard/main/net.h b/tutorials/esp32/device-dashboard/main/net.h deleted file mode 120000 index b5819fac..00000000 --- a/tutorials/esp32/device-dashboard/main/net.h +++ /dev/null @@ -1 +0,0 @@ -../../../http/device-dashboard/net.h \ No newline at end of file diff --git a/tutorials/esp32/device-dashboard/main/packed_fs.c b/tutorials/esp32/device-dashboard/main/packed_fs.c deleted file mode 120000 index d383b87c..00000000 --- a/tutorials/esp32/device-dashboard/main/packed_fs.c +++ /dev/null @@ -1 +0,0 @@ -../../../http/device-dashboard/packed_fs.c \ No newline at end of file diff --git a/tutorials/esp32/uart-bridge/Makefile b/tutorials/esp32/uart-bridge/Makefile index d59ec0d8..e4fce569 100644 --- a/tutorials/esp32/uart-bridge/Makefile +++ b/tutorials/esp32/uart-bridge/Makefile @@ -8,9 +8,15 @@ all: example example: true -build: Makefile $(wildcard main/*) +build: Makefile $(wildcard main/*) main/net.c main/packed_fs.c docker run --rm $(DA) -v $(MNT):$(MNT) -w $(CWD) espressif/idf idf.py $(CMD) +main/net.c: ../../http/uart-bridge/net.c + cp $< $@ + +main/packed_fs.c: ../../http/uart-bridge/packed_fs.c + cp $< $@ + flash: flash: CMD = flash flash: DA = --device $(PORT) @@ -29,4 +35,4 @@ flash2: bridge.hex esputil -p $(PORT) monitor clean: - rm -rf build + rm -rf build main/net.c main/packed_fs.c diff --git a/tutorials/esp32/uart-bridge/main/CMakeLists.txt b/tutorials/esp32/uart-bridge/main/CMakeLists.txt index 2f7add46..7d83bfe8 100644 --- a/tutorials/esp32/uart-bridge/main/CMakeLists.txt +++ b/tutorials/esp32/uart-bridge/main/CMakeLists.txt @@ -4,5 +4,7 @@ idf_component_register(SRCS "main.c" "cli.c" "net.c" "packed_fs.c" - "mongoose.c") + "../../../../mongoose.c" + INCLUDE_DIRS "." + "../../../..") component_compile_options(-DUART_API_IMPLEMENTED=1) diff --git a/tutorials/esp32/uart-bridge/main/mongoose.c b/tutorials/esp32/uart-bridge/main/mongoose.c deleted file mode 120000 index 7a2752cb..00000000 --- a/tutorials/esp32/uart-bridge/main/mongoose.c +++ /dev/null @@ -1 +0,0 @@ -../../../../mongoose.c \ No newline at end of file diff --git a/tutorials/esp32/uart-bridge/main/mongoose.h b/tutorials/esp32/uart-bridge/main/mongoose.h deleted file mode 120000 index daff1633..00000000 --- a/tutorials/esp32/uart-bridge/main/mongoose.h +++ /dev/null @@ -1 +0,0 @@ -../../../../mongoose.h \ No newline at end of file diff --git a/tutorials/esp32/uart-bridge/main/net.c b/tutorials/esp32/uart-bridge/main/net.c deleted file mode 120000 index 1d4fd1c5..00000000 --- a/tutorials/esp32/uart-bridge/main/net.c +++ /dev/null @@ -1 +0,0 @@ -../../../http/uart-bridge/net.c \ No newline at end of file diff --git a/tutorials/esp32/uart-bridge/main/packed_fs.c b/tutorials/esp32/uart-bridge/main/packed_fs.c deleted file mode 120000 index b4271e6d..00000000 --- a/tutorials/esp32/uart-bridge/main/packed_fs.c +++ /dev/null @@ -1 +0,0 @@ -../../../http/uart-bridge/packed_fs.c \ No newline at end of file diff --git a/tutorials/http/device-dashboard/Makefile b/tutorials/http/device-dashboard/Makefile index da483c17..c62ff952 100644 --- a/tutorials/http/device-dashboard/Makefile +++ b/tutorials/http/device-dashboard/Makefile @@ -29,8 +29,8 @@ web_root/bundle.js: curl -s https://npm.reversehttp.com/preact,preact/hooks,htm/preact,preact-router -o $@ # Generate packed filesystem for serving Web UI -packed_fs.c: $(wildcard web_root/*) $(wildcard certs/*) Makefile web_root/bundle.js - node pack.js $(addsuffix ::gzip, $(wildcard web_root/*)) certs/* > $@ +packed_fs.c: $(wildcard web_root/*) $(wildcard certs/*) Makefile ../../../test/pack.js web_root/bundle.js + node ../../../test/pack.js $(addsuffix ::gzip, $(wildcard web_root/*)) certs/* > $@ mbedtls: git clone --depth 1 -b v2.28.2 https://github.com/mbed-tls/mbedtls $@ diff --git a/tutorials/http/device-dashboard/pack.js b/tutorials/http/device-dashboard/pack.js deleted file mode 120000 index 49387549..00000000 --- a/tutorials/http/device-dashboard/pack.js +++ /dev/null @@ -1 +0,0 @@ -../../../test/pack.js \ No newline at end of file diff --git a/tutorials/http/http-client/Makefile b/tutorials/http/http-client/Makefile index 10145f3a..6bc89160 100644 --- a/tutorials/http/http-client/Makefile +++ b/tutorials/http/http-client/Makefile @@ -24,8 +24,12 @@ endif all: $(PROG) # Default target. Build and run program $(RUN) ./$(PROG) $(ARGS) -$(PROG): $(SOURCES) # Build program from sources +$(PROG): $(SOURCES) certs/ca.pem # Build program from sources $(CC) $(SOURCES) $(CFLAGS) $(CFLAGS_MONGOOSE) $(CFLAGS_EXTRA) $(OUT) +certs/ca.pem: ../../../test/data/ca.pem + mkdir -p certs + cp $< $@ + clean: # Cleanup. Delete built program and all build artifacts - $(DELETE) $(PROG) *.o *.obj *.exe *.dSYM mbedtls $(PACK) + $(DELETE) $(PROG) *.o *.obj *.exe *.dSYM mbedtls $(PACK) certs/ca.pem diff --git a/tutorials/http/http-client/certs/ca.pem b/tutorials/http/http-client/certs/ca.pem deleted file mode 120000 index 6110831e..00000000 --- a/tutorials/http/http-client/certs/ca.pem +++ /dev/null @@ -1 +0,0 @@ -../../../../test/data/ca.pem \ No newline at end of file diff --git a/tutorials/http/http-proxy-client/Makefile b/tutorials/http/http-proxy-client/Makefile index e0bfa39d..89602b7e 100644 --- a/tutorials/http/http-proxy-client/Makefile +++ b/tutorials/http/http-proxy-client/Makefile @@ -27,8 +27,11 @@ all: $(PROG) # Default target. Build and run program $(PROG): $(SOURCES) # Build program from sources $(CC) $(SOURCES) $(CFLAGS) $(CFLAGS_MONGOOSE) $(CFLAGS_EXTRA) $(OUT) +packed_fs.c: ../http-client/packed_fs.c + cp $< $@ + clean: # Cleanup. Delete built program and all build artifacts - $(DELETE) $(PROG) *.o *.obj *.exe *.dSYM mbedtls + $(DELETE) $(PROG) *.o *.obj *.exe *.dSYM mbedtls packed_fs.c # see https://mongoose.ws/tutorials/tls/#how-to-build for TLS build options diff --git a/tutorials/http/http-proxy-client/packed_fs.c b/tutorials/http/http-proxy-client/packed_fs.c deleted file mode 120000 index 3da43a3c..00000000 --- a/tutorials/http/http-proxy-client/packed_fs.c +++ /dev/null @@ -1 +0,0 @@ -../http-client/packed_fs.c \ No newline at end of file diff --git a/tutorials/http/http-reverse-proxy/Makefile b/tutorials/http/http-reverse-proxy/Makefile index d585dbec..3df071d7 100644 --- a/tutorials/http/http-reverse-proxy/Makefile +++ b/tutorials/http/http-reverse-proxy/Makefile @@ -24,8 +24,11 @@ all: $(PROG) # Default target. Build and run program $(PROG): $(SOURCES) # Build program from sources $(CC) $(SOURCES) $(CFLAGS) $(CFLAGS_MONGOOSE) $(CFLAGS_EXTRA) $(OUT) +packed_fs.c: ../http-client/packed_fs.c + cp $< $@ + clean: # Cleanup. Delete built program and all build artifacts - $(DELETE) $(PROG) *.o *.obj *.exe *.dSYM mbedtls + $(DELETE) $(PROG) *.o *.obj *.exe *.dSYM mbedtls packed_fs.c # see https://mongoose.ws/tutorials/tls/#how-to-build for TLS build options diff --git a/tutorials/http/http-reverse-proxy/packed_fs.c b/tutorials/http/http-reverse-proxy/packed_fs.c deleted file mode 120000 index 3da43a3c..00000000 --- a/tutorials/http/http-reverse-proxy/packed_fs.c +++ /dev/null @@ -1 +0,0 @@ -../http-client/packed_fs.c \ No newline at end of file diff --git a/tutorials/http/http-server/Makefile b/tutorials/http/http-server/Makefile index 7edf6aa7..a0eec461 100644 --- a/tutorials/http/http-server/Makefile +++ b/tutorials/http/http-server/Makefile @@ -20,14 +20,22 @@ ifeq ($(OS),Windows_NT) # Windows settings. Assume MinGW compiler. To use VC: OUT ?= -o $(PROG) # Build output endif -all: $(PROG) # Default target. Build and run program +CERTS = certs/ca.crt certs/ca.key certs/ca.srl certs/client.crt certs/client.csr \ + certs/client.key certs/generate.sh certs/server.crt certs/server.csr \ + certs/server.key + +all: $(CERTS) $(PROG) # Default target. Build and run program $(RUN) ./$(PROG) $(ARGS) +certs/%: ../../../test/certs/% + mkdir -p certs + cp $< $@ + $(PROG): $(SOURCES) # Build program from sources $(CC) $(SOURCES) $(CFLAGS) $(CFLAGS_MONGOOSE) $(CFLAGS_EXTRA) $(OUT) clean: # Cleanup. Delete built program and all build artifacts - $(DELETE) $(PROG) *.o *.obj *.exe *.dSYM + $(DELETE) $(PROG) *.o *.obj *.exe *.dSYM certs/* vc98: CC = cl diff --git a/tutorials/http/http-server/certs b/tutorials/http/http-server/certs deleted file mode 120000 index 6417c1fe..00000000 --- a/tutorials/http/http-server/certs +++ /dev/null @@ -1 +0,0 @@ -../../../test/certs \ No newline at end of file diff --git a/tutorials/http/http-streaming-client/Makefile b/tutorials/http/http-streaming-client/Makefile index f3c1eda8..124ea553 100644 --- a/tutorials/http/http-streaming-client/Makefile +++ b/tutorials/http/http-streaming-client/Makefile @@ -24,8 +24,11 @@ all: $(PROG) # Default target. Build and run program $(PROG): $(SOURCES) # Build program from sources $(CC) $(SOURCES) $(CFLAGS) $(CFLAGS_MONGOOSE) $(CFLAGS_EXTRA) $(OUT) +packed_fs.c: ../http-client/packed_fs.c + cp $< $@ + clean: # Cleanup. Delete built program and all build artifacts - $(DELETE) $(PROG) *.o *.obj *.exe *.dSYM mbedtls + $(DELETE) $(PROG) *.o *.obj *.exe *.dSYM mbedtls packed_fs.c # see https://mongoose.ws/tutorials/tls/#how-to-build for TLS build options diff --git a/tutorials/http/http-streaming-client/packed_fs.c b/tutorials/http/http-streaming-client/packed_fs.c deleted file mode 120000 index 3da43a3c..00000000 --- a/tutorials/http/http-streaming-client/packed_fs.c +++ /dev/null @@ -1 +0,0 @@ -../http-client/packed_fs.c \ No newline at end of file diff --git a/tutorials/http/wifi-router-dashboard/Makefile b/tutorials/http/wifi-router-dashboard/Makefile index f46a62c3..e345fe32 100644 --- a/tutorials/http/wifi-router-dashboard/Makefile +++ b/tutorials/http/wifi-router-dashboard/Makefile @@ -20,14 +20,23 @@ endif all: $(PROG) # Default target. Build and run program $(RUN) $(PROG) $(ARGS) -web_root/bundle.js: - curl -s https://npm.reversehttp.com/preact,preact/hooks,htm/preact,preact-router -o $@ +web_root/bundle.js: ../device-dashboard/web_root/bundle.js + cp $< $@ -packed_fs.c: $(wildcard web_root/*) Makefile web_root/bundle.js - node pack.js $(addsuffix ::gzip, $(wildcard web_root/*)) > $@ +web_root/components.js: ../device-dashboard/web_root/components.js + cp $< $@ + +web_root/history.min.js: ../device-dashboard/web_root/history.min.js + cp $< $@ + +web_root/index.html: ../device-dashboard/web_root/index.html + cp $< $@ + +packed_fs.c: $(wildcard web_root/*) Makefile ../../../test/pack.js web_root/bundle.js web_root/components.js web_root/history.min.js web_root/index.html + node ../../../test/pack.js $(addsuffix ::gzip, $(wildcard web_root/*)) > $@ $(PROG): $(SOURCES) # Build program from sources $(CC) $(SOURCES) $(CFLAGS) $(CFLAGS_MONGOOSE) $(CFLAGS_EXTRA) $(OUT) clean: # Cleanup. Delete built program and all build artifacts - $(DELETE) $(PROG) $(PACK) *.o *.obj *.exe *.dSYM + $(DELETE) $(PROG) $(PACK) *.o *.obj *.exe *.dSYM web_root/bundle.js web_root/components.js web_root/history.min.js web_root/index.html diff --git a/tutorials/http/wifi-router-dashboard/pack.js b/tutorials/http/wifi-router-dashboard/pack.js deleted file mode 120000 index 49387549..00000000 --- a/tutorials/http/wifi-router-dashboard/pack.js +++ /dev/null @@ -1 +0,0 @@ -../../../test/pack.js \ No newline at end of file diff --git a/tutorials/http/wifi-router-dashboard/web_root/bundle.js b/tutorials/http/wifi-router-dashboard/web_root/bundle.js deleted file mode 120000 index f4df0f35..00000000 --- a/tutorials/http/wifi-router-dashboard/web_root/bundle.js +++ /dev/null @@ -1 +0,0 @@ -../../device-dashboard/web_root/bundle.js \ No newline at end of file diff --git a/tutorials/http/wifi-router-dashboard/web_root/components.js b/tutorials/http/wifi-router-dashboard/web_root/components.js deleted file mode 120000 index dde5de4b..00000000 --- a/tutorials/http/wifi-router-dashboard/web_root/components.js +++ /dev/null @@ -1 +0,0 @@ -../../device-dashboard/web_root/components.js \ No newline at end of file diff --git a/tutorials/http/wifi-router-dashboard/web_root/history.min.js b/tutorials/http/wifi-router-dashboard/web_root/history.min.js deleted file mode 120000 index 13552193..00000000 --- a/tutorials/http/wifi-router-dashboard/web_root/history.min.js +++ /dev/null @@ -1 +0,0 @@ -../../device-dashboard/web_root/history.min.js \ No newline at end of file diff --git a/tutorials/http/wifi-router-dashboard/web_root/index.html b/tutorials/http/wifi-router-dashboard/web_root/index.html deleted file mode 120000 index ee5c3157..00000000 --- a/tutorials/http/wifi-router-dashboard/web_root/index.html +++ /dev/null @@ -1 +0,0 @@ -../../device-dashboard/web_root/index.html \ No newline at end of file diff --git a/tutorials/microchip/same54-xpro/device-dashboard/Makefile b/tutorials/microchip/same54-xpro/device-dashboard/Makefile index f63b340d..ec00587d 100644 --- a/tutorials/microchip/same54-xpro/device-dashboard/Makefile +++ b/tutorials/microchip/same54-xpro/device-dashboard/Makefile @@ -1,4 +1,5 @@ -CFLAGS = -W -Wall -Wextra -Wundef -Wshadow -Wdouble-promotion +REPO_ROOT ?= ../../../.. +CFLAGS = -I$(REPO_ROOT) -W -Wall -Wextra -Wundef -Wshadow -Wdouble-promotion CFLAGS += -Wformat-truncation -fno-common -Wconversion CFLAGS += -g3 -Os -ffunction-sections -fdata-sections CFLAGS += -I. -Icmsis_core/CMSIS/Core/Include @@ -9,7 +10,7 @@ LDFLAGS ?= -Tlink.ld -nostartfiles -nostdlib --specs nano.specs -lc -lgcc -Wl,-- SOURCES = main.c syscalls.c startup.c # Mongoose-specific source code files and build options. See https://mongoose.ws/docs/getting-started/build-environment/ -SOURCES += mongoose.c net.c packed_fs.c +SOURCES += $(REPO_ROOT)/mongoose.c net.c packed_fs.c CFLAGS += -DMG_ENABLE_TCPIP=1 -DMG_ARCH=MG_ARCH_ARMGCC -DMG_ENABLE_CUSTOM_MILLIS=1 -DMG_ENABLE_LINES=1 CFLAGS += -DMG_ENABLE_DRIVER_SAME54=1 -DMG_ENABLE_CUSTOM_RANDOM=1 $(CFLAGS_EXTRA) @@ -39,6 +40,15 @@ cmsis_sam: curl -sL https://packs.download.microchip.com/Microchip.SAME54_DFP.3.9.244.atpack -o $@.zip mkdir $@ && cd $@ && unzip ../$@.zip +net.c: ../../../http/device-dashboard/net.c net.h + cp $< $@ + +net.h: ../../../http/device-dashboard/net.h + cp $< $@ + +packed_fs.c: ../../../http/device-dashboard/packed_fs.c + cp $< $@ + # Automated test via https://vcon.io/automated-firmware-tests/. Set VCON_API_KEY and update DEVICE_URL DEVICE_URL ?= https://dash.vcon.io/api/v3/devices/9 update: firmware.bin @@ -50,4 +60,4 @@ test: update grep 'READY, IP:' /tmp/output.txt # Check for network init clean: - $(RM) firmware.* cmsis_core cmsis_sam *.zip + $(RM) firmware.* cmsis_core cmsis_sam *.zip net.c net.h packed_fs.c diff --git a/tutorials/microchip/same54-xpro/device-dashboard/mongoose.c b/tutorials/microchip/same54-xpro/device-dashboard/mongoose.c deleted file mode 120000 index 7a2752cb..00000000 --- a/tutorials/microchip/same54-xpro/device-dashboard/mongoose.c +++ /dev/null @@ -1 +0,0 @@ -../../../../mongoose.c \ No newline at end of file diff --git a/tutorials/microchip/same54-xpro/device-dashboard/mongoose.h b/tutorials/microchip/same54-xpro/device-dashboard/mongoose.h deleted file mode 120000 index daff1633..00000000 --- a/tutorials/microchip/same54-xpro/device-dashboard/mongoose.h +++ /dev/null @@ -1 +0,0 @@ -../../../../mongoose.h \ No newline at end of file diff --git a/tutorials/microchip/same54-xpro/device-dashboard/net.c b/tutorials/microchip/same54-xpro/device-dashboard/net.c deleted file mode 120000 index f9d6d5e0..00000000 --- a/tutorials/microchip/same54-xpro/device-dashboard/net.c +++ /dev/null @@ -1 +0,0 @@ -../../../http/device-dashboard/net.c \ No newline at end of file diff --git a/tutorials/microchip/same54-xpro/device-dashboard/net.h b/tutorials/microchip/same54-xpro/device-dashboard/net.h deleted file mode 120000 index b5819fac..00000000 --- a/tutorials/microchip/same54-xpro/device-dashboard/net.h +++ /dev/null @@ -1 +0,0 @@ -../../../http/device-dashboard/net.h \ No newline at end of file diff --git a/tutorials/microchip/same54-xpro/device-dashboard/packed_fs.c b/tutorials/microchip/same54-xpro/device-dashboard/packed_fs.c deleted file mode 120000 index d383b87c..00000000 --- a/tutorials/microchip/same54-xpro/device-dashboard/packed_fs.c +++ /dev/null @@ -1 +0,0 @@ -../../../http/device-dashboard/packed_fs.c \ No newline at end of file diff --git a/tutorials/microchip/same54-xpro/mqtt-client/Makefile b/tutorials/microchip/same54-xpro/mqtt-client/Makefile index 0f73fe3c..ccb208e1 100644 --- a/tutorials/microchip/same54-xpro/mqtt-client/Makefile +++ b/tutorials/microchip/same54-xpro/mqtt-client/Makefile @@ -1,4 +1,5 @@ -CFLAGS = -W -Wall -Wextra -Wundef -Wshadow -Wdouble-promotion +REPO_ROOT ?= ../../../.. +CFLAGS = -I$(REPO_ROOT) -W -Wall -Wextra -Wundef -Wshadow -Wdouble-promotion CFLAGS += -Wformat-truncation -fno-common -Wconversion CFLAGS += -g3 -Os -ffunction-sections -fdata-sections CFLAGS += -I. -Icmsis_core/CMSIS/Core/Include @@ -9,7 +10,7 @@ LDFLAGS ?= -Tlink.ld -nostartfiles -nostdlib --specs nano.specs -lc -lgcc -Wl,-- SOURCES = main.c syscalls.c startup.c # Mongoose-specific source code files and build options. See https://mongoose.ws/docs/getting-started/build-environment/ -SOURCES += mongoose.c +SOURCES += $(REPO_ROOT)/mongoose.c CFLAGS += -DMG_ENABLE_TCPIP=1 -DMG_ARCH=MG_ARCH_ARMGCC -DMG_ENABLE_CUSTOM_MILLIS=1 -DMG_ENABLE_LINES=1 CFLAGS += -DMG_ENABLE_DRIVER_SAME54=1 -DMG_ENABLE_CUSTOM_RANDOM=1 $(CFLAGS_EXTRA) diff --git a/tutorials/microchip/same54-xpro/mqtt-client/mongoose.c b/tutorials/microchip/same54-xpro/mqtt-client/mongoose.c deleted file mode 120000 index 7a2752cb..00000000 --- a/tutorials/microchip/same54-xpro/mqtt-client/mongoose.c +++ /dev/null @@ -1 +0,0 @@ -../../../../mongoose.c \ No newline at end of file diff --git a/tutorials/microchip/same54-xpro/mqtt-client/mongoose.h b/tutorials/microchip/same54-xpro/mqtt-client/mongoose.h deleted file mode 120000 index daff1633..00000000 --- a/tutorials/microchip/same54-xpro/mqtt-client/mongoose.h +++ /dev/null @@ -1 +0,0 @@ -../../../../mongoose.h \ No newline at end of file diff --git a/tutorials/micropython/esp32/Makefile b/tutorials/micropython/esp32/Makefile index cfd3281d..3b0ef638 100644 --- a/tutorials/micropython/esp32/Makefile +++ b/tutorials/micropython/esp32/Makefile @@ -4,7 +4,7 @@ ROOTDIR = $(realpath $(CURDIR)/../../..) PORT ?= /dev/ttyUSB0 DOCKER ?= docker run --rm $(DA) -v $(ROOTDIR):$(ROOTDIR) -w $(THISDIR) espressif/idf:v5.0.4 # Note that the esp32 port needs the extra .. for relative paths due to the location of its main CMakeLists.txt file -CMD ?= bash -c '$(MAKE) -C micropython/ports/esp32 submodules && $(MAKE) -C micropython/ports/esp32 USER_C_MODULES=../../../../mongoose/micropython.cmake' +CMD ?= bash -c '$(MAKE) -C micropython/ports/esp32 submodules && $(MAKE) -C micropython/ports/esp32 USER_C_MODULES=../../../../../mongoose/micropython.cmake' all: example diff --git a/tutorials/micropython/esp32/mongoose/micropython.cmake b/tutorials/micropython/esp32/mongoose/micropython.cmake deleted file mode 120000 index 8591105f..00000000 --- a/tutorials/micropython/esp32/mongoose/micropython.cmake +++ /dev/null @@ -1 +0,0 @@ -../../mongoose/micropython.cmake \ No newline at end of file diff --git a/tutorials/micropython/esp32/mongoose/micropython.mk b/tutorials/micropython/esp32/mongoose/micropython.mk deleted file mode 120000 index 5a65830c..00000000 --- a/tutorials/micropython/esp32/mongoose/micropython.mk +++ /dev/null @@ -1 +0,0 @@ -../../mongoose/micropython.mk \ No newline at end of file diff --git a/tutorials/micropython/esp32/mongoose/module.c b/tutorials/micropython/esp32/mongoose/module.c deleted file mode 120000 index 6596b45f..00000000 --- a/tutorials/micropython/esp32/mongoose/module.c +++ /dev/null @@ -1 +0,0 @@ -../../mongoose/module.c \ No newline at end of file diff --git a/tutorials/micropython/esp32/mongoose/mongoose.c b/tutorials/micropython/esp32/mongoose/mongoose.c deleted file mode 120000 index 7a2752cb..00000000 --- a/tutorials/micropython/esp32/mongoose/mongoose.c +++ /dev/null @@ -1 +0,0 @@ -../../../../mongoose.c \ No newline at end of file diff --git a/tutorials/micropython/esp32/mongoose/mongoose.h b/tutorials/micropython/esp32/mongoose/mongoose.h deleted file mode 120000 index daff1633..00000000 --- a/tutorials/micropython/esp32/mongoose/mongoose.h +++ /dev/null @@ -1 +0,0 @@ -../../../../mongoose.h \ No newline at end of file diff --git a/tutorials/micropython/mongoose/micropython.cmake b/tutorials/micropython/mongoose/micropython.cmake index 92f56b13..69976294 100644 --- a/tutorials/micropython/mongoose/micropython.cmake +++ b/tutorials/micropython/mongoose/micropython.cmake @@ -4,13 +4,14 @@ add_library(usermod_mongoose INTERFACE) # Add our source files to the lib target_sources(usermod_mongoose INTERFACE ${CMAKE_CURRENT_LIST_DIR}/module.c - ${CMAKE_CURRENT_LIST_DIR}/mongoose.c + ${CMAKE_CURRENT_LIST_DIR}/../../../mongoose.c ${CMAKE_CURRENT_LIST_DIR}/main.c ) # Add the current directory as an include directory. target_include_directories(usermod_mongoose INTERFACE ${CMAKE_CURRENT_LIST_DIR} + ${CMAKE_CURRENT_LIST_DIR}/../../.. ) # Link our INTERFACE library to the usermod target. diff --git a/tutorials/micropython/mongoose/micropython.mk b/tutorials/micropython/mongoose/micropython.mk index 7e90e1cf..0df65abb 100644 --- a/tutorials/micropython/mongoose/micropython.mk +++ b/tutorials/micropython/mongoose/micropython.mk @@ -2,8 +2,8 @@ CEXAMPLE_MOD_DIR := $(USERMOD_DIR) # Add all C files to SRC_USERMOD. SRC_USERMOD += $(CEXAMPLE_MOD_DIR)/module.c -SRC_USERMOD += $(CEXAMPLE_MOD_DIR)/mongoose.c +SRC_USERMOD += $(CEXAMPLE_MOD_DIR)/../../../mongoose.c SRC_USERMOD += $(CEXAMPLE_MOD_DIR)/main.c # add our module folder to include paths -CFLAGS_USERMOD += -I$(CEXAMPLE_MOD_DIR) +CFLAGS_USERMOD += -I$(CEXAMPLE_MOD_DIR) -I$(CEXAMPLE_MOD_DIR)/../../.. diff --git a/tutorials/micropython/mongoose/mongoose.c b/tutorials/micropython/mongoose/mongoose.c deleted file mode 120000 index 5e522bbc..00000000 --- a/tutorials/micropython/mongoose/mongoose.c +++ /dev/null @@ -1 +0,0 @@ -../../../mongoose.c \ No newline at end of file diff --git a/tutorials/micropython/mongoose/mongoose.h b/tutorials/micropython/mongoose/mongoose.h deleted file mode 120000 index ee4ac823..00000000 --- a/tutorials/micropython/mongoose/mongoose.h +++ /dev/null @@ -1 +0,0 @@ -../../../mongoose.h \ No newline at end of file diff --git a/tutorials/mqtt/mqtt-over-ws-client/Makefile b/tutorials/mqtt/mqtt-over-ws-client/Makefile index f3c1eda8..4d8fc272 100644 --- a/tutorials/mqtt/mqtt-over-ws-client/Makefile +++ b/tutorials/mqtt/mqtt-over-ws-client/Makefile @@ -24,8 +24,11 @@ all: $(PROG) # Default target. Build and run program $(PROG): $(SOURCES) # Build program from sources $(CC) $(SOURCES) $(CFLAGS) $(CFLAGS_MONGOOSE) $(CFLAGS_EXTRA) $(OUT) +packed_fs.c: ../../http/http-client/packed_fs.c + cp $< $@ + clean: # Cleanup. Delete built program and all build artifacts - $(DELETE) $(PROG) *.o *.obj *.exe *.dSYM mbedtls + $(DELETE) $(PROG) *.o *.obj *.exe *.dSYM mbedtls packed_fs.c # see https://mongoose.ws/tutorials/tls/#how-to-build for TLS build options diff --git a/tutorials/mqtt/mqtt-over-ws-client/packed_fs.c b/tutorials/mqtt/mqtt-over-ws-client/packed_fs.c deleted file mode 120000 index 5a635976..00000000 --- a/tutorials/mqtt/mqtt-over-ws-client/packed_fs.c +++ /dev/null @@ -1 +0,0 @@ -../../http/http-client/packed_fs.c \ No newline at end of file diff --git a/tutorials/nxp/teensy-4.1/arduino/mongoose.c b/tutorials/nxp/teensy-4.1/arduino/mongoose.c deleted file mode 120000 index 7a2752cb..00000000 --- a/tutorials/nxp/teensy-4.1/arduino/mongoose.c +++ /dev/null @@ -1 +0,0 @@ -../../../../mongoose.c \ No newline at end of file diff --git a/tutorials/nxp/teensy-4.1/arduino/mongoose.h b/tutorials/nxp/teensy-4.1/arduino/mongoose.h deleted file mode 120000 index daff1633..00000000 --- a/tutorials/nxp/teensy-4.1/arduino/mongoose.h +++ /dev/null @@ -1 +0,0 @@ -../../../../mongoose.h \ No newline at end of file diff --git a/tutorials/renesas/ek-ra6m4-make-baremetal-builtin/Makefile b/tutorials/renesas/ek-ra6m4-make-baremetal-builtin/Makefile index 6caf1c5d..35700e1f 100644 --- a/tutorials/renesas/ek-ra6m4-make-baremetal-builtin/Makefile +++ b/tutorials/renesas/ek-ra6m4-make-baremetal-builtin/Makefile @@ -1,4 +1,5 @@ -CFLAGS = -W -Wall -Wextra -Werror -Wundef -Wshadow -Wdouble-promotion +REPO_ROOT ?= ../../.. +CFLAGS = -I$(REPO_ROOT) -W -Wall -Wextra -Werror -Wundef -Wshadow -Wdouble-promotion CFLAGS += -Wformat-truncation -fno-common -Wconversion -Wno-sign-conversion CFLAGS += -g3 -Os -ffunction-sections -fdata-sections CFLAGS += -I. -Icmsis_core/CMSIS/Core/Include @@ -7,7 +8,7 @@ CFLAGS += -Icmsis_mcu/ra/fsp/src/bsp/mcu/all CFLAGS += -mcpu=cortex-m33 -mthumb -mfpu=fpv5-sp-d16 -mfloat-abi=hard $(CFLAGS_EXTRA) LDFLAGS ?= -Tlink.ld -nostdlib -nostartfiles --specs nano.specs -lc -lgcc -Wl,--gc-sections -Wl,-Map=$@.map -SOURCES = main.c hal.c mongoose.c net.c packed_fs.c +SOURCES = main.c hal.c $(REPO_ROOT)/mongoose.c net.c packed_fs.c # CMSIS startup and system files are deeply tied to the BSP, and we don't use it. See hal.c # Example specific build options. See README.md @@ -37,6 +38,15 @@ cmsis_core: # ARM CMSIS core headers cmsis_mcu: git clone -q --depth 1 -b v5.1.0 https://github.com/renesas/fsp $@ +net.c: ../../http/device-dashboard/net.c net.h + cp $< $@ + +net.h: ../../http/device-dashboard/net.h + cp $< $@ + +packed_fs.c: ../../http/device-dashboard/packed_fs.c + cp $< $@ + # Automated remote test. Requires env variable VCON_API_KEY set. See https://vcon.io/automated-firmware-tests/ DEVICE_URL ?= https://dash.vcon.io/api/v3/devices/14 @@ -50,4 +60,4 @@ test: update grep 'READY, IP:' /tmp/output.txt # Check for network init clean: - $(RM) firmware.* *.su cmsis_core cmsis_mcu mbedtls *.zip + $(RM) firmware.* *.su cmsis_core cmsis_mcu mbedtls *.zip net.c net.h packed_fs.c diff --git a/tutorials/renesas/ek-ra6m4-make-baremetal-builtin/mongoose.c b/tutorials/renesas/ek-ra6m4-make-baremetal-builtin/mongoose.c deleted file mode 120000 index 5e522bbc..00000000 --- a/tutorials/renesas/ek-ra6m4-make-baremetal-builtin/mongoose.c +++ /dev/null @@ -1 +0,0 @@ -../../../mongoose.c \ No newline at end of file diff --git a/tutorials/renesas/ek-ra6m4-make-baremetal-builtin/mongoose.h b/tutorials/renesas/ek-ra6m4-make-baremetal-builtin/mongoose.h deleted file mode 120000 index ee4ac823..00000000 --- a/tutorials/renesas/ek-ra6m4-make-baremetal-builtin/mongoose.h +++ /dev/null @@ -1 +0,0 @@ -../../../mongoose.h \ No newline at end of file diff --git a/tutorials/renesas/ek-ra6m4-make-baremetal-builtin/net.c b/tutorials/renesas/ek-ra6m4-make-baremetal-builtin/net.c deleted file mode 120000 index d40995ff..00000000 --- a/tutorials/renesas/ek-ra6m4-make-baremetal-builtin/net.c +++ /dev/null @@ -1 +0,0 @@ -../../http/device-dashboard/net.c \ No newline at end of file diff --git a/tutorials/renesas/ek-ra6m4-make-baremetal-builtin/net.h b/tutorials/renesas/ek-ra6m4-make-baremetal-builtin/net.h deleted file mode 120000 index 290e3068..00000000 --- a/tutorials/renesas/ek-ra6m4-make-baremetal-builtin/net.h +++ /dev/null @@ -1 +0,0 @@ -../../http/device-dashboard/net.h \ No newline at end of file diff --git a/tutorials/renesas/ek-ra6m4-make-baremetal-builtin/packed_fs.c b/tutorials/renesas/ek-ra6m4-make-baremetal-builtin/packed_fs.c deleted file mode 120000 index 41f8c7d9..00000000 --- a/tutorials/renesas/ek-ra6m4-make-baremetal-builtin/packed_fs.c +++ /dev/null @@ -1 +0,0 @@ -../../http/device-dashboard/packed_fs.c \ No newline at end of file diff --git a/tutorials/rp/pico-rndis-device/Makefile b/tutorials/rp/pico-rndis-device/Makefile index 7f7334e2..00c6e791 100644 --- a/tutorials/rp/pico-rndis-device/Makefile +++ b/tutorials/rp/pico-rndis-device/Makefile @@ -8,13 +8,19 @@ endif all example: true -build build/firmware.uf2: pico-sdk main.c net.c +build build/firmware.uf2: pico-sdk main.c net.c net.h $(MKBUILD) cd build && cmake -G "Unix Makefiles" .. && make +net.c: ../../mqtt/mqtt-dashboard/device/net.c net.h + cp $< $@ + +net.h: ../../mqtt/mqtt-dashboard/device/net.h + cp $< $@ + pico-sdk: git clone --depth 1 -b 2.1.0 https://github.com/raspberrypi/pico-sdk $@ cd $@ && git submodule update --init clean: - $(RM) pico-sdk build + $(RM) pico-sdk build net.c net.h diff --git a/tutorials/rp/pico-rndis-device/net.c b/tutorials/rp/pico-rndis-device/net.c deleted file mode 120000 index 5a1bf032..00000000 --- a/tutorials/rp/pico-rndis-device/net.c +++ /dev/null @@ -1 +0,0 @@ -../../mqtt/mqtt-dashboard/device/net.c \ No newline at end of file diff --git a/tutorials/rp/pico-rndis-device/net.h b/tutorials/rp/pico-rndis-device/net.h deleted file mode 120000 index 3e71e66d..00000000 --- a/tutorials/rp/pico-rndis-device/net.h +++ /dev/null @@ -1 +0,0 @@ -../../mqtt/mqtt-dashboard/device/net.h \ No newline at end of file diff --git a/tutorials/smtp/smtp-client/Makefile b/tutorials/smtp/smtp-client/Makefile index f3c1eda8..4d8fc272 100644 --- a/tutorials/smtp/smtp-client/Makefile +++ b/tutorials/smtp/smtp-client/Makefile @@ -24,8 +24,11 @@ all: $(PROG) # Default target. Build and run program $(PROG): $(SOURCES) # Build program from sources $(CC) $(SOURCES) $(CFLAGS) $(CFLAGS_MONGOOSE) $(CFLAGS_EXTRA) $(OUT) +packed_fs.c: ../../http/http-client/packed_fs.c + cp $< $@ + clean: # Cleanup. Delete built program and all build artifacts - $(DELETE) $(PROG) *.o *.obj *.exe *.dSYM mbedtls + $(DELETE) $(PROG) *.o *.obj *.exe *.dSYM mbedtls packed_fs.c # see https://mongoose.ws/tutorials/tls/#how-to-build for TLS build options diff --git a/tutorials/smtp/smtp-client/packed_fs.c b/tutorials/smtp/smtp-client/packed_fs.c deleted file mode 120000 index 5a635976..00000000 --- a/tutorials/smtp/smtp-client/packed_fs.c +++ /dev/null @@ -1 +0,0 @@ -../../http/http-client/packed_fs.c \ No newline at end of file diff --git a/tutorials/tcp/modbus-dashboard/Makefile b/tutorials/tcp/modbus-dashboard/Makefile index 3a57ef25..7e4ea8c6 100644 --- a/tutorials/tcp/modbus-dashboard/Makefile +++ b/tutorials/tcp/modbus-dashboard/Makefile @@ -29,8 +29,16 @@ web_root/bundle.js: curl -s https://npm.reversehttp.com/preact,preact/hooks,htm/preact,preact-router -o $@ # Generate packed filesystem for serving Web UI -packed_fs.c: $(wildcard web_root/*) $(wildcard certs/*) Makefile web_root/bundle.js - node pack.js $(addsuffix ::gzip, $(wildcard web_root/*)) certs/* > $@ +packed_fs.c: $(wildcard web_root/*) $(wildcard certs/*) Makefile ../../../test/pack.js web_root/bundle.js certs/server_cert.pem certs/server_key.pem + node ../../../test/pack.js $(addsuffix ::gzip, $(wildcard web_root/*)) certs/* > $@ + +certs/server_cert.pem: ../../http/device-dashboard/certs/server_cert.pem + mkdir -p certs + cp $< $@ + +certs/server_key.pem: ../../http/device-dashboard/certs/server_key.pem + mkdir -p certs + cp $< $@ mbedtls: git clone --depth 1 -b v2.28.2 https://github.com/mbed-tls/mbedtls $@ @@ -43,4 +51,4 @@ endif # Cleanup. Delete built program and all build artifacts clean: - $(DELETE) $(PROG) $(PACK) *.o *.obj *.exe *.bin *.dSYM mbedtls + $(DELETE) $(PROG) $(PACK) *.o *.obj *.exe *.bin *.dSYM mbedtls certs/* diff --git a/tutorials/tcp/modbus-dashboard/certs b/tutorials/tcp/modbus-dashboard/certs deleted file mode 120000 index a5a35151..00000000 --- a/tutorials/tcp/modbus-dashboard/certs +++ /dev/null @@ -1 +0,0 @@ -../../http/device-dashboard/certs \ No newline at end of file diff --git a/tutorials/tcp/modbus-dashboard/pack.js b/tutorials/tcp/modbus-dashboard/pack.js deleted file mode 120000 index 49387549..00000000 --- a/tutorials/tcp/modbus-dashboard/pack.js +++ /dev/null @@ -1 +0,0 @@ -../../../test/pack.js \ No newline at end of file diff --git a/tutorials/tcp/tcp/Makefile b/tutorials/tcp/tcp/Makefile index 4f8cb1a4..ecb487ba 100644 --- a/tutorials/tcp/tcp/Makefile +++ b/tutorials/tcp/tcp/Makefile @@ -23,11 +23,23 @@ endif all: $(PROG) # Default target. Build and run program $(RUN) ./$(PROG) $(ARGS) -$(PROG): $(SOURCES) # Build program from sources +$(PROG): $(SOURCES) certs/ss_ca.pem certs/ss_client.pem certs/ss_server.pem # Build program from sources $(CC) $(SOURCES) $(CFLAGS) $(CFLAGS_MONGOOSE) $(CFLAGS_EXTRA) $(OUT) +certs/ss_ca.pem: ../../../test/data/ss_ca.pem + mkdir -p certs + cp $< $@ + +certs/ss_client.pem: ../../../test/data/ss_client.pem + mkdir -p certs + cp $< $@ + +certs/ss_server.pem: ../../../test/data/ss_server.pem + mkdir -p certs + cp $< $@ + clean: # Cleanup. Delete built program and all build artifacts - $(DELETE) $(PROG) *.o *.obj *.exe *.dSYM mbedtls $(PACK) + $(DELETE) $(PROG) *.o *.obj *.exe *.dSYM mbedtls $(PACK) certs/ss_ca.pem certs/ss_client.pem certs/ss_server.pem # Generate packed filesystem for serving credentials packed_fs.c: $(wildcard certs/*) Makefile diff --git a/tutorials/tcp/tcp/certs/ss_ca.pem b/tutorials/tcp/tcp/certs/ss_ca.pem deleted file mode 120000 index 5ea4d491..00000000 --- a/tutorials/tcp/tcp/certs/ss_ca.pem +++ /dev/null @@ -1 +0,0 @@ -../../../../test/data/ss_ca.pem \ No newline at end of file diff --git a/tutorials/tcp/tcp/certs/ss_client.pem b/tutorials/tcp/tcp/certs/ss_client.pem deleted file mode 120000 index 813dbf91..00000000 --- a/tutorials/tcp/tcp/certs/ss_client.pem +++ /dev/null @@ -1 +0,0 @@ -../../../../test/data/ss_client.pem \ No newline at end of file diff --git a/tutorials/tcp/tcp/certs/ss_server.pem b/tutorials/tcp/tcp/certs/ss_server.pem deleted file mode 120000 index 30eb6889..00000000 --- a/tutorials/tcp/tcp/certs/ss_server.pem +++ /dev/null @@ -1 +0,0 @@ -../../../../test/data/ss_server.pem \ No newline at end of file diff --git a/tutorials/tcp/uart-bridge b/tutorials/tcp/uart-bridge deleted file mode 120000 index b48b430e..00000000 --- a/tutorials/tcp/uart-bridge +++ /dev/null @@ -1 +0,0 @@ -../http/uart-bridge \ No newline at end of file diff --git a/tutorials/tcpip/pcap-driver/Makefile b/tutorials/tcpip/pcap-driver/Makefile index 539beb56..dc0b52ad 100644 --- a/tutorials/tcpip/pcap-driver/Makefile +++ b/tutorials/tcpip/pcap-driver/Makefile @@ -1,8 +1,9 @@ +REPO_ROOT ?= ../../.. PROG ?= example DELETE = rm -rf OUT ?= -o $(PROG) -SOURCES = main.c mongoose.c -CFLAGS = -W -Wall -Wextra -g -I. +SOURCES = main.c $(REPO_ROOT)/mongoose.c +CFLAGS = -I$(REPO_ROOT) -W -Wall -Wextra -g -I. CFLAGS += -lpcap # Mongoose build options. See https://mongoose.ws/docs/getting-started/build-environment/ diff --git a/tutorials/tcpip/pcap-driver/mongoose.c b/tutorials/tcpip/pcap-driver/mongoose.c deleted file mode 120000 index 5e522bbc..00000000 --- a/tutorials/tcpip/pcap-driver/mongoose.c +++ /dev/null @@ -1 +0,0 @@ -../../../mongoose.c \ No newline at end of file diff --git a/tutorials/tcpip/pcap-driver/mongoose.h b/tutorials/tcpip/pcap-driver/mongoose.h deleted file mode 120000 index ee4ac823..00000000 --- a/tutorials/tcpip/pcap-driver/mongoose.h +++ /dev/null @@ -1 +0,0 @@ -../../../mongoose.h \ No newline at end of file diff --git a/tutorials/tcpip/tap-driver/Makefile b/tutorials/tcpip/tap-driver/Makefile index 5c8fc8c9..1d3fc664 100644 --- a/tutorials/tcpip/tap-driver/Makefile +++ b/tutorials/tcpip/tap-driver/Makefile @@ -1,8 +1,9 @@ +REPO_ROOT ?= ../../.. PROG ?= example # Program we are building DELETE = rm -rf # Command to remove files OUT ?= -o $(PROG) # Compiler argument for output file -SOURCES = main.c mongoose.c net.c packed_fs.c # Source code files -CFLAGS = -W -Wall -Wextra -g -I. # Build options +SOURCES = main.c $(REPO_ROOT)/mongoose.c net.c packed_fs.c # Source code files +CFLAGS = -I$(REPO_ROOT) -W -Wall -Wextra -g -I. # Build options # Mongoose build options. See https://mongoose.ws/docs/getting-started/build-environment/ CFLAGS_MONGOOSE += -DMG_ENABLE_LINES=1 -DMG_ENABLE_TCPIP=1 -DMG_ENABLE_SOCKET=0 -DMG_ENABLE_TCPIP_DRIVER_INIT=0 @@ -25,8 +26,17 @@ all: $(PROG) # Default target. Build and run program $(PROG): $(SOURCES) # Build program from sources $(CC) $(SOURCES) $(CFLAGS) $(CFLAGS_MONGOOSE) $(CFLAGS_EXTRA) $(OUT) +net.c: ../../http/device-dashboard/net.c net.h + cp $< $@ + +net.h: ../../http/device-dashboard/net.h + cp $< $@ + +packed_fs.c: ../../http/device-dashboard/packed_fs.c + cp $< $@ + clean: # Cleanup. Delete built program and all build artifacts - $(DELETE) $(PROG) *.o *.obj *.exe *.dSYM mbedtls + $(DELETE) $(PROG) *.o *.obj *.exe *.dSYM mbedtls net.c net.h packed_fs.c # see https://mongoose.ws/tutorials/tls/#how-to-build for TLS build options diff --git a/tutorials/tcpip/tap-driver/mongoose.c b/tutorials/tcpip/tap-driver/mongoose.c deleted file mode 120000 index 5e522bbc..00000000 --- a/tutorials/tcpip/tap-driver/mongoose.c +++ /dev/null @@ -1 +0,0 @@ -../../../mongoose.c \ No newline at end of file diff --git a/tutorials/tcpip/tap-driver/mongoose.h b/tutorials/tcpip/tap-driver/mongoose.h deleted file mode 120000 index ee4ac823..00000000 --- a/tutorials/tcpip/tap-driver/mongoose.h +++ /dev/null @@ -1 +0,0 @@ -../../../mongoose.h \ No newline at end of file diff --git a/tutorials/tcpip/tap-driver/net.c b/tutorials/tcpip/tap-driver/net.c deleted file mode 120000 index d40995ff..00000000 --- a/tutorials/tcpip/tap-driver/net.c +++ /dev/null @@ -1 +0,0 @@ -../../http/device-dashboard/net.c \ No newline at end of file diff --git a/tutorials/tcpip/tap-driver/net.h b/tutorials/tcpip/tap-driver/net.h deleted file mode 120000 index 290e3068..00000000 --- a/tutorials/tcpip/tap-driver/net.h +++ /dev/null @@ -1 +0,0 @@ -../../http/device-dashboard/net.h \ No newline at end of file diff --git a/tutorials/tcpip/tap-driver/packed_fs.c b/tutorials/tcpip/tap-driver/packed_fs.c deleted file mode 120000 index 41f8c7d9..00000000 --- a/tutorials/tcpip/tap-driver/packed_fs.c +++ /dev/null @@ -1 +0,0 @@ -../../http/device-dashboard/packed_fs.c \ No newline at end of file diff --git a/tutorials/ti/ek-tm4c1294xl-make-baremetal-builtin-rndis/Makefile b/tutorials/ti/ek-tm4c1294xl-make-baremetal-builtin-rndis/Makefile index 9ebe119a..d4411a0a 100644 --- a/tutorials/ti/ek-tm4c1294xl-make-baremetal-builtin-rndis/Makefile +++ b/tutorials/ti/ek-tm4c1294xl-make-baremetal-builtin-rndis/Makefile @@ -1,4 +1,5 @@ -CFLAGS = -W -Wall -Wextra -Werror -Wundef -Wshadow -Wdouble-promotion +REPO_ROOT ?= ../../.. +CFLAGS = -I$(REPO_ROOT) -W -Wall -Wextra -Werror -Wundef -Wshadow -Wdouble-promotion CFLAGS += -Wformat-truncation -fno-common -Wconversion -Wno-sign-conversion CFLAGS += -g3 -Os -ffunction-sections -fdata-sections CFLAGS += -I. -Icmsis_core/CMSIS/Core/Include -Icmsis_tm4c/Device/TI/TM4C/Include @@ -23,7 +24,7 @@ CFLAGS += -DTM4C1294NCPDT CFLAGS += -Wno-conversion -Wno-sign-conversion # Mongoose options are defined in mongoose_config.h -SOURCES += mongoose.c +SOURCES += $(REPO_ROOT)/mongoose.c ifeq ($(OS),Windows_NT) RM = cmd /C del /Q /F /S diff --git a/tutorials/ti/ek-tm4c1294xl-make-baremetal-builtin-rndis/mongoose.c b/tutorials/ti/ek-tm4c1294xl-make-baremetal-builtin-rndis/mongoose.c deleted file mode 120000 index 5e522bbc..00000000 --- a/tutorials/ti/ek-tm4c1294xl-make-baremetal-builtin-rndis/mongoose.c +++ /dev/null @@ -1 +0,0 @@ -../../../mongoose.c \ No newline at end of file diff --git a/tutorials/ti/ek-tm4c1294xl-make-baremetal-builtin-rndis/mongoose.h b/tutorials/ti/ek-tm4c1294xl-make-baremetal-builtin-rndis/mongoose.h deleted file mode 120000 index ee4ac823..00000000 --- a/tutorials/ti/ek-tm4c1294xl-make-baremetal-builtin-rndis/mongoose.h +++ /dev/null @@ -1 +0,0 @@ -../../../mongoose.h \ No newline at end of file diff --git a/tutorials/wch/ch32v307-make-baremetal-builtin/Makefile b/tutorials/wch/ch32v307-make-baremetal-builtin/Makefile index 14b77f43..96f285ef 100644 --- a/tutorials/wch/ch32v307-make-baremetal-builtin/Makefile +++ b/tutorials/wch/ch32v307-make-baremetal-builtin/Makefile @@ -8,10 +8,10 @@ PREFIX ?= riscv-none-elf CFLAGS = -W -Wall -Wextra -Wundef -Wshadow -Wdouble-promotion CFLAGS += -Wformat-truncation -Wconversion -Wno-sign-conversion CFLAGS += -ffunction-sections -fdata-sections -fno-common -CFLAGS += -DSYSCLK_FREQ_144MHz_HSE -I. -Ivendor -g3 -Os +CFLAGS += -DSYSCLK_FREQ_144MHz_HSE -I$(ROOT) -I. -Ivendor -g3 -Os CFLAGS += -march=rv32imafc -mabi=ilp32 LDFLAGS = -T vendor/link.ld -nostartfiles --specs=nano.specs --specs=nosys.specs -Wl,--gc-sections -SOURCES = hal.c main.c mongoose.c net.c packed_fs.c +SOURCES = hal.c main.c $(ROOT)/mongoose.c net.c packed_fs.c SOURCES += vendor/system_ch32v30x.c vendor/startup_ch32v30x_D8C.S CFLAGS += -DHTTP_URL=\"http://0.0.0.0/\" -DHTTPS_URL=\"https://0.0.0.0/\" @@ -34,8 +34,17 @@ flash: firmware.bin wchisp flash $< # @echo; echo "IMPORTANT: configure device to 96k RAM / 224k Flash" +net.c: ../../tcp/modbus-dashboard/net.c net.h + cp $< $@ + +net.h: ../../tcp/modbus-dashboard/net.h + cp $< $@ + +packed_fs.c: ../../tcp/modbus-dashboard/packed_fs.c + cp $< $@ + zip: firmware.bin zip -r ch32v307.modbus.firmware.`date +%Y-%m-%d`.zip firmware.* clean: - $(RM) firmware.* *.zip + $(RM) firmware.* *.zip net.c net.h packed_fs.c diff --git a/tutorials/wch/ch32v307-make-baremetal-builtin/mongoose.c b/tutorials/wch/ch32v307-make-baremetal-builtin/mongoose.c deleted file mode 120000 index 5e522bbc..00000000 --- a/tutorials/wch/ch32v307-make-baremetal-builtin/mongoose.c +++ /dev/null @@ -1 +0,0 @@ -../../../mongoose.c \ No newline at end of file diff --git a/tutorials/wch/ch32v307-make-baremetal-builtin/mongoose.h b/tutorials/wch/ch32v307-make-baremetal-builtin/mongoose.h deleted file mode 120000 index ee4ac823..00000000 --- a/tutorials/wch/ch32v307-make-baremetal-builtin/mongoose.h +++ /dev/null @@ -1 +0,0 @@ -../../../mongoose.h \ No newline at end of file diff --git a/tutorials/wch/ch32v307-make-baremetal-builtin/net.c b/tutorials/wch/ch32v307-make-baremetal-builtin/net.c deleted file mode 120000 index 51b118db..00000000 --- a/tutorials/wch/ch32v307-make-baremetal-builtin/net.c +++ /dev/null @@ -1 +0,0 @@ -../../tcp/modbus-dashboard/net.c \ No newline at end of file diff --git a/tutorials/wch/ch32v307-make-baremetal-builtin/net.h b/tutorials/wch/ch32v307-make-baremetal-builtin/net.h deleted file mode 120000 index f3ba9bb3..00000000 --- a/tutorials/wch/ch32v307-make-baremetal-builtin/net.h +++ /dev/null @@ -1 +0,0 @@ -../../tcp/modbus-dashboard/net.h \ No newline at end of file diff --git a/tutorials/wch/ch32v307-make-baremetal-builtin/packed_fs.c b/tutorials/wch/ch32v307-make-baremetal-builtin/packed_fs.c deleted file mode 120000 index 46f3841e..00000000 --- a/tutorials/wch/ch32v307-make-baremetal-builtin/packed_fs.c +++ /dev/null @@ -1 +0,0 @@ -../../tcp/modbus-dashboard/packed_fs.c \ No newline at end of file diff --git a/tutorials/websocket/uart-bridge b/tutorials/websocket/uart-bridge deleted file mode 120000 index b48b430e..00000000 --- a/tutorials/websocket/uart-bridge +++ /dev/null @@ -1 +0,0 @@ -../http/uart-bridge \ No newline at end of file diff --git a/tutorials/webui/webui-preact/Makefile b/tutorials/webui/webui-preact/Makefile index 20d69d48..d0409faf 100644 --- a/tutorials/webui/webui-preact/Makefile +++ b/tutorials/webui/webui-preact/Makefile @@ -23,5 +23,8 @@ all: $(PROG) # Default target. Build and run program $(PROG): $(SOURCES) # Build program from sources $(CC) $(SOURCES) $(CFLAGS) $(CFLAGS_MONGOOSE) $(CFLAGS_EXTRA) $(OUT) +main.c: ../webui-plain/main.c + cp $< $@ + clean: # Cleanup. Delete built program and all build artifacts - $(DELETE) $(PROG) *.o *.obj *.exe *.dSYM + $(DELETE) $(PROG) *.o *.obj *.exe *.dSYM main.c diff --git a/tutorials/webui/webui-preact/main.c b/tutorials/webui/webui-preact/main.c deleted file mode 120000 index 5f0bdc78..00000000 --- a/tutorials/webui/webui-preact/main.c +++ /dev/null @@ -1 +0,0 @@ -../webui-plain/main.c \ No newline at end of file diff --git a/tutorials/zephyr/device-dashboard/README.md b/tutorials/zephyr/device-dashboard/README.md deleted file mode 120000 index 32d46ee8..00000000 --- a/tutorials/zephyr/device-dashboard/README.md +++ /dev/null @@ -1 +0,0 @@ -../README.md \ No newline at end of file diff --git a/tutorials/zephyr/device-dashboard/README.md b/tutorials/zephyr/device-dashboard/README.md new file mode 100644 index 00000000..7d2078c5 --- /dev/null +++ b/tutorials/zephyr/device-dashboard/README.md @@ -0,0 +1,15 @@ +# Zephyr Project examples + +- See detailed tutorial at https://mongoose.ws/tutorials/zephyr/device-dashboard/ + +The tutorial is specific for the Device Dashboard example but [build instructions](https://mongoose.ws/tutorials/zephyr/device-dashboard/#build-and-run) are generic + + +## Optional: Using a simulated board + +For testing purposes, we build for an x86 target that can be simulated with QEMU, and runs inside a _Docker_ container. Its Ethernet interface is also simulated, and uses the TUN/TAP interface. You can use this to try the examples or for your own development with Zephyr, without the need to have an actual board connected; you only need to have _Docker_ installed as the Zephyr Docker image handles the emulation for you. + +- You'll need a TUN/TAP interface (default name is _tap0_) on your host machine; follow the instructions [here](https://github.com/cesanta/mongoose/tree/master/examples/mip-tap#linux-setup) to configure your network to provide a suitable networking environment. +- Run `make build BUILD_ARGS="-b qemu_x86" OVERLAY="-DOVERLAY_CONFIG=overlay-e1000.conf"`. + - The interface configuration on the simulated machine side is in the file _overlay-e1000.conf_, and defaults to _tap0_. You can change this file or specify a different one by changing the `OVERLAY_CONFIG` argument above. +- Once the build succeeds, run `make run` to run the target. The default _Docker_ configuration is to share _/dev/net/tun_; if this does not work for you, pass the necessary _Docker_ parameters to _make_ with a `DOCKER_ARGS=` argument. diff --git a/tutorials/zephyr/http-client/README.md b/tutorials/zephyr/http-client/README.md deleted file mode 120000 index 32d46ee8..00000000 --- a/tutorials/zephyr/http-client/README.md +++ /dev/null @@ -1 +0,0 @@ -../README.md \ No newline at end of file diff --git a/tutorials/zephyr/http-client/README.md b/tutorials/zephyr/http-client/README.md new file mode 100644 index 00000000..7d2078c5 --- /dev/null +++ b/tutorials/zephyr/http-client/README.md @@ -0,0 +1,15 @@ +# Zephyr Project examples + +- See detailed tutorial at https://mongoose.ws/tutorials/zephyr/device-dashboard/ + +The tutorial is specific for the Device Dashboard example but [build instructions](https://mongoose.ws/tutorials/zephyr/device-dashboard/#build-and-run) are generic + + +## Optional: Using a simulated board + +For testing purposes, we build for an x86 target that can be simulated with QEMU, and runs inside a _Docker_ container. Its Ethernet interface is also simulated, and uses the TUN/TAP interface. You can use this to try the examples or for your own development with Zephyr, without the need to have an actual board connected; you only need to have _Docker_ installed as the Zephyr Docker image handles the emulation for you. + +- You'll need a TUN/TAP interface (default name is _tap0_) on your host machine; follow the instructions [here](https://github.com/cesanta/mongoose/tree/master/examples/mip-tap#linux-setup) to configure your network to provide a suitable networking environment. +- Run `make build BUILD_ARGS="-b qemu_x86" OVERLAY="-DOVERLAY_CONFIG=overlay-e1000.conf"`. + - The interface configuration on the simulated machine side is in the file _overlay-e1000.conf_, and defaults to _tap0_. You can change this file or specify a different one by changing the `OVERLAY_CONFIG` argument above. +- Once the build succeeds, run `make run` to run the target. The default _Docker_ configuration is to share _/dev/net/tun_; if this does not work for you, pass the necessary _Docker_ parameters to _make_ with a `DOCKER_ARGS=` argument. diff --git a/tutorials/zephyr/http-server/README.md b/tutorials/zephyr/http-server/README.md deleted file mode 120000 index 32d46ee8..00000000 --- a/tutorials/zephyr/http-server/README.md +++ /dev/null @@ -1 +0,0 @@ -../README.md \ No newline at end of file diff --git a/tutorials/zephyr/http-server/README.md b/tutorials/zephyr/http-server/README.md new file mode 100644 index 00000000..7d2078c5 --- /dev/null +++ b/tutorials/zephyr/http-server/README.md @@ -0,0 +1,15 @@ +# Zephyr Project examples + +- See detailed tutorial at https://mongoose.ws/tutorials/zephyr/device-dashboard/ + +The tutorial is specific for the Device Dashboard example but [build instructions](https://mongoose.ws/tutorials/zephyr/device-dashboard/#build-and-run) are generic + + +## Optional: Using a simulated board + +For testing purposes, we build for an x86 target that can be simulated with QEMU, and runs inside a _Docker_ container. Its Ethernet interface is also simulated, and uses the TUN/TAP interface. You can use this to try the examples or for your own development with Zephyr, without the need to have an actual board connected; you only need to have _Docker_ installed as the Zephyr Docker image handles the emulation for you. + +- You'll need a TUN/TAP interface (default name is _tap0_) on your host machine; follow the instructions [here](https://github.com/cesanta/mongoose/tree/master/examples/mip-tap#linux-setup) to configure your network to provide a suitable networking environment. +- Run `make build BUILD_ARGS="-b qemu_x86" OVERLAY="-DOVERLAY_CONFIG=overlay-e1000.conf"`. + - The interface configuration on the simulated machine side is in the file _overlay-e1000.conf_, and defaults to _tap0_. You can change this file or specify a different one by changing the `OVERLAY_CONFIG` argument above. +- Once the build succeeds, run `make run` to run the target. The default _Docker_ configuration is to share _/dev/net/tun_; if this does not work for you, pass the necessary _Docker_ parameters to _make_ with a `DOCKER_ARGS=` argument. diff --git a/tutorials/zephyr/mqtt-aws-client/README.md b/tutorials/zephyr/mqtt-aws-client/README.md deleted file mode 120000 index 32d46ee8..00000000 --- a/tutorials/zephyr/mqtt-aws-client/README.md +++ /dev/null @@ -1 +0,0 @@ -../README.md \ No newline at end of file diff --git a/tutorials/zephyr/mqtt-aws-client/README.md b/tutorials/zephyr/mqtt-aws-client/README.md new file mode 100644 index 00000000..7d2078c5 --- /dev/null +++ b/tutorials/zephyr/mqtt-aws-client/README.md @@ -0,0 +1,15 @@ +# Zephyr Project examples + +- See detailed tutorial at https://mongoose.ws/tutorials/zephyr/device-dashboard/ + +The tutorial is specific for the Device Dashboard example but [build instructions](https://mongoose.ws/tutorials/zephyr/device-dashboard/#build-and-run) are generic + + +## Optional: Using a simulated board + +For testing purposes, we build for an x86 target that can be simulated with QEMU, and runs inside a _Docker_ container. Its Ethernet interface is also simulated, and uses the TUN/TAP interface. You can use this to try the examples or for your own development with Zephyr, without the need to have an actual board connected; you only need to have _Docker_ installed as the Zephyr Docker image handles the emulation for you. + +- You'll need a TUN/TAP interface (default name is _tap0_) on your host machine; follow the instructions [here](https://github.com/cesanta/mongoose/tree/master/examples/mip-tap#linux-setup) to configure your network to provide a suitable networking environment. +- Run `make build BUILD_ARGS="-b qemu_x86" OVERLAY="-DOVERLAY_CONFIG=overlay-e1000.conf"`. + - The interface configuration on the simulated machine side is in the file _overlay-e1000.conf_, and defaults to _tap0_. You can change this file or specify a different one by changing the `OVERLAY_CONFIG` argument above. +- Once the build succeeds, run `make run` to run the target. The default _Docker_ configuration is to share _/dev/net/tun_; if this does not work for you, pass the necessary _Docker_ parameters to _make_ with a `DOCKER_ARGS=` argument. diff --git a/tutorials/zephyr/websocket-server/README.md b/tutorials/zephyr/websocket-server/README.md deleted file mode 120000 index 32d46ee8..00000000 --- a/tutorials/zephyr/websocket-server/README.md +++ /dev/null @@ -1 +0,0 @@ -../README.md \ No newline at end of file diff --git a/tutorials/zephyr/websocket-server/README.md b/tutorials/zephyr/websocket-server/README.md new file mode 100644 index 00000000..7d2078c5 --- /dev/null +++ b/tutorials/zephyr/websocket-server/README.md @@ -0,0 +1,15 @@ +# Zephyr Project examples + +- See detailed tutorial at https://mongoose.ws/tutorials/zephyr/device-dashboard/ + +The tutorial is specific for the Device Dashboard example but [build instructions](https://mongoose.ws/tutorials/zephyr/device-dashboard/#build-and-run) are generic + + +## Optional: Using a simulated board + +For testing purposes, we build for an x86 target that can be simulated with QEMU, and runs inside a _Docker_ container. Its Ethernet interface is also simulated, and uses the TUN/TAP interface. You can use this to try the examples or for your own development with Zephyr, without the need to have an actual board connected; you only need to have _Docker_ installed as the Zephyr Docker image handles the emulation for you. + +- You'll need a TUN/TAP interface (default name is _tap0_) on your host machine; follow the instructions [here](https://github.com/cesanta/mongoose/tree/master/examples/mip-tap#linux-setup) to configure your network to provide a suitable networking environment. +- Run `make build BUILD_ARGS="-b qemu_x86" OVERLAY="-DOVERLAY_CONFIG=overlay-e1000.conf"`. + - The interface configuration on the simulated machine side is in the file _overlay-e1000.conf_, and defaults to _tap0_. You can change this file or specify a different one by changing the `OVERLAY_CONFIG` argument above. +- Once the build succeeds, run `make run` to run the target. The default _Docker_ configuration is to share _/dev/net/tun_; if this does not work for you, pass the necessary _Docker_ parameters to _make_ with a `DOCKER_ARGS=` argument.