mirror of
https://github.com/cesanta/mongoose.git
synced 2024-11-27 20:59:00 +08:00
update Makefiles and symlinks
This commit is contained in:
parent
d0e5690bfd
commit
5b46986628
@ -1 +1,2 @@
|
|||||||
See detailed tutorial at https://mongoose.ws/tutorials/mqtt-client-aws-iot/
|
- This example requires generating AWS and user credentials and downloading certificates
|
||||||
|
- This example requires building with TLS support; before running, see detailed tutorial at https://mongoose.ws/tutorials/mqtt-client-aws-iot/
|
||||||
|
@ -1,20 +1,32 @@
|
|||||||
PROG ?= example
|
PROG ?= example # Program we are building
|
||||||
CFLAGS ?= -W -Wall -Wextra -O2 $(EXTRA_CFLAGS)
|
DELETE = rm -rf # Command to remove files
|
||||||
SSL ?= MBEDTLS
|
OUT ?= -o $(PROG) # Compiler argument for output file
|
||||||
|
SOURCES = main.c mongoose.c # Source code files
|
||||||
|
CFLAGS = -W -Wall -Wextra -g -I. # Build options
|
||||||
|
|
||||||
ifeq "$(SSL)" "MBEDTLS"
|
# Mongoose build options. See https://mongoose.ws/documentation/#build-options
|
||||||
CFLAGS += -DMG_ENABLE_MBEDTLS=1 -lmbedtls -lmbedcrypto -lmbedx509 -L$(MBEDTLS)/lib -I$(MBEDTLS)/include
|
#CFLAGS_MONGOOSE += -DMG_ENABLE_LINES=1
|
||||||
|
|
||||||
|
ifeq ($(OS),Windows_NT) # Windows settings. Assume MinGW compiler. To use VC: make CC=cl CFLAGS=/MD OUT=/Feprog.exe
|
||||||
|
PROG ?= example.exe # Use .exe suffix for the binary
|
||||||
|
CC = gcc # Use MinGW gcc compiler
|
||||||
|
CFLAGS += -lws2_32 # Link against Winsock library
|
||||||
|
DELETE = cmd /C del /Q /F /S # Command prompt command to delete files
|
||||||
|
OUT ?= -o $(PROG) # Build output
|
||||||
|
MAKE += WINDOWS=1 CC=$(CC)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq "$(SSL)" "OPENSSL"
|
all: $(PROG) # Default target. Build and run program
|
||||||
CFLAGS += -DMG_ENABLE_OPENSSL=1 -lssl -lcrypto -L$(OPENSSL)/lib -I$(OPENSSL)/include
|
|
||||||
endif
|
|
||||||
|
|
||||||
all: $(PROG)
|
|
||||||
$(RUN) ./$(PROG) $(ARGS)
|
$(RUN) ./$(PROG) $(ARGS)
|
||||||
|
|
||||||
$(PROG): main.c
|
$(PROG): $(SOURCES) # Build program from sources
|
||||||
$(CC) ../../mongoose.c -I../.. $(CFLAGS) -o $(PROG) main.c
|
$(CC) $(SOURCES) $(CFLAGS) $(CFLAGS_MONGOOSE) $(CFLAGS_EXTRA) $(OUT)
|
||||||
|
|
||||||
clean:
|
clean: # Cleanup. Delete built program and all build artifacts
|
||||||
rm -rf $(PROG) _CL* *.o *.dSYM *.gcov *.gcno *.gcda *.obj *.exe *.ilk *.pdb mbedtls
|
$(DELETE) $(PROG) *.o *.obj *.exe *.dSYM mbedtls
|
||||||
|
|
||||||
|
# see https://mongoose.ws/tutorials/tls/#how-to-build for TLS build options
|
||||||
|
|
||||||
|
mbedtls: # Pull and build mbedTLS library
|
||||||
|
git clone --depth 1 -b v2.28.2 https://github.com/mbed-tls/mbedtls $@
|
||||||
|
$(MAKE) -C mbedtls/library
|
||||||
|
@ -1,5 +1,2 @@
|
|||||||
# SMTP client example
|
- This example requires changing server name and user credentials on `main.c`
|
||||||
|
- This example requires building with TLS support; before running, see detailed tutorial at https://mongoose.ws/tutorials/smtp-client/
|
||||||
This example shows how to send emails using Mongoose.
|
|
||||||
Before running this example, open main.c and modify settings at the top
|
|
||||||
of the file.
|
|
||||||
|
1
examples/smtp-client/mongoose.c
Symbolic link
1
examples/smtp-client/mongoose.c
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../mongoose.c
|
1
examples/smtp-client/mongoose.h
Symbolic link
1
examples/smtp-client/mongoose.h
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../mongoose.h
|
@ -1,10 +1,25 @@
|
|||||||
PROG ?= example
|
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
|
||||||
|
|
||||||
all: $(PROG)
|
# Mongoose build options. See https://mongoose.ws/documentation/#build-options
|
||||||
|
CFLAGS_MONGOOSE += -DMG_ENABLE_LINES
|
||||||
|
|
||||||
|
ifeq ($(OS),Windows_NT) # Windows settings. Assume MinGW compiler. To use VC: make CC=cl CFLAGS=/MD OUT=/Feprog.exe
|
||||||
|
PROG ?= example.exe # Use .exe suffix for the binary
|
||||||
|
CC = gcc # Use MinGW gcc compiler
|
||||||
|
CFLAGS += -lws2_32 # Link against Winsock library
|
||||||
|
DELETE = cmd /C del /Q /F /S # Command prompt command to delete files
|
||||||
|
OUT ?= -o $(PROG) # Build output
|
||||||
|
endif
|
||||||
|
|
||||||
|
all: $(PROG) # Default target. Build and run program
|
||||||
$(RUN) ./$(PROG) $(ARGS)
|
$(RUN) ./$(PROG) $(ARGS)
|
||||||
|
|
||||||
$(PROG): main.c
|
$(PROG): $(SOURCES) # Build program from sources
|
||||||
$(CC) ../../mongoose.c -I../.. -W -Wall -DMG_ENABLE_LINES=1 $(CFLAGS) -o $(PROG) main.c
|
$(CC) $(SOURCES) $(CFLAGS) $(CFLAGS_MONGOOSE) $(CFLAGS_EXTRA) $(OUT)
|
||||||
|
|
||||||
clean:
|
clean: # Cleanup. Delete built program and all build artifacts
|
||||||
rm -rf $(PROG) *.o *.dSYM *.gcov *.gcno *.gcda *.obj *.exe *.ilk *.pdb
|
$(DELETE) $(PROG) *.o *.obj *.exe *.dSYM
|
||||||
|
1
examples/sntp-time-sync/mongoose.c
Symbolic link
1
examples/sntp-time-sync/mongoose.c
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../mongoose.c
|
1
examples/sntp-time-sync/mongoose.h
Symbolic link
1
examples/sntp-time-sync/mongoose.h
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../mongoose.h
|
@ -1,19 +1,25 @@
|
|||||||
PROG ?= example
|
PROG ?= example # Program we are building
|
||||||
CFLAGS ?= -DMG_ENABLE_LINES $(CFLAGS_EXTRA)
|
DELETE = rm -rf # Command to remove files
|
||||||
MBEDTLS_DIR ?=
|
OUT ?= -o $(PROG) # Compiler argument for output file
|
||||||
|
SOURCES = main.c mongoose.c # Source code files
|
||||||
|
CFLAGS = -W -Wall -Wextra -g -I. # Build options
|
||||||
|
|
||||||
ifeq "$(MBEDTLS_DIR)" ""
|
# Mongoose build options. See https://mongoose.ws/documentation/#build-options
|
||||||
else
|
CFLAGS_MONGOOSE += -DMG_ENABLE_LINES
|
||||||
CFLAGS += -DMG_ENABLE_MBEDTLS=1 -I$(MBEDTLS_DIR)/include -I/usr/include
|
|
||||||
CFLAGS += -L$(MBEDTLS_DIR)/lib -lmbedtls -lmbedcrypto -lmbedx509
|
ifeq ($(OS),Windows_NT) # Windows settings. Assume MinGW compiler. To use VC: make CC=cl CFLAGS=/MD OUT=/Feprog.exe
|
||||||
|
PROG ?= example.exe # Use .exe suffix for the binary
|
||||||
|
CC = gcc # Use MinGW gcc compiler
|
||||||
|
CFLAGS += -lws2_32 # Link against Winsock library
|
||||||
|
DELETE = cmd /C del /Q /F /S # Command prompt command to delete files
|
||||||
|
OUT ?= -o $(PROG) # Build output
|
||||||
endif
|
endif
|
||||||
|
|
||||||
all: $(PROG)
|
all: $(PROG) # Default target. Build and run program
|
||||||
$(DEBUGGER) ./$(PROG) $(ARGS)
|
$(RUN) ./$(PROG) $(ARGS)
|
||||||
|
|
||||||
|
$(PROG): $(SOURCES) # Build program from sources
|
||||||
|
$(CC) $(SOURCES) $(CFLAGS) $(CFLAGS_MONGOOSE) $(CFLAGS_EXTRA) $(OUT)
|
||||||
|
|
||||||
$(PROG): main.c
|
clean: # Cleanup. Delete built program and all build artifacts
|
||||||
$(CC) ../../mongoose.c -I../.. -W -Wall $(CFLAGS) -o $(PROG) main.c
|
$(DELETE) $(PROG) *.o *.obj *.exe *.dSYM
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -rf $(PROG) *.o *.dSYM *.gcov *.gcno *.gcda *.obj *.exe *.ilk *.pdb
|
|
||||||
|
1
examples/socks5-server/mongoose.c
Symbolic link
1
examples/socks5-server/mongoose.c
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../mongoose.c
|
1
examples/socks5-server/mongoose.h
Symbolic link
1
examples/socks5-server/mongoose.h
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../mongoose.h
|
@ -1,20 +1,32 @@
|
|||||||
PROG ?= example
|
PROG ?= example # Program we are building
|
||||||
SSL = ?
|
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
|
||||||
|
|
||||||
ifeq "$(SSL)" "MBEDTLS"
|
# Mongoose build options. See https://mongoose.ws/documentation/#build-options
|
||||||
CFLAGS += -DMG_ENABLE_MBEDTLS=1 -lmbedtls -lmbedcrypto -lmbedx509
|
#CFLAGS_MONGOOSE += -DMG_ENABLE_LINES=1
|
||||||
|
|
||||||
|
ifeq ($(OS),Windows_NT) # Windows settings. Assume MinGW compiler. To use VC: make CC=cl CFLAGS=/MD OUT=/Feprog.exe
|
||||||
|
PROG ?= example.exe # Use .exe suffix for the binary
|
||||||
|
CC = gcc # Use MinGW gcc compiler
|
||||||
|
CFLAGS += -lws2_32 # Link against Winsock library
|
||||||
|
DELETE = cmd /C del /Q /F /S # Command prompt command to delete files
|
||||||
|
OUT ?= -o $(PROG) # Build output
|
||||||
|
MAKE += WINDOWS=1 CC=$(CC)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq "$(SSL)" "OPENSSL"
|
all: $(PROG) # Default target. Build and run program
|
||||||
CFLAGS += -DMG_ENABLE_OPENSSL=1 -lssl -lcrypto
|
$(RUN) ./$(PROG) $(ARGS)
|
||||||
endif
|
|
||||||
|
|
||||||
all: $(PROG)
|
$(PROG): $(SOURCES) # Build program from sources
|
||||||
$(DEBUGGER) ./$(PROG) $(ARGS)
|
$(CC) $(SOURCES) $(CFLAGS) $(CFLAGS_MONGOOSE) $(CFLAGS_EXTRA) $(OUT)
|
||||||
|
|
||||||
|
clean: # Cleanup. Delete built program and all build artifacts
|
||||||
|
$(DELETE) $(PROG) *.o *.obj *.exe *.dSYM mbedtls
|
||||||
|
|
||||||
$(PROG): main.c
|
# see https://mongoose.ws/tutorials/tls/#how-to-build for TLS build options
|
||||||
$(CC) ../../mongoose.c -I../.. -W -Wall $(CFLAGS) $(EXTRA_CFLAGS) -o $(PROG) main.c
|
|
||||||
|
|
||||||
clean:
|
mbedtls: # Pull and build mbedTLS library
|
||||||
rm -rf $(PROG) *.o *.dSYM *.gcov *.gcno *.gcda *.obj *.exe *.ilk *.pdb
|
git clone --depth 1 -b v2.28.2 https://github.com/mbed-tls/mbedtls $@
|
||||||
|
$(MAKE) -C mbedtls/library
|
||||||
|
1
examples/tcp/mongoose.c
Symbolic link
1
examples/tcp/mongoose.c
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../mongoose.c
|
1
examples/tcp/mongoose.h
Symbolic link
1
examples/tcp/mongoose.h
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../mongoose.h
|
@ -1,10 +1,25 @@
|
|||||||
PROG ?= example
|
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
|
||||||
|
|
||||||
all: $(PROG)
|
# Mongoose build options. See https://mongoose.ws/documentation/#build-options
|
||||||
$(DEBUGGER) ./$(PROG) $(ARGS)
|
CFLAGS_MONGOOSE += -DMG_ENABLE_LINES
|
||||||
|
|
||||||
$(PROG): main.c
|
ifeq ($(OS),Windows_NT) # Windows settings. Assume MinGW compiler. To use VC: make CC=cl CFLAGS=/MD OUT=/Feprog.exe
|
||||||
$(CC) ../../mongoose.c -I../.. -W -Wall -DMG_ENABLE_LINES=1 $(CFLAGS) -o $(PROG) main.c
|
PROG ?= example.exe # Use .exe suffix for the binary
|
||||||
|
CC = gcc # Use MinGW gcc compiler
|
||||||
|
CFLAGS += -lws2_32 # Link against Winsock library
|
||||||
|
DELETE = cmd /C del /Q /F /S # Command prompt command to delete files
|
||||||
|
OUT ?= -o $(PROG) # Build output
|
||||||
|
endif
|
||||||
|
|
||||||
clean:
|
all: $(PROG) # Default target. Build and run program
|
||||||
rm -rf $(PROG) *.o *.dSYM *.gcov *.gcno *.gcda *.obj *.exe *.ilk *.pdb
|
$(RUN) ./$(PROG) $(ARGS)
|
||||||
|
|
||||||
|
$(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
|
||||||
|
1
examples/timers/mongoose.c
Symbolic link
1
examples/timers/mongoose.c
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../mongoose.c
|
1
examples/timers/mongoose.h
Symbolic link
1
examples/timers/mongoose.h
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../mongoose.h
|
@ -1,19 +1,36 @@
|
|||||||
PROG ?= example
|
PROG ?= example # Program we are building
|
||||||
SOURCES ?= ../../mongoose.c main.c net.c packed_fs.c
|
DELETE = rm -rf # Command to remove files
|
||||||
CFLAGS ?= -I../.. -DMG_ENABLE_PACKED_FS=1 -DMG_ENABLE_LINES=1 $(EXTRA_CFLAGS)
|
OUT ?= -o $(PROG) # Compiler argument for output file
|
||||||
FILES_TO_EMBED ?= $(wildcard web_root/*)
|
SOURCES = main.c mongoose.c net.c packed_fs.c # Source code files
|
||||||
ROOT ?= $(realpath $(CURDIR)/../../..)
|
CFLAGS = -W -Wall -Wextra -g -I. # Build options
|
||||||
DOCKER ?= docker run --rm -e Tmp=. -e WINEDEBUG=-all -v $(ROOT):$(ROOT) -w $(CURDIR)
|
|
||||||
VC98 ?= $(DOCKER) mdashnet/vc98 wine
|
|
||||||
MINGW ?= $(DOCKER) mdashnet/mingw
|
|
||||||
|
|
||||||
all: $(PROG)
|
# Mongoose build options. See https://mongoose.ws/documentation/#build-options
|
||||||
$(RUN) ./$(PROG)
|
CFLAGS_MONGOOSE += -DMG_ENABLE_PACKED_FS=1 -DMG_ENABLE_LINES=1
|
||||||
|
|
||||||
$(PROG): $(SOURCES) $(FILES_TO_EMBED)
|
ifeq ($(OS),Windows_NT) # Windows settings. Assume MinGW compiler. To use VC: make CC=cl CFLAGS=/MD OUT=/Feprog.exe
|
||||||
|
PROG ?= example.exe # Use .exe suffix for the binary
|
||||||
|
CC = gcc # Use MinGW gcc compiler
|
||||||
|
CFLAGS += -lws2_32 # Link against Winsock library
|
||||||
|
DELETE = cmd /C del /Q /F /S # Command prompt command to delete files
|
||||||
|
OUT ?= -o $(PROG) # Build output
|
||||||
|
endif
|
||||||
|
|
||||||
|
all: $(PROG) # Default target. Build and run program
|
||||||
|
$(RUN) ./$(PROG) $(ARGS)
|
||||||
|
|
||||||
|
ifneq ($(OS),Windows_NT)
|
||||||
|
# Before embedding files, gzip them to save space
|
||||||
|
packed_fs.c: $(shell find web_root -type f) Makefile
|
||||||
|
rm -rf tmp/web_root && mkdir tmp && cp -r web_root tmp/
|
||||||
|
find tmp -type f | xargs -n1 gzip
|
||||||
$(CC) ../../test/pack.c -o pack
|
$(CC) ../../test/pack.c -o pack
|
||||||
./pack $(FILES_TO_EMBED) > packed_fs.c
|
cd tmp && ../pack `find web_root -type f` > ../$@
|
||||||
$(CC) -W -Wall -Wextra -O0 -g3 $(CFLAGS) -o $(PROG) $(SOURCES)
|
endif
|
||||||
|
|
||||||
|
$(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 pack tmp
|
||||||
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -rf $(PROG) *.o *.dSYM *.gcov *.gcno *.gcda *.obj *.exe *.ilk *.pdb log.txt pack config.json
|
|
||||||
|
@ -3,14 +3,14 @@
|
|||||||
This example is a demonstration of how Mongoose Library could be integrated
|
This example is a demonstration of how Mongoose Library could be integrated
|
||||||
into an embedded device and provide a UART-to-Network bridge capability:
|
into an embedded device and provide a UART-to-Network bridge capability:
|
||||||
|
|
||||||
- A device opens listening TCP port and Websocket port and waits for connections
|
- The device opens listening TCP and Websocket ports and waits for connections
|
||||||
- When a client connects, data is exchanged with the device's UART
|
- When a client connects, data is exchanged with the device's UART
|
||||||
- Everything that client send, is sent to the UART
|
- Everything the client sends, is sent to the UART
|
||||||
- Everything that is read from the UART, gets sent to the client
|
- Everything that is read from the UART, gets sent to the client
|
||||||
- Multiple clients are allowed
|
- Multiple clients are allowed
|
||||||
- Live UART console allows to talk to the UART from the web page
|
- Live UART console allows to talk to the UART from the web page
|
||||||
- Web UI is hardcoded into the binary and does not need a filesystem
|
- Web UI is hardcoded into the binary and does not need a filesystem
|
||||||
|
|
||||||
# Screenshots
|
|
||||||
|
|
||||||
![](screenshots/dashboard.png)
|
![](screenshots/dashboard.png)
|
||||||
|
|
||||||
|
See a detailed tutorial at https://mongoose.ws/tutorials/uart-bridge/
|
1
examples/uart-bridge/mongoose.c
Symbolic link
1
examples/uart-bridge/mongoose.c
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../mongoose.c
|
1
examples/uart-bridge/mongoose.h
Symbolic link
1
examples/uart-bridge/mongoose.h
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../mongoose.h
|
@ -202,7 +202,8 @@ void uart_bridge_fn(struct mg_connection *c, int ev, void *ev_data,
|
|||||||
s_state.mqtt.enable ? "true" : "false", "rx", s_state.rx,
|
s_state.mqtt.enable ? "true" : "false", "rx", s_state.rx,
|
||||||
"tx", s_state.tx, "baud", s_state.baud);
|
"tx", s_state.tx, "baud", s_state.baud);
|
||||||
} else {
|
} else {
|
||||||
struct mg_http_serve_opts opts = {0};
|
struct mg_http_serve_opts opts;
|
||||||
|
memset(&opts, 0, sizeof(opts));
|
||||||
#if 1
|
#if 1
|
||||||
opts.root_dir = "/web_root";
|
opts.root_dir = "/web_root";
|
||||||
opts.fs = &mg_fs_packed;
|
opts.fs = &mg_fs_packed;
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,10 +1,25 @@
|
|||||||
PROG ?= example
|
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
|
||||||
|
|
||||||
all: $(PROG)
|
# Mongoose build options. See https://mongoose.ws/documentation/#build-options
|
||||||
|
#CFLAGS_MONGOOSE += -DMG_ENABLE_LINES
|
||||||
|
|
||||||
|
ifeq ($(OS),Windows_NT) # Windows settings. Assume MinGW compiler. To use VC: make CC=cl CFLAGS=/MD OUT=/Feprog.exe
|
||||||
|
PROG ?= example.exe # Use .exe suffix for the binary
|
||||||
|
CC = gcc # Use MinGW gcc compiler
|
||||||
|
CFLAGS += -lws2_32 # Link against Winsock library
|
||||||
|
DELETE = cmd /C del /Q /F /S # Command prompt command to delete files
|
||||||
|
OUT ?= -o $(PROG) # Build output
|
||||||
|
endif
|
||||||
|
|
||||||
|
all: $(PROG) # Default target. Build and run program
|
||||||
$(RUN) ./$(PROG) $(ARGS)
|
$(RUN) ./$(PROG) $(ARGS)
|
||||||
|
|
||||||
$(PROG): main.c
|
$(PROG): $(SOURCES) # Build program from sources
|
||||||
$(CC) ../../mongoose.c -I../.. -W -Wall $(CFLAGS) -o $(PROG) main.c
|
$(CC) $(SOURCES) $(CFLAGS) $(CFLAGS_MONGOOSE) $(CFLAGS_EXTRA) $(OUT)
|
||||||
|
|
||||||
clean:
|
clean: # Cleanup. Delete built program and all build artifacts
|
||||||
rm -rf $(PROG) *.o *.dSYM *.gcov *.gcno *.gcda *.obj *.exe *.ilk *.pdb
|
$(DELETE) $(PROG) *.o *.obj *.exe *.dSYM
|
||||||
|
1
examples/udp-ssdp-search/mongoose.c
Symbolic link
1
examples/udp-ssdp-search/mongoose.c
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../mongoose.c
|
1
examples/udp-ssdp-search/mongoose.h
Symbolic link
1
examples/udp-ssdp-search/mongoose.h
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../mongoose.h
|
@ -1,10 +1,25 @@
|
|||||||
PROG ?= example
|
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
|
||||||
|
|
||||||
all: $(PROG)
|
# Mongoose build options. See https://mongoose.ws/documentation/#build-options
|
||||||
$(DEBUGGER) ./$(PROG)
|
#CFLAGS_MONGOOSE += -DMG_ENABLE_LINES
|
||||||
|
|
||||||
$(PROG):
|
ifeq ($(OS),Windows_NT) # Windows settings. Assume MinGW compiler. To use VC: make CC=cl CFLAGS=/MD OUT=/Feprog.exe
|
||||||
$(CC) ../../mongoose.c -I../.. $(CFLAGS) $(EXTRA) -o $(PROG) main.c
|
PROG ?= example.exe # Use .exe suffix for the binary
|
||||||
|
CC = gcc # Use MinGW gcc compiler
|
||||||
|
CFLAGS += -lws2_32 # Link against Winsock library
|
||||||
|
DELETE = cmd /C del /Q /F /S # Command prompt command to delete files
|
||||||
|
OUT ?= -o $(PROG) # Build output
|
||||||
|
endif
|
||||||
|
|
||||||
clean:
|
all: $(PROG) # Default target. Build and run program
|
||||||
rm -rf $(PROG) *.o *.dSYM *.gcov *.gcno *.gcda *.obj *.exe *.ilk *.pdb log.txt
|
$(RUN) ./$(PROG) $(ARGS)
|
||||||
|
|
||||||
|
$(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
|
||||||
|
@ -22,6 +22,7 @@ static void cb(struct mg_connection *c, int ev, void *ev_data, void *fn_data) {
|
|||||||
mg_http_serve_dir(c, ev_data, &opts);
|
mg_http_serve_dir(c, ev_data, &opts);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
(void) fn_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
// The image stream is simulated by sending MJPEG frames specified by the
|
// The image stream is simulated by sending MJPEG frames specified by the
|
||||||
|
1
examples/video-stream/mongoose.c
Symbolic link
1
examples/video-stream/mongoose.c
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../mongoose.c
|
1
examples/video-stream/mongoose.h
Symbolic link
1
examples/video-stream/mongoose.h
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../mongoose.h
|
Loading…
Reference in New Issue
Block a user