From 7ef82f5caf645806ac1eff759cc0a43e812988e1 Mon Sep 17 00:00:00 2001 From: Sergey Lyubka Date: Mon, 21 Mar 2022 14:38:42 +0000 Subject: [PATCH] Add vc2017 target --- examples/http-client/Makefile | 17 +++++++++++++++-- examples/http-client/main.c | 2 +- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/examples/http-client/Makefile b/examples/http-client/Makefile index 112c8fff..dce6385e 100644 --- a/examples/http-client/Makefile +++ b/examples/http-client/Makefile @@ -1,6 +1,6 @@ PROG ?= example -CFLAGS ?= -DMG_ENABLE_LINES $(EXTRA) ROOT ?= $(realpath $(CURDIR)/../..) +CFLAGS ?= -DMG_ENABLE_LINES $(EXTRA) LIN = docker run -it --rm -v $(ROOT):$(ROOT) -w $(CURDIR) mdashnet/cc2 ifneq ($(MBEDTLS),) @@ -24,5 +24,18 @@ linux: CFLAGS += -O2 -g -fsanitize=address,undefined,shift,null,return,bounds,al linux: CC = $(LIN) cc linux: RUN = $(LIN) + +ROOT ?= $(realpath $(CURDIR)/../..) +DOCKER = docker run -it --rm -e Tmp=. -e WINEDEBUG=-all -v $(ROOT):$(ROOT) -w $(CURDIR) +WDEFS = -DMG_ENABLE_MBEDTLS -DMG_ENABLE_LINES -Imbedtls/include -Imbedtls/library $(EXTRA) +WFLAGS = /nologo -O2 -I. -I../.. ws2_32.lib advapi32.lib /link /out:$(PROG).exe +WSRCS = ../../mongoose.c main.c mbedtls/library/*.c +$(PROG).exe: main.c mbedtls + $(DOCKER) mdashnet/vc2017 wine cl $(WSRCS) $(WDEFS) $(WFLAGS) +vc2017: $(PROG).exe + $(DOCKER) mdashnet/vc2017 wine $(PROG).exe $(ARGS) +mbedtls: + git clone --depth 1 -b v3.1.0 https://github.com/ARMmbed/mbedtls + clean: - rm -rf $(PROG) *.o *.dSYM *.gcov *.gcno *.gcda *.obj *.exe *.ilk *.pdb + rm -rf $(PROG) _CL* *.o *.dSYM *.gcov *.gcno *.gcda *.obj *.exe *.ilk *.pdb diff --git a/examples/http-client/main.c b/examples/http-client/main.c index 9f8c413b..535c699e 100644 --- a/examples/http-client/main.c +++ b/examples/http-client/main.c @@ -62,7 +62,7 @@ int main(int argc, char *argv[]) { struct mg_mgr mgr; // Event manager bool done = false; // Event handler flips it to true if (argc > 1) s_url = argv[1]; // Use URL provided in the command line - mg_log_set("3"); // Set to 0 to disable debug + mg_log_set("4"); // Set to 0 to disable debug mg_mgr_init(&mgr); // Initialise event manager mg_http_connect(&mgr, s_url, fn, &done); // Create client connection while (!done) mg_mgr_poll(&mgr, 50); // Infinite event loop