mirror of
https://github.com/webui-dev/webui.git
synced 2024-08-16 17:30:25 +03:00
C99 to C
This commit is contained in:
parent
73d6e9f294
commit
f39af55093
@ -1,6 +1,6 @@
|
||||
# WebUI Bridge
|
||||
|
||||
The WebUI Bridge connects the UI (_Web Browser_) with the backend application through WebSocket. This bridge is written in TypeScript, and it needs to be transpiled to JavaScript using [ESBuild](https://esbuild.github.io/) to produce `webui_bridge.js`, then converted to C99 header using the Python script `js2c.py` to generate `webui_bridge.h`.
|
||||
The WebUI Bridge connects the UI (_Web Browser_) with the backend application through WebSocket. This bridge is written in TypeScript, and it needs to be transpiled to JavaScript using [ESBuild](https://esbuild.github.io/) to produce `webui_bridge.js`, then converted to C header using the Python script `js2c.py` to generate `webui_bridge.h`.
|
||||
|
||||
### Windows
|
||||
|
||||
|
@ -55,7 +55,7 @@ if (!$silent) { Write-Host "Transpile and bundle WebUI-Bridge from TypeScript to
|
||||
.\node_modules\.bin\esbuild --bundle --target="chrome90,firefox90,safari15" --format=esm --tree-shaking=false --outdir=. ./webui_bridge.ts $log_level
|
||||
|
||||
# Convert WebUI-Bridge (JS to C)
|
||||
if (!$silent) { Write-Host "Convert WebUI-Bridge JavaScript to C99 Header..." }
|
||||
if (!$silent) { Write-Host "Convert WebUI-Bridge JavaScript to C Header..." }
|
||||
& $python_cmd js2c.py
|
||||
|
||||
# Done
|
||||
|
@ -4,7 +4,7 @@
|
||||
# Licensed under MIT License.
|
||||
# All rights reserved.
|
||||
#
|
||||
# WebUI JavaScript to C99 Header
|
||||
# WebUI JavaScript to C Header
|
||||
|
||||
def js_to_c_header(input_filename, output_filename):
|
||||
try:
|
||||
|
@ -63,11 +63,11 @@ ifeq ($(BUILD_LIB),true)
|
||||
endif
|
||||
# Static with Debug info
|
||||
ifneq ($(WEBUI_USE_TLS), 1)
|
||||
@echo "Build C99 Example ($(CXX) debug static)..."
|
||||
@echo "Build C Example ($(CXX) debug static)..."
|
||||
@$(CXX) -g $(STATIC_BUILD_FLAGS) $(LWS2_OPT) -o $(STATIC_OUT)
|
||||
endif
|
||||
# Dynamic with Debug info
|
||||
@echo "Build C99 Example ($(CXX) debug dynamic)..."
|
||||
@echo "Build C Example ($(CXX) debug dynamic)..."
|
||||
@$(CXX) -g $(DYN_BUILD_FLAGS) $(LWS2_OPT) -o $(DYN_OUT)
|
||||
# Clean
|
||||
ifeq ($(PLATFORM),windows)
|
||||
@ -84,12 +84,12 @@ ifeq ($(BUILD_LIB),true)
|
||||
endif
|
||||
# Static Release
|
||||
ifneq ($(WEBUI_USE_TLS), 1)
|
||||
@echo "Build C99 Example ($(CXX) release static)..."
|
||||
@echo "Build C Example ($(CXX) release static)..."
|
||||
@$(CXX) -Os $(STATIC_BUILD_FLAGS) $(LWS2_OPT) -o $(STATIC_OUT)
|
||||
@$(LLVM_OPT)strip $(STRIP_OPT) $(STATIC_OUT)
|
||||
endif
|
||||
# Dynamic Release
|
||||
@echo "Build C99 Example ($(CXX) release dynamic)..."
|
||||
@echo "Build C Example ($(CXX) release dynamic)..."
|
||||
@$(CXX) $(DYN_BUILD_FLAGS) $(LWS2_OPT) -o $(DYN_OUT)
|
||||
@$(LLVM_OPT)strip $(STRIP_OPT) $(DYN_OUT)
|
||||
# Clean
|
||||
|
@ -63,11 +63,11 @@ ifeq ($(BUILD_LIB),true)
|
||||
endif
|
||||
# Static with Debug info
|
||||
ifneq ($(WEBUI_USE_TLS), 1)
|
||||
@echo "Build C99 Example ($(CXX) debug static)..."
|
||||
@echo "Build C Example ($(CXX) debug static)..."
|
||||
@$(CXX) -g $(STATIC_BUILD_FLAGS) $(LWS2_OPT) -o $(STATIC_OUT)
|
||||
endif
|
||||
# Dynamic with Debug info
|
||||
@echo "Build C99 Example ($(CXX) debug dynamic)..."
|
||||
@echo "Build C Example ($(CXX) debug dynamic)..."
|
||||
@$(CXX) -g $(DYN_BUILD_FLAGS) $(LWS2_OPT) -o $(DYN_OUT)
|
||||
# Clean
|
||||
ifeq ($(PLATFORM),windows)
|
||||
@ -84,12 +84,12 @@ ifeq ($(BUILD_LIB),true)
|
||||
endif
|
||||
# Static Release
|
||||
ifneq ($(WEBUI_USE_TLS), 1)
|
||||
@echo "Build C99 Example ($(CXX) release static)..."
|
||||
@echo "Build C Example ($(CXX) release static)..."
|
||||
@$(CXX) -Os $(STATIC_BUILD_FLAGS) $(LWS2_OPT) -o $(STATIC_OUT)
|
||||
@$(LLVM_OPT)strip $(STRIP_OPT) $(STATIC_OUT)
|
||||
endif
|
||||
# Dynamic Release
|
||||
@echo "Build C99 Example ($(CXX) release dynamic)..."
|
||||
@echo "Build C Example ($(CXX) release dynamic)..."
|
||||
@$(CXX) $(DYN_BUILD_FLAGS) $(LWS2_OPT) -o $(DYN_OUT)
|
||||
@$(LLVM_OPT)strip $(STRIP_OPT) $(DYN_OUT)
|
||||
# Clean
|
||||
|
@ -63,11 +63,11 @@ ifeq ($(BUILD_LIB),true)
|
||||
endif
|
||||
# Static with Debug info
|
||||
ifneq ($(WEBUI_USE_TLS), 1)
|
||||
@echo "Build C99 Example ($(CXX) debug static)..."
|
||||
@echo "Build C Example ($(CXX) debug static)..."
|
||||
@$(CXX) -g $(STATIC_BUILD_FLAGS) $(LWS2_OPT) -o $(STATIC_OUT)
|
||||
endif
|
||||
# Dynamic with Debug info
|
||||
@echo "Build C99 Example ($(CXX) debug dynamic)..."
|
||||
@echo "Build C Example ($(CXX) debug dynamic)..."
|
||||
@$(CXX) -g $(DYN_BUILD_FLAGS) $(LWS2_OPT) -o $(DYN_OUT)
|
||||
# Clean
|
||||
ifeq ($(PLATFORM),windows)
|
||||
@ -84,12 +84,12 @@ ifeq ($(BUILD_LIB),true)
|
||||
endif
|
||||
# Static Release
|
||||
ifneq ($(WEBUI_USE_TLS), 1)
|
||||
@echo "Build C99 Example ($(CXX) release static)..."
|
||||
@echo "Build C Example ($(CXX) release static)..."
|
||||
@$(CXX) -Os $(STATIC_BUILD_FLAGS) $(LWS2_OPT) -o $(STATIC_OUT)
|
||||
@$(LLVM_OPT)strip $(STRIP_OPT) $(STATIC_OUT)
|
||||
endif
|
||||
# Dynamic Release
|
||||
@echo "Build C99 Example ($(CXX) release dynamic)..."
|
||||
@echo "Build C Example ($(CXX) release dynamic)..."
|
||||
@$(CXX) $(DYN_BUILD_FLAGS) $(LWS2_OPT) -o $(DYN_OUT)
|
||||
@$(LLVM_OPT)strip $(STRIP_OPT) $(DYN_OUT)
|
||||
# Clean
|
||||
|
@ -63,11 +63,11 @@ ifeq ($(BUILD_LIB),true)
|
||||
endif
|
||||
# Static with Debug info
|
||||
ifneq ($(WEBUI_USE_TLS), 1)
|
||||
@echo "Build C99 Example ($(CXX) debug static)..."
|
||||
@echo "Build C Example ($(CXX) debug static)..."
|
||||
@$(CXX) -g $(STATIC_BUILD_FLAGS) $(LWS2_OPT) -o $(STATIC_OUT)
|
||||
endif
|
||||
# Dynamic with Debug info
|
||||
@echo "Build C99 Example ($(CXX) debug dynamic)..."
|
||||
@echo "Build C Example ($(CXX) debug dynamic)..."
|
||||
@$(CXX) -g $(DYN_BUILD_FLAGS) $(LWS2_OPT) -o $(DYN_OUT)
|
||||
# Clean
|
||||
ifeq ($(PLATFORM),windows)
|
||||
@ -84,12 +84,12 @@ ifeq ($(BUILD_LIB),true)
|
||||
endif
|
||||
# Static Release
|
||||
ifneq ($(WEBUI_USE_TLS), 1)
|
||||
@echo "Build C99 Example ($(CXX) release static)..."
|
||||
@echo "Build C Example ($(CXX) release static)..."
|
||||
@$(CXX) -Os $(STATIC_BUILD_FLAGS) $(LWS2_OPT) -o $(STATIC_OUT)
|
||||
@$(LLVM_OPT)strip $(STRIP_OPT) $(STATIC_OUT)
|
||||
endif
|
||||
# Dynamic Release
|
||||
@echo "Build C99 Example ($(CXX) release dynamic)..."
|
||||
@echo "Build C Example ($(CXX) release dynamic)..."
|
||||
@$(CXX) $(DYN_BUILD_FLAGS) $(LWS2_OPT) -o $(DYN_OUT)
|
||||
@$(LLVM_OPT)strip $(STRIP_OPT) $(DYN_OUT)
|
||||
# Clean
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
Examples of how to create a WebUI application in C.
|
||||
|
||||
## C99 Examples
|
||||
## C Examples
|
||||
|
||||
The only requirement to build the examples is a C compiler.
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# WebUI C99 Example
|
||||
# WebUI C Example
|
||||
|
||||
# == 1. VARIABLES =============================================================
|
||||
|
||||
@ -73,11 +73,11 @@ ifeq ($(BUILD_LIB),true)
|
||||
endif
|
||||
# Static with Debug info
|
||||
ifneq ($(WEBUI_USE_TLS), 1)
|
||||
@echo "Build C99 Example ($(CC) debug static)..."
|
||||
@echo "Build C Example ($(CC) debug static)..."
|
||||
@$(CC) -g $(CONSOLE_APP) $(STATIC_BUILD_FLAGS) $(LWS2_OPT) -o $(STATIC_OUT)
|
||||
endif
|
||||
# Dynamic with Debug info
|
||||
@echo "Build C99 Example ($(CC) debug dynamic)..."
|
||||
@echo "Build C Example ($(CC) debug dynamic)..."
|
||||
$(COPY_LIB_CMD)
|
||||
@$(CC) -g $(CONSOLE_APP) $(DYN_BUILD_FLAGS) $(LWS2_OPT) -o $(DYN_OUT)
|
||||
# Clean
|
||||
@ -95,12 +95,12 @@ ifeq ($(BUILD_LIB),true)
|
||||
endif
|
||||
# Static Release
|
||||
ifneq ($(WEBUI_USE_TLS), 1)
|
||||
@echo "Build C99 Example ($(CC) release static)..."
|
||||
@echo "Build C Example ($(CC) release static)..."
|
||||
@$(CC) -Os $(GUI_APP) $(STATIC_BUILD_FLAGS) $(LWS2_OPT) -o $(STATIC_OUT)
|
||||
@$(LLVM_OPT)strip $(STRIP_OPT) $(STATIC_OUT)
|
||||
endif
|
||||
# Dynamic Release
|
||||
@echo "Build C99 Example ($(CC) release dynamic)..."
|
||||
@echo "Build C Example ($(CC) release dynamic)..."
|
||||
$(COPY_LIB_CMD)
|
||||
@$(CC) $(GUI_APP) $(DYN_BUILD_FLAGS) $(LWS2_OPT) -o $(DYN_OUT)
|
||||
@$(LLVM_OPT)strip $(STRIP_OPT) $(DYN_OUT)
|
||||
|
@ -1,4 +1,4 @@
|
||||
# WebUI C99 Example
|
||||
# WebUI C Example
|
||||
# Windows - Microsoft Visual C
|
||||
|
||||
SHELL = CMD
|
||||
@ -20,11 +20,11 @@ debug:
|
||||
!ENDIF
|
||||
# Static with Debug info
|
||||
!IF "$(WEBUI_USE_TLS)" != "1"
|
||||
@echo Build C99 Example (Static Debug)...
|
||||
@echo Build C Example (Static Debug)...
|
||||
@cl /Zi main.c /I"$(INCLUDE_DIR)" /link /LIBPATH:"$(LIB_DIR)\debug" /MACHINE:X64 /SUBSYSTEM:CONSOLE $(WEBUI_LIB_NAME)-static.lib user32.lib Advapi32.lib Shell32.lib /OUT:main.exe 1>NUL 2>&1
|
||||
!ENDIF
|
||||
# Dynamic with Debug info
|
||||
@echo Build C99 Example (Dynamic Debug)...
|
||||
@echo Build C Example (Dynamic Debug)...
|
||||
@copy "$(LIB_DIR)\debug\$(WEBUI_LIB_NAME).dll" "$(WEBUI_LIB_NAME).dll"
|
||||
@cl /Zi main.c /I"$(INCLUDE_DIR)" /link /LIBPATH:"$(LIB_DIR)\debug" /MACHINE:X64 /SUBSYSTEM:CONSOLE $(WEBUI_LIB_NAME).lib user32.lib Advapi32.lib Shell32.lib /OUT:main-dyn.exe 1>NUL 2>&1
|
||||
# Clean
|
||||
@ -41,11 +41,11 @@ release:
|
||||
!ENDIF
|
||||
# Static Release
|
||||
!IF "$(WEBUI_USE_TLS)" != "1"
|
||||
@echo Build C99 Example (Static Release)...
|
||||
@echo Build C Example (Static Release)...
|
||||
@cl main.c /I"$(INCLUDE_DIR)" /link /LIBPATH:"$(LIB_DIR)" /MACHINE:X64 /SUBSYSTEM:WINDOWS $(WEBUI_LIB_NAME)-static.lib user32.lib Advapi32.lib Shell32.lib /OUT:main.exe 1>NUL 2>&1
|
||||
!ENDIF
|
||||
# Dynamic Release
|
||||
@echo Build C99 Example (Dynamic Release)...
|
||||
@echo Build C Example (Dynamic Release)...
|
||||
@copy "$(LIB_DIR)\$(WEBUI_LIB_NAME).dll" "$(WEBUI_LIB_NAME).dll"
|
||||
@cl main.c /I"$(INCLUDE_DIR)" /link /LIBPATH:"$(LIB_DIR)" /MACHINE:X64 /SUBSYSTEM:WINDOWS $(WEBUI_LIB_NAME).lib user32.lib Advapi32.lib Shell32.lib /OUT:main-dyn.exe 1>NUL 2>&1
|
||||
# Clean
|
||||
|
@ -1,4 +1,4 @@
|
||||
# WebUI C99 Example
|
||||
# WebUI C Example
|
||||
|
||||
# == 1. VARIABLES =============================================================
|
||||
|
||||
@ -73,11 +73,11 @@ ifeq ($(BUILD_LIB),true)
|
||||
endif
|
||||
# Static with Debug info
|
||||
ifneq ($(WEBUI_USE_TLS), 1)
|
||||
@echo "Build C99 Example ($(CC) debug static)..."
|
||||
@echo "Build C Example ($(CC) debug static)..."
|
||||
@$(CC) -g $(CONSOLE_APP) $(STATIC_BUILD_FLAGS) $(LWS2_OPT) -o $(STATIC_OUT)
|
||||
endif
|
||||
# Dynamic with Debug info
|
||||
@echo "Build C99 Example ($(CC) debug dynamic)..."
|
||||
@echo "Build C Example ($(CC) debug dynamic)..."
|
||||
$(COPY_LIB_CMD)
|
||||
@$(CC) -g $(CONSOLE_APP) $(DYN_BUILD_FLAGS) $(LWS2_OPT) -o $(DYN_OUT)
|
||||
# Clean
|
||||
@ -95,12 +95,12 @@ ifeq ($(BUILD_LIB),true)
|
||||
endif
|
||||
# Static Release
|
||||
ifneq ($(WEBUI_USE_TLS), 1)
|
||||
@echo "Build C99 Example ($(CC) release static)..."
|
||||
@echo "Build C Example ($(CC) release static)..."
|
||||
@$(CC) -Os $(GUI_APP) $(STATIC_BUILD_FLAGS) $(LWS2_OPT) -o $(STATIC_OUT)
|
||||
@$(LLVM_OPT)strip $(STRIP_OPT) $(STATIC_OUT)
|
||||
endif
|
||||
# Dynamic Release
|
||||
@echo "Build C99 Example ($(CC) release dynamic)..."
|
||||
@echo "Build C Example ($(CC) release dynamic)..."
|
||||
$(COPY_LIB_CMD)
|
||||
@$(CC) $(GUI_APP) $(DYN_BUILD_FLAGS) $(LWS2_OPT) -o $(DYN_OUT)
|
||||
@$(LLVM_OPT)strip $(STRIP_OPT) $(DYN_OUT)
|
||||
|
@ -1,4 +1,4 @@
|
||||
# WebUI C99 Example
|
||||
# WebUI C Example
|
||||
# Windows - Microsoft Visual C
|
||||
|
||||
SHELL = CMD
|
||||
@ -20,11 +20,11 @@ debug:
|
||||
!ENDIF
|
||||
# Static with Debug info
|
||||
!IF "$(WEBUI_USE_TLS)" != "1"
|
||||
@echo Build C99 Example (Static Debug)...
|
||||
@echo Build C Example (Static Debug)...
|
||||
@cl /Zi main.c /I"$(INCLUDE_DIR)" /link /LIBPATH:"$(LIB_DIR)\debug" /MACHINE:X64 /SUBSYSTEM:CONSOLE $(WEBUI_LIB_NAME)-static.lib user32.lib Advapi32.lib Shell32.lib /OUT:main.exe 1>NUL 2>&1
|
||||
!ENDIF
|
||||
# Dynamic with Debug info
|
||||
@echo Build C99 Example (Dynamic Debug)...
|
||||
@echo Build C Example (Dynamic Debug)...
|
||||
@copy "$(LIB_DIR)\debug\$(WEBUI_LIB_NAME).dll" "$(WEBUI_LIB_NAME).dll"
|
||||
@cl /Zi main.c /I"$(INCLUDE_DIR)" /link /LIBPATH:"$(LIB_DIR)\debug" /MACHINE:X64 /SUBSYSTEM:CONSOLE $(WEBUI_LIB_NAME).lib user32.lib Advapi32.lib Shell32.lib /OUT:main-dyn.exe 1>NUL 2>&1
|
||||
# Clean
|
||||
@ -41,11 +41,11 @@ release:
|
||||
!ENDIF
|
||||
# Static Release
|
||||
!IF "$(WEBUI_USE_TLS)" != "1"
|
||||
@echo Build C99 Example (Static Release)...
|
||||
@echo Build C Example (Static Release)...
|
||||
@cl main.c /I"$(INCLUDE_DIR)" /link /LIBPATH:"$(LIB_DIR)" /MACHINE:X64 /SUBSYSTEM:WINDOWS $(WEBUI_LIB_NAME)-static.lib user32.lib Advapi32.lib Shell32.lib /OUT:main.exe 1>NUL 2>&1
|
||||
!ENDIF
|
||||
# Dynamic Release
|
||||
@echo Build C99 Example (Dynamic Release)...
|
||||
@echo Build C Example (Dynamic Release)...
|
||||
@copy "$(LIB_DIR)\$(WEBUI_LIB_NAME).dll" "$(WEBUI_LIB_NAME).dll"
|
||||
@cl main.c /I"$(INCLUDE_DIR)" /link /LIBPATH:"$(LIB_DIR)" /MACHINE:X64 /SUBSYSTEM:WINDOWS $(WEBUI_LIB_NAME).lib user32.lib Advapi32.lib Shell32.lib /OUT:main-dyn.exe 1>NUL 2>&1
|
||||
# Clean
|
||||
|
@ -1,4 +1,4 @@
|
||||
# WebUI C99 Example
|
||||
# WebUI C Example
|
||||
|
||||
# == 1. VARIABLES =============================================================
|
||||
|
||||
@ -73,11 +73,11 @@ ifeq ($(BUILD_LIB),true)
|
||||
endif
|
||||
# Static with Debug info
|
||||
ifneq ($(WEBUI_USE_TLS), 1)
|
||||
@echo "Build C99 Example ($(CC) debug static)..."
|
||||
@echo "Build C Example ($(CC) debug static)..."
|
||||
@$(CC) -g $(CONSOLE_APP) $(STATIC_BUILD_FLAGS) $(LWS2_OPT) -o $(STATIC_OUT)
|
||||
endif
|
||||
# Dynamic with Debug info
|
||||
@echo "Build C99 Example ($(CC) debug dynamic)..."
|
||||
@echo "Build C Example ($(CC) debug dynamic)..."
|
||||
$(COPY_LIB_CMD)
|
||||
@$(CC) -g $(CONSOLE_APP) $(DYN_BUILD_FLAGS) $(LWS2_OPT) -o $(DYN_OUT)
|
||||
# Clean
|
||||
@ -95,12 +95,12 @@ ifeq ($(BUILD_LIB),true)
|
||||
endif
|
||||
# Static Release
|
||||
ifneq ($(WEBUI_USE_TLS), 1)
|
||||
@echo "Build C99 Example ($(CC) release static)..."
|
||||
@echo "Build C Example ($(CC) release static)..."
|
||||
@$(CC) -Os $(GUI_APP) $(STATIC_BUILD_FLAGS) $(LWS2_OPT) -o $(STATIC_OUT)
|
||||
@$(LLVM_OPT)strip $(STRIP_OPT) $(STATIC_OUT)
|
||||
endif
|
||||
# Dynamic Release
|
||||
@echo "Build C99 Example ($(CC) release dynamic)..."
|
||||
@echo "Build C Example ($(CC) release dynamic)..."
|
||||
$(COPY_LIB_CMD)
|
||||
@$(CC) $(GUI_APP) $(DYN_BUILD_FLAGS) $(LWS2_OPT) -o $(DYN_OUT)
|
||||
@$(LLVM_OPT)strip $(STRIP_OPT) $(DYN_OUT)
|
||||
|
@ -1,4 +1,4 @@
|
||||
# WebUI C99 Example
|
||||
# WebUI C Example
|
||||
# Windows - Microsoft Visual C
|
||||
|
||||
SHELL = CMD
|
||||
@ -20,11 +20,11 @@ debug:
|
||||
!ENDIF
|
||||
# Static with Debug info
|
||||
!IF "$(WEBUI_USE_TLS)" != "1"
|
||||
@echo Build C99 Example (Static Debug)...
|
||||
@echo Build C Example (Static Debug)...
|
||||
@cl /Zi main.c /I"$(INCLUDE_DIR)" /link /LIBPATH:"$(LIB_DIR)\debug" /MACHINE:X64 /SUBSYSTEM:CONSOLE $(WEBUI_LIB_NAME)-static.lib user32.lib Advapi32.lib Shell32.lib /OUT:main.exe 1>NUL 2>&1
|
||||
!ENDIF
|
||||
# Dynamic with Debug info
|
||||
@echo Build C99 Example (Dynamic Debug)...
|
||||
@echo Build C Example (Dynamic Debug)...
|
||||
@copy "$(LIB_DIR)\debug\$(WEBUI_LIB_NAME).dll" "$(WEBUI_LIB_NAME).dll"
|
||||
@cl /Zi main.c /I"$(INCLUDE_DIR)" /link /LIBPATH:"$(LIB_DIR)\debug" /MACHINE:X64 /SUBSYSTEM:CONSOLE $(WEBUI_LIB_NAME).lib user32.lib Advapi32.lib Shell32.lib /OUT:main-dyn.exe 1>NUL 2>&1
|
||||
# Clean
|
||||
@ -41,11 +41,11 @@ release:
|
||||
!ENDIF
|
||||
# Static Release
|
||||
!IF "$(WEBUI_USE_TLS)" != "1"
|
||||
@echo Build C99 Example (Static Release)...
|
||||
@echo Build C Example (Static Release)...
|
||||
@cl main.c /I"$(INCLUDE_DIR)" /link /LIBPATH:"$(LIB_DIR)" /MACHINE:X64 /SUBSYSTEM:WINDOWS $(WEBUI_LIB_NAME)-static.lib user32.lib Advapi32.lib Shell32.lib /OUT:main.exe 1>NUL 2>&1
|
||||
!ENDIF
|
||||
# Dynamic Release
|
||||
@echo Build C99 Example (Dynamic Release)...
|
||||
@echo Build C Example (Dynamic Release)...
|
||||
@copy "$(LIB_DIR)\$(WEBUI_LIB_NAME).dll" "$(WEBUI_LIB_NAME).dll"
|
||||
@cl main.c /I"$(INCLUDE_DIR)" /link /LIBPATH:"$(LIB_DIR)" /MACHINE:X64 /SUBSYSTEM:WINDOWS $(WEBUI_LIB_NAME).lib user32.lib Advapi32.lib Shell32.lib /OUT:main-dyn.exe 1>NUL 2>&1
|
||||
# Clean
|
||||
|
@ -2,12 +2,12 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>WebUI - Custom Web-Server Example (C99)</title>
|
||||
<title>WebUI - Custom Web-Server Example (C)</title>
|
||||
<!-- Connect this window to the back-end app -->
|
||||
<script src="http://localhost:8081/webui.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h3>Custom Web-Server Example (C99)</h3>
|
||||
<h3>Custom Web-Server Example (C)</h3>
|
||||
<p>
|
||||
This HTML page is handled by a custom Web-Server other than WebUI.<br />
|
||||
This window is connected to the back-end because we used: <pre>http://localhost:8081/webui.js</pre>
|
||||
|
@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>WebUI - Custom Web-Server second page (C99)</title>
|
||||
<title>WebUI - Custom Web-Server second page (C)</title>
|
||||
<!-- Connect this window to the back-end app -->
|
||||
<script src="http://localhost:8081/webui.js"></script>
|
||||
</head>
|
||||
|
@ -1,4 +1,4 @@
|
||||
# WebUI C99 Example
|
||||
# WebUI C Example
|
||||
|
||||
# == 1. VARIABLES =============================================================
|
||||
|
||||
@ -73,11 +73,11 @@ ifeq ($(BUILD_LIB),true)
|
||||
endif
|
||||
# Static with Debug info
|
||||
ifneq ($(WEBUI_USE_TLS), 1)
|
||||
@echo "Build C99 Example ($(CC) debug static)..."
|
||||
@echo "Build C Example ($(CC) debug static)..."
|
||||
@$(CC) -g $(CONSOLE_APP) $(STATIC_BUILD_FLAGS) $(LWS2_OPT) -o $(STATIC_OUT)
|
||||
endif
|
||||
# Dynamic with Debug info
|
||||
@echo "Build C99 Example ($(CC) debug dynamic)..."
|
||||
@echo "Build C Example ($(CC) debug dynamic)..."
|
||||
$(COPY_LIB_CMD)
|
||||
@$(CC) -g $(CONSOLE_APP) $(DYN_BUILD_FLAGS) $(LWS2_OPT) -o $(DYN_OUT)
|
||||
# Clean
|
||||
@ -95,12 +95,12 @@ ifeq ($(BUILD_LIB),true)
|
||||
endif
|
||||
# Static Release
|
||||
ifneq ($(WEBUI_USE_TLS), 1)
|
||||
@echo "Build C99 Example ($(CC) release static)..."
|
||||
@echo "Build C Example ($(CC) release static)..."
|
||||
@$(CC) -Os $(GUI_APP) $(STATIC_BUILD_FLAGS) $(LWS2_OPT) -o $(STATIC_OUT)
|
||||
@$(LLVM_OPT)strip $(STRIP_OPT) $(STATIC_OUT)
|
||||
endif
|
||||
# Dynamic Release
|
||||
@echo "Build C99 Example ($(CC) release dynamic)..."
|
||||
@echo "Build C Example ($(CC) release dynamic)..."
|
||||
$(COPY_LIB_CMD)
|
||||
@$(CC) $(GUI_APP) $(DYN_BUILD_FLAGS) $(LWS2_OPT) -o $(DYN_OUT)
|
||||
@$(LLVM_OPT)strip $(STRIP_OPT) $(DYN_OUT)
|
||||
|
@ -1,4 +1,4 @@
|
||||
# WebUI C99 Example
|
||||
# WebUI C Example
|
||||
# Windows - Microsoft Visual C
|
||||
|
||||
SHELL = CMD
|
||||
@ -20,11 +20,11 @@ debug:
|
||||
!ENDIF
|
||||
# Static with Debug info
|
||||
!IF "$(WEBUI_USE_TLS)" != "1"
|
||||
@echo Build C99 Example (Static Debug)...
|
||||
@echo Build C Example (Static Debug)...
|
||||
@cl /Zi main.c /I"$(INCLUDE_DIR)" /link /LIBPATH:"$(LIB_DIR)\debug" /MACHINE:X64 /SUBSYSTEM:CONSOLE $(WEBUI_LIB_NAME)-static.lib user32.lib Advapi32.lib Shell32.lib /OUT:main.exe 1>NUL 2>&1
|
||||
!ENDIF
|
||||
# Dynamic with Debug info
|
||||
@echo Build C99 Example (Dynamic Debug)...
|
||||
@echo Build C Example (Dynamic Debug)...
|
||||
@copy "$(LIB_DIR)\debug\$(WEBUI_LIB_NAME).dll" "$(WEBUI_LIB_NAME).dll"
|
||||
@cl /Zi main.c /I"$(INCLUDE_DIR)" /link /LIBPATH:"$(LIB_DIR)\debug" /MACHINE:X64 /SUBSYSTEM:CONSOLE $(WEBUI_LIB_NAME).lib user32.lib Advapi32.lib Shell32.lib /OUT:main-dyn.exe 1>NUL 2>&1
|
||||
# Clean
|
||||
@ -41,11 +41,11 @@ release:
|
||||
!ENDIF
|
||||
# Static Release
|
||||
!IF "$(WEBUI_USE_TLS)" != "1"
|
||||
@echo Build C99 Example (Static Release)...
|
||||
@echo Build C Example (Static Release)...
|
||||
@cl main.c /I"$(INCLUDE_DIR)" /link /LIBPATH:"$(LIB_DIR)" /MACHINE:X64 /SUBSYSTEM:WINDOWS $(WEBUI_LIB_NAME)-static.lib user32.lib Advapi32.lib Shell32.lib /OUT:main.exe 1>NUL 2>&1
|
||||
!ENDIF
|
||||
# Dynamic Release
|
||||
@echo Build C99 Example (Dynamic Release)...
|
||||
@echo Build C Example (Dynamic Release)...
|
||||
@copy "$(LIB_DIR)\$(WEBUI_LIB_NAME).dll" "$(WEBUI_LIB_NAME).dll"
|
||||
@cl main.c /I"$(INCLUDE_DIR)" /link /LIBPATH:"$(LIB_DIR)" /MACHINE:X64 /SUBSYSTEM:WINDOWS $(WEBUI_LIB_NAME).lib user32.lib Advapi32.lib Shell32.lib /OUT:main-dyn.exe 1>NUL 2>&1
|
||||
# Clean
|
||||
|
@ -1,4 +1,4 @@
|
||||
# WebUI C99 Example
|
||||
# WebUI C Example
|
||||
|
||||
# == 1. VARIABLES =============================================================
|
||||
|
||||
@ -73,11 +73,11 @@ ifeq ($(BUILD_LIB),true)
|
||||
endif
|
||||
# Static with Debug info
|
||||
ifneq ($(WEBUI_USE_TLS), 1)
|
||||
@echo "Build C99 Example ($(CC) debug static)..."
|
||||
@echo "Build C Example ($(CC) debug static)..."
|
||||
@$(CC) -g $(CONSOLE_APP) $(STATIC_BUILD_FLAGS) $(LWS2_OPT) -o $(STATIC_OUT)
|
||||
endif
|
||||
# Dynamic with Debug info
|
||||
@echo "Build C99 Example ($(CC) debug dynamic)..."
|
||||
@echo "Build C Example ($(CC) debug dynamic)..."
|
||||
$(COPY_LIB_CMD)
|
||||
@$(CC) -g $(CONSOLE_APP) $(DYN_BUILD_FLAGS) $(LWS2_OPT) -o $(DYN_OUT)
|
||||
# Clean
|
||||
@ -95,12 +95,12 @@ ifeq ($(BUILD_LIB),true)
|
||||
endif
|
||||
# Static Release
|
||||
ifneq ($(WEBUI_USE_TLS), 1)
|
||||
@echo "Build C99 Example ($(CC) release static)..."
|
||||
@echo "Build C Example ($(CC) release static)..."
|
||||
@$(CC) -Os $(GUI_APP) $(STATIC_BUILD_FLAGS) $(LWS2_OPT) -o $(STATIC_OUT)
|
||||
@$(LLVM_OPT)strip $(STRIP_OPT) $(STATIC_OUT)
|
||||
endif
|
||||
# Dynamic Release
|
||||
@echo "Build C99 Example ($(CC) release dynamic)..."
|
||||
@echo "Build C Example ($(CC) release dynamic)..."
|
||||
$(COPY_LIB_CMD)
|
||||
@$(CC) $(GUI_APP) $(DYN_BUILD_FLAGS) $(LWS2_OPT) -o $(DYN_OUT)
|
||||
@$(LLVM_OPT)strip $(STRIP_OPT) $(DYN_OUT)
|
||||
|
@ -1,4 +1,4 @@
|
||||
# WebUI C99 Example
|
||||
# WebUI C Example
|
||||
# Windows - Microsoft Visual C
|
||||
|
||||
SHELL = CMD
|
||||
@ -20,11 +20,11 @@ debug:
|
||||
!ENDIF
|
||||
# Static with Debug info
|
||||
!IF "$(WEBUI_USE_TLS)" != "1"
|
||||
@echo Build C99 Example (Static Debug)...
|
||||
@echo Build C Example (Static Debug)...
|
||||
@cl /Zi main.c /I"$(INCLUDE_DIR)" /link /LIBPATH:"$(LIB_DIR)\debug" /MACHINE:X64 /SUBSYSTEM:CONSOLE $(WEBUI_LIB_NAME)-static.lib user32.lib Advapi32.lib Shell32.lib /OUT:main.exe 1>NUL 2>&1
|
||||
!ENDIF
|
||||
# Dynamic with Debug info
|
||||
@echo Build C99 Example (Dynamic Debug)...
|
||||
@echo Build C Example (Dynamic Debug)...
|
||||
@copy "$(LIB_DIR)\debug\$(WEBUI_LIB_NAME).dll" "$(WEBUI_LIB_NAME).dll"
|
||||
@cl /Zi main.c /I"$(INCLUDE_DIR)" /link /LIBPATH:"$(LIB_DIR)\debug" /MACHINE:X64 /SUBSYSTEM:CONSOLE $(WEBUI_LIB_NAME).lib user32.lib Advapi32.lib Shell32.lib /OUT:main-dyn.exe 1>NUL 2>&1
|
||||
# Clean
|
||||
@ -41,11 +41,11 @@ release:
|
||||
!ENDIF
|
||||
# Static Release
|
||||
!IF "$(WEBUI_USE_TLS)" != "1"
|
||||
@echo Build C99 Example (Static Release)...
|
||||
@echo Build C Example (Static Release)...
|
||||
@cl main.c /I"$(INCLUDE_DIR)" /link /LIBPATH:"$(LIB_DIR)" /MACHINE:X64 /SUBSYSTEM:WINDOWS $(WEBUI_LIB_NAME)-static.lib user32.lib Advapi32.lib Shell32.lib /OUT:main.exe 1>NUL 2>&1
|
||||
!ENDIF
|
||||
# Dynamic Release
|
||||
@echo Build C99 Example (Dynamic Release)...
|
||||
@echo Build C Example (Dynamic Release)...
|
||||
@copy "$(LIB_DIR)\$(WEBUI_LIB_NAME).dll" "$(WEBUI_LIB_NAME).dll"
|
||||
@cl main.c /I"$(INCLUDE_DIR)" /link /LIBPATH:"$(LIB_DIR)" /MACHINE:X64 /SUBSYSTEM:WINDOWS $(WEBUI_LIB_NAME).lib user32.lib Advapi32.lib Shell32.lib /OUT:main-dyn.exe 1>NUL 2>&1
|
||||
# Clean
|
||||
|
@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>WebUI - Serve a Folder Example (C99)</title>
|
||||
<title>WebUI - Serve a Folder Example (C)</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: 'Arial', sans-serif;
|
||||
@ -51,7 +51,7 @@
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h3 id="title">Serve a Folder Example (C99)</h3>
|
||||
<h3 id="title">Serve a Folder Example (C)</h3>
|
||||
<br />
|
||||
<p id="description">
|
||||
You can edit this HTML file as you need.<br />
|
||||
|
@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>WebUI - Second Page (C99)</title>
|
||||
<title>WebUI - Second Page (C)</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: 'Arial', sans-serif;
|
||||
|
@ -1,4 +1,4 @@
|
||||
# WebUI C99 Example
|
||||
# WebUI C Example
|
||||
|
||||
# == 1. VARIABLES =============================================================
|
||||
|
||||
@ -73,11 +73,11 @@ ifeq ($(BUILD_LIB),true)
|
||||
endif
|
||||
# Static with Debug info
|
||||
ifneq ($(WEBUI_USE_TLS), 1)
|
||||
@echo "Build C99 Example ($(CC) debug static)..."
|
||||
@echo "Build C Example ($(CC) debug static)..."
|
||||
@$(CC) -g $(CONSOLE_APP) $(STATIC_BUILD_FLAGS) $(LWS2_OPT) -o $(STATIC_OUT)
|
||||
endif
|
||||
# Dynamic with Debug info
|
||||
@echo "Build C99 Example ($(CC) debug dynamic)..."
|
||||
@echo "Build C Example ($(CC) debug dynamic)..."
|
||||
$(COPY_LIB_CMD)
|
||||
@$(CC) -g $(CONSOLE_APP) $(DYN_BUILD_FLAGS) $(LWS2_OPT) -o $(DYN_OUT)
|
||||
# Clean
|
||||
@ -95,12 +95,12 @@ ifeq ($(BUILD_LIB),true)
|
||||
endif
|
||||
# Static Release
|
||||
ifneq ($(WEBUI_USE_TLS), 1)
|
||||
@echo "Build C99 Example ($(CC) release static)..."
|
||||
@echo "Build C Example ($(CC) release static)..."
|
||||
@$(CC) -Os $(GUI_APP) $(STATIC_BUILD_FLAGS) $(LWS2_OPT) -o $(STATIC_OUT)
|
||||
@$(LLVM_OPT)strip $(STRIP_OPT) $(STATIC_OUT)
|
||||
endif
|
||||
# Dynamic Release
|
||||
@echo "Build C99 Example ($(CC) release dynamic)..."
|
||||
@echo "Build C Example ($(CC) release dynamic)..."
|
||||
$(COPY_LIB_CMD)
|
||||
@$(CC) $(GUI_APP) $(DYN_BUILD_FLAGS) $(LWS2_OPT) -o $(DYN_OUT)
|
||||
@$(LLVM_OPT)strip $(STRIP_OPT) $(DYN_OUT)
|
||||
|
@ -1,4 +1,4 @@
|
||||
# WebUI C99 Example
|
||||
# WebUI C Example
|
||||
# Windows - Microsoft Visual C
|
||||
|
||||
SHELL = CMD
|
||||
@ -20,11 +20,11 @@ debug:
|
||||
!ENDIF
|
||||
# Static with Debug info
|
||||
!IF "$(WEBUI_USE_TLS)" != "1"
|
||||
@echo Build C99 Example (Static Debug)...
|
||||
@echo Build C Example (Static Debug)...
|
||||
@cl /Zi main.c /I"$(INCLUDE_DIR)" /link /LIBPATH:"$(LIB_DIR)\debug" /MACHINE:X64 /SUBSYSTEM:CONSOLE $(WEBUI_LIB_NAME)-static.lib user32.lib Advapi32.lib Shell32.lib /OUT:main.exe 1>NUL 2>&1
|
||||
!ENDIF
|
||||
# Dynamic with Debug info
|
||||
@echo Build C99 Example (Dynamic Debug)...
|
||||
@echo Build C Example (Dynamic Debug)...
|
||||
@copy "$(LIB_DIR)\debug\$(WEBUI_LIB_NAME).dll" "$(WEBUI_LIB_NAME).dll"
|
||||
@cl /Zi main.c /I"$(INCLUDE_DIR)" /link /LIBPATH:"$(LIB_DIR)\debug" /MACHINE:X64 /SUBSYSTEM:CONSOLE $(WEBUI_LIB_NAME).lib user32.lib Advapi32.lib Shell32.lib /OUT:main-dyn.exe 1>NUL 2>&1
|
||||
# Clean
|
||||
@ -41,11 +41,11 @@ release:
|
||||
!ENDIF
|
||||
# Static Release
|
||||
!IF "$(WEBUI_USE_TLS)" != "1"
|
||||
@echo Build C99 Example (Static Release)...
|
||||
@echo Build C Example (Static Release)...
|
||||
@cl main.c /I"$(INCLUDE_DIR)" /link /LIBPATH:"$(LIB_DIR)" /MACHINE:X64 /SUBSYSTEM:WINDOWS $(WEBUI_LIB_NAME)-static.lib user32.lib Advapi32.lib Shell32.lib /OUT:main.exe 1>NUL 2>&1
|
||||
!ENDIF
|
||||
# Dynamic Release
|
||||
@echo Build C99 Example (Dynamic Release)...
|
||||
@echo Build C Example (Dynamic Release)...
|
||||
@copy "$(LIB_DIR)\$(WEBUI_LIB_NAME).dll" "$(WEBUI_LIB_NAME).dll"
|
||||
@cl main.c /I"$(INCLUDE_DIR)" /link /LIBPATH:"$(LIB_DIR)" /MACHINE:X64 /SUBSYSTEM:WINDOWS $(WEBUI_LIB_NAME).lib user32.lib Advapi32.lib Shell32.lib /OUT:main-dyn.exe 1>NUL 2>&1
|
||||
# Clean
|
||||
|
Loading…
Reference in New Issue
Block a user