mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-12 16:50:21 +00:00
132 files changed
+303
-165
No files matched your search
+34
-5
@@ -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
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../../../mongoose.c
|
||||
@@ -1 +0,0 @@
|
||||
../../../mongoose.h
|
||||
@@ -1 +0,0 @@
|
||||
../../../mongoose.c
|
||||
@@ -1 +0,0 @@
|
||||
../../../mongoose.h
|
||||
@@ -1 +0,0 @@
|
||||
../../../mongoose.c
|
||||
@@ -1 +0,0 @@
|
||||
../../../mongoose.h
|
||||
@@ -1 +0,0 @@
|
||||
../../../mongoose.c
|
||||
@@ -1 +0,0 @@
|
||||
../../../mongoose.h
|
||||
@@ -1 +0,0 @@
|
||||
../../../mongoose.c
|
||||
@@ -1 +0,0 @@
|
||||
../../../mongoose.h
|
||||
@@ -1 +0,0 @@
|
||||
../../http/device-dashboard/net.c
|
||||
@@ -1 +0,0 @@
|
||||
../../http/device-dashboard/net.h
|
||||
@@ -1 +0,0 @@
|
||||
../../http/device-dashboard/packed_fs.c
|
||||
@@ -1 +0,0 @@
|
||||
../../../mongoose.c
|
||||
@@ -1 +0,0 @@
|
||||
../../../mongoose.h
|
||||
@@ -1 +0,0 @@
|
||||
../../../mongoose.c
|
||||
@@ -1 +0,0 @@
|
||||
../../../mongoose.h
|
||||
@@ -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/
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../../../mongoose.c
|
||||
@@ -1 +0,0 @@
|
||||
../../../mongoose.h
|
||||
@@ -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
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../../../../mongoose.c
|
||||
@@ -1 +0,0 @@
|
||||
../../../../mongoose.h
|
||||
@@ -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 +=
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../../../mongoose.c
|
||||
@@ -1 +0,0 @@
|
||||
../../../mongoose.h
|
||||
@@ -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 +=
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../../../mongoose.c
|
||||
@@ -1 +0,0 @@
|
||||
../../../mongoose.h
|
||||
@@ -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
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../../../mongoose.c
|
||||
@@ -1 +0,0 @@
|
||||
../../../mongoose.h
|
||||
@@ -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
|
||||
@@ -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")
|
||||
@@ -1 +0,0 @@
|
||||
../../../../mongoose.c
|
||||
@@ -1 +0,0 @@
|
||||
../../../../mongoose.h
|
||||
@@ -1 +0,0 @@
|
||||
../../../http/device-dashboard/net.c
|
||||
@@ -1 +0,0 @@
|
||||
../../../http/device-dashboard/net.h
|
||||
@@ -1 +0,0 @@
|
||||
../../../http/device-dashboard/packed_fs.c
|
||||
@@ -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
|
||||
@@ -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)
|
||||
@@ -1 +0,0 @@
|
||||
../../../../mongoose.c
|
||||
@@ -1 +0,0 @@
|
||||
../../../../mongoose.h
|
||||
@@ -1 +0,0 @@
|
||||
../../../http/uart-bridge/net.c
|
||||
@@ -1 +0,0 @@
|
||||
../../../http/uart-bridge/packed_fs.c
|
||||
@@ -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 $@
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../../../test/pack.js
|
||||
@@ -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
|
||||
@@ -1 +0,0 @@
|
||||
../../../../test/data/ca.pem
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../http-client/packed_fs.c
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../http-client/packed_fs.c
|
||||
@@ -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
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../../../test/certs
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../http-client/packed_fs.c
|
||||
@@ -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
|
||||
@@ -1 +0,0 @@
|
||||
../../../test/pack.js
|
||||
@@ -1 +0,0 @@
|
||||
../../device-dashboard/web_root/bundle.js
|
||||
@@ -1 +0,0 @@
|
||||
../../device-dashboard/web_root/components.js
|
||||
@@ -1 +0,0 @@
|
||||
../../device-dashboard/web_root/history.min.js
|
||||
@@ -1 +0,0 @@
|
||||
../../device-dashboard/web_root/index.html
|
||||
@@ -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
|
||||
@@ -1 +0,0 @@
|
||||
../../../../mongoose.c
|
||||
@@ -1 +0,0 @@
|
||||
../../../../mongoose.h
|
||||
@@ -1 +0,0 @@
|
||||
../../../http/device-dashboard/net.c
|
||||
@@ -1 +0,0 @@
|
||||
../../../http/device-dashboard/net.h
|
||||
@@ -1 +0,0 @@
|
||||
../../../http/device-dashboard/packed_fs.c
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../../../../mongoose.c
|
||||
@@ -1 +0,0 @@
|
||||
../../../../mongoose.h
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../../mongoose/micropython.cmake
|
||||
@@ -1 +0,0 @@
|
||||
../../mongoose/micropython.mk
|
||||
@@ -1 +0,0 @@
|
||||
../../mongoose/module.c
|
||||
@@ -1 +0,0 @@
|
||||
../../../../mongoose.c
|
||||
@@ -1 +0,0 @@
|
||||
../../../../mongoose.h
|
||||
@@ -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.
|
||||
|
||||
@@ -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)/../../..
|
||||
@@ -1 +0,0 @@
|
||||
../../../mongoose.c
|
||||
@@ -1 +0,0 @@
|
||||
../../../mongoose.h
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../../http/http-client/packed_fs.c
|
||||
@@ -1 +0,0 @@
|
||||
../../../../mongoose.c
|
||||
@@ -1 +0,0 @@
|
||||
../../../../mongoose.h
|
||||
@@ -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
|
||||
@@ -1 +0,0 @@
|
||||
../../../mongoose.c
|
||||
@@ -1 +0,0 @@
|
||||
../../../mongoose.h
|
||||
@@ -1 +0,0 @@
|
||||
../../http/device-dashboard/net.c
|
||||
@@ -1 +0,0 @@
|
||||
../../http/device-dashboard/net.h
|
||||
@@ -1 +0,0 @@
|
||||
../../http/device-dashboard/packed_fs.c
|
||||
@@ -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
|
||||
@@ -1 +0,0 @@
|
||||
../../mqtt/mqtt-dashboard/device/net.c
|
||||
@@ -1 +0,0 @@
|
||||
../../mqtt/mqtt-dashboard/device/net.h
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../../http/http-client/packed_fs.c
|
||||
@@ -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/*
|
||||
@@ -1 +0,0 @@
|
||||
../../http/device-dashboard/certs
|
||||
Loaded 100 of 132 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user