mirror of
https://github.com/webui-dev/webui.git
synced 2024-09-11 14:06:09 +03:00
Update GNU Makefile
* Adding `-lOle32` for Windows, needed by WebView2 * Adding Cocoa and WebKit frameworks, needed by macOS WKWebView
This commit is contained in:
parent
33ff93f475
commit
c5ddba49fd
26
GNUmakefile
26
GNUmakefile
@ -38,6 +38,8 @@ ARCH_TARGET ?=
|
||||
CIVETWEB_BUILD_FLAGS := -o civetweb.o -I"$(MAKEFILE_DIR)/include/" -c "$(MAKEFILE_DIR)/src/civetweb/civetweb.c" -I"$(WEBUI_TLS_INCLUDE)" $(TLS_CFLAG) -w
|
||||
CIVETWEB_DEFINE_FLAGS = -DNDEBUG -DNO_CACHING -DNO_CGI -DUSE_WEBSOCKET $(TLS_CFLAG)
|
||||
WEBUI_BUILD_FLAGS := -o webui.o -I"$(MAKEFILE_DIR)/include/" -c "$(MAKEFILE_DIR)/src/webui.c" -I"$(WEBUI_TLS_INCLUDE)" $(TLS_CFLAG) -w
|
||||
WKWEBKIT_BUILD_FLAGS := -o wkwebview.o -c "$(MAKEFILE_DIR)/src/webview/wkwebview.m"
|
||||
WKWEBKIT_LINK_FLAGS := -framework Cocoa -framework WebKit
|
||||
|
||||
# OUTPUT FILES
|
||||
# The static output is the same for all platforms
|
||||
@ -50,13 +52,15 @@ ifeq ($(OS),Windows_NT)
|
||||
SHELL := CMD
|
||||
PLATFORM := windows
|
||||
LIB_DYN_OUT := $(WEBUI_OUT_LIB_NAME).dll
|
||||
LWS2_OPT := -lws2_32
|
||||
LWS2_OPT := -lws2_32 -lOle32
|
||||
CIVETWEB_DEFINE_FLAGS += -DMUST_IMPLEMENT_CLOCK_GETTIME
|
||||
else ifeq ($(shell uname),Darwin)
|
||||
# MacOS
|
||||
PLATFORM := macos
|
||||
CC = clang
|
||||
LIB_DYN_OUT := $(WEBUI_OUT_LIB_NAME).dylib
|
||||
WEBKIT := -framework Cocoa -framework WebKit
|
||||
WEBKIT_OBJ := wkwebview.o
|
||||
else
|
||||
# Linux
|
||||
PLATFORM := linux
|
||||
@ -93,19 +97,25 @@ ifeq ($(PLATFORM),windows)
|
||||
else
|
||||
@mkdir -p "$(BUILD_DIR)/debug"
|
||||
endif
|
||||
# Build macOS WKWebView
|
||||
ifeq ($(shell uname),Darwin)
|
||||
@cd "$(BUILD_DIR)/debug" \
|
||||
&& echo "Build WebUI Objective-C WKWebKit ($(CC) $(TARGET)debug)..." \
|
||||
&& $(CC) $(TARGET) $(WKWEBKIT_BUILD_FLAGS) -g -DWEBUI_LOG
|
||||
endif
|
||||
# Static with Debug info
|
||||
@cd "$(BUILD_DIR)/debug" \
|
||||
&& echo "Build WebUI library ($(CC) $(TARGET)debug static)..." \
|
||||
&& $(CC) $(TARGET) $(CIVETWEB_BUILD_FLAGS) $(CIVETWEB_DEFINE_FLAGS) -g \
|
||||
&& $(CC) $(TARGET) $(WEBUI_BUILD_FLAGS) -g -DWEBUI_LOG \
|
||||
&& $(LLVM_OPT)ar rc $(LIB_STATIC_OUT) webui.o civetweb.o \
|
||||
&& $(LLVM_OPT)ar rc $(LIB_STATIC_OUT) webui.o civetweb.o $(WEBKIT_OBJ) \
|
||||
&& $(LLVM_OPT)ranlib $(LIB_STATIC_OUT)
|
||||
# Dynamic with Debug info
|
||||
@cd "$(BUILD_DIR)/debug" \
|
||||
&& echo "Build WebUI library ($(CC) $(TARGET)debug dynamic)..." \
|
||||
&& $(CC) $(TARGET) $(CIVETWEB_BUILD_FLAGS) $(CIVETWEB_DEFINE_FLAGS) -g -fPIC \
|
||||
&& $(CC) $(TARGET) $(WEBUI_BUILD_FLAGS) -g -fPIC -DWEBUI_LOG \
|
||||
&& $(CC) $(TARGET) -shared -o $(LIB_DYN_OUT) webui.o civetweb.o -g -L"$(WEBUI_TLS_LIB)" $(TLS_LDFLAG_DYNAMIC) $(LWS2_OPT)
|
||||
&& $(CC) $(TARGET) -shared -o $(LIB_DYN_OUT) webui.o civetweb.o $(WEBKIT_OBJ) -g -L"$(WEBUI_TLS_LIB)" $(TLS_LDFLAG_DYNAMIC) $(LWS2_OPT) $(WKWEBKIT_LINK_FLAGS)
|
||||
ifeq ($(PLATFORM),windows)
|
||||
@cd "$(BUILD_DIR)/debug" && del *.o >nul 2>&1
|
||||
else
|
||||
@ -120,19 +130,25 @@ ifeq ($(PLATFORM),windows)
|
||||
else
|
||||
@mkdir -p "$(BUILD_DIR)"
|
||||
endif
|
||||
# Build macOS WKWebView
|
||||
ifeq ($(shell uname),Darwin)
|
||||
@cd "$(BUILD_DIR)/debug" \
|
||||
&& echo "Build WebUI Objective-C WKWebKit ($(CC) $(TARGET)release)..." \
|
||||
&& $(CC) $(TARGET) $(WKWEBKIT_BUILD_FLAGS) -Os
|
||||
endif
|
||||
# Static Release
|
||||
@cd "$(BUILD_DIR)" \
|
||||
&& echo "Build WebUI library ($(CC) $(TARGET)release static)..." \
|
||||
&& $(CC) $(TARGET) $(CIVETWEB_BUILD_FLAGS) $(CIVETWEB_DEFINE_FLAGS) -Os \
|
||||
&& $(CC) $(TARGET) $(WEBUI_BUILD_FLAGS) -Os \
|
||||
&& $(LLVM_OPT)ar rc $(LIB_STATIC_OUT) webui.o civetweb.o \
|
||||
&& $(LLVM_OPT)ar rc $(LIB_STATIC_OUT) webui.o civetweb.o $(WEBKIT_OBJ) \
|
||||
&& $(LLVM_OPT)ranlib $(LIB_STATIC_OUT)
|
||||
# Dynamic Release
|
||||
@cd "$(BUILD_DIR)" \
|
||||
&& echo "Build WebUI library ($(CC) $(TARGET)release dynamic)..." \
|
||||
&& $(CC) $(TARGET) $(CIVETWEB_BUILD_FLAGS) $(CIVETWEB_DEFINE_FLAGS) -Os -fPIC \
|
||||
&& $(CC) $(TARGET) $(WEBUI_BUILD_FLAGS) -O3 -fPIC \
|
||||
&& $(CC) $(TARGET) -shared -o $(LIB_DYN_OUT) webui.o civetweb.o -L"$(WEBUI_TLS_LIB)" $(TLS_LDFLAG_DYNAMIC) $(LWS2_OPT)
|
||||
&& $(CC) $(TARGET) -shared -o $(LIB_DYN_OUT) webui.o civetweb.o $(WEBKIT_OBJ) -L"$(WEBUI_TLS_LIB)" $(TLS_LDFLAG_DYNAMIC) $(LWS2_OPT) $(WKWEBKIT_LINK_FLAGS)
|
||||
# Clean
|
||||
ifeq ($(PLATFORM),windows)
|
||||
@strip --strip-unneeded $(BUILD_DIR)/$(LIB_DYN_OUT)
|
||||
|
@ -24,6 +24,7 @@ BUILD_LIB ?=
|
||||
# BUILD FLAGS
|
||||
STATIC_BUILD_FLAGS = main.c -I"$(INCLUDE_DIR)" -L"$(LIB_DIR)"
|
||||
DYN_BUILD_FLAGS = main.c -I"$(INCLUDE_DIR)" -L"$(LIB_DIR)"
|
||||
WKWEBKIT_LINK_FLAGS := -framework Cocoa -framework WebKit
|
||||
|
||||
# Platform conditions
|
||||
ifeq ($(OS),Windows_NT)
|
||||
@ -35,7 +36,7 @@ ifeq ($(OS),Windows_NT)
|
||||
DYN_BUILD_FLAGS += "$(WEBUI_LIB_NAME).dll" -lws2_32 -Wall -luser32
|
||||
STATIC_OUT := main.exe
|
||||
DYN_OUT := main-dyn.exe
|
||||
LWS2_OPT := -lws2_32
|
||||
LWS2_OPT := -lws2_32 -lOle32
|
||||
STRIP_OPT := --strip-all
|
||||
CONSOLE_APP := -Wl,-subsystem=console
|
||||
GUI_APP := -Wl,-subsystem=windows
|
||||
@ -75,12 +76,12 @@ endif
|
||||
# Static with Debug info
|
||||
ifneq ($(WEBUI_USE_TLS), 1)
|
||||
@echo "Build C Example ($(CC) debug static)..."
|
||||
@$(CC) -g $(CONSOLE_APP) $(STATIC_BUILD_FLAGS) $(LWS2_OPT) -o $(STATIC_OUT)
|
||||
@$(CC) -g $(CONSOLE_APP) $(STATIC_BUILD_FLAGS) $(LWS2_OPT) $(WKWEBKIT_LINK_FLAGS) -o $(STATIC_OUT)
|
||||
endif
|
||||
# Dynamic with Debug info
|
||||
@echo "Build C Example ($(CC) debug dynamic)..."
|
||||
$(COPY_LIB_CMD)
|
||||
@$(CC) -g $(CONSOLE_APP) $(DYN_BUILD_FLAGS) $(LWS2_OPT) -o $(DYN_OUT)
|
||||
@$(CC) -g $(CONSOLE_APP) $(DYN_BUILD_FLAGS) $(LWS2_OPT) $(WKWEBKIT_LINK_FLAGS) -o $(DYN_OUT)
|
||||
# Clean
|
||||
ifeq ($(PLATFORM),windows)
|
||||
@- del *.o >nul 2>&1
|
||||
@ -97,13 +98,13 @@ endif
|
||||
# Static Release
|
||||
ifneq ($(WEBUI_USE_TLS), 1)
|
||||
@echo "Build C Example ($(CC) release static)..."
|
||||
@$(CC) -Os $(GUI_APP) $(STATIC_BUILD_FLAGS) $(LWS2_OPT) -o $(STATIC_OUT)
|
||||
@$(CC) -Os $(GUI_APP) $(STATIC_BUILD_FLAGS) $(LWS2_OPT) $(WKWEBKIT_LINK_FLAGS) -o $(STATIC_OUT)
|
||||
@$(LLVM_OPT)strip $(STRIP_OPT) $(STATIC_OUT)
|
||||
endif
|
||||
# Dynamic Release
|
||||
@echo "Build C Example ($(CC) release dynamic)..."
|
||||
$(COPY_LIB_CMD)
|
||||
@$(CC) $(GUI_APP) $(DYN_BUILD_FLAGS) $(LWS2_OPT) -o $(DYN_OUT)
|
||||
@$(CC) $(GUI_APP) $(DYN_BUILD_FLAGS) $(LWS2_OPT) $(WKWEBKIT_LINK_FLAGS) -o $(DYN_OUT)
|
||||
@$(LLVM_OPT)strip $(STRIP_OPT) $(DYN_OUT)
|
||||
# Clean
|
||||
ifeq ($(PLATFORM),windows)
|
||||
|
@ -24,6 +24,7 @@ BUILD_LIB ?=
|
||||
# BUILD FLAGS
|
||||
STATIC_BUILD_FLAGS = main.c -I"$(INCLUDE_DIR)" -L"$(LIB_DIR)"
|
||||
DYN_BUILD_FLAGS = main.c -I"$(INCLUDE_DIR)" -L"$(LIB_DIR)"
|
||||
WKWEBKIT_LINK_FLAGS := -framework Cocoa -framework WebKit
|
||||
|
||||
# Platform conditions
|
||||
ifeq ($(OS),Windows_NT)
|
||||
@ -35,7 +36,7 @@ ifeq ($(OS),Windows_NT)
|
||||
DYN_BUILD_FLAGS += "$(WEBUI_LIB_NAME).dll" -lws2_32 -Wall -luser32
|
||||
STATIC_OUT := main.exe
|
||||
DYN_OUT := main-dyn.exe
|
||||
LWS2_OPT := -lws2_32
|
||||
LWS2_OPT := -lws2_32 -lOle32
|
||||
STRIP_OPT := --strip-all
|
||||
CONSOLE_APP := -Wl,-subsystem=console
|
||||
GUI_APP := -Wl,-subsystem=windows
|
||||
@ -75,12 +76,12 @@ endif
|
||||
# Static with Debug info
|
||||
ifneq ($(WEBUI_USE_TLS), 1)
|
||||
@echo "Build C Example ($(CC) debug static)..."
|
||||
@$(CC) -g $(CONSOLE_APP) $(STATIC_BUILD_FLAGS) $(LWS2_OPT) -o $(STATIC_OUT)
|
||||
@$(CC) -g $(CONSOLE_APP) $(STATIC_BUILD_FLAGS) $(LWS2_OPT) $(WKWEBKIT_LINK_FLAGS) -o $(STATIC_OUT)
|
||||
endif
|
||||
# Dynamic with Debug info
|
||||
@echo "Build C Example ($(CC) debug dynamic)..."
|
||||
$(COPY_LIB_CMD)
|
||||
@$(CC) -g $(CONSOLE_APP) $(DYN_BUILD_FLAGS) $(LWS2_OPT) -o $(DYN_OUT)
|
||||
@$(CC) -g $(CONSOLE_APP) $(DYN_BUILD_FLAGS) $(LWS2_OPT) $(WKWEBKIT_LINK_FLAGS) -o $(DYN_OUT)
|
||||
# Clean
|
||||
ifeq ($(PLATFORM),windows)
|
||||
@- del *.o >nul 2>&1
|
||||
@ -97,13 +98,13 @@ endif
|
||||
# Static Release
|
||||
ifneq ($(WEBUI_USE_TLS), 1)
|
||||
@echo "Build C Example ($(CC) release static)..."
|
||||
@$(CC) -Os $(GUI_APP) $(STATIC_BUILD_FLAGS) $(LWS2_OPT) -o $(STATIC_OUT)
|
||||
@$(CC) -Os $(GUI_APP) $(STATIC_BUILD_FLAGS) $(LWS2_OPT) $(WKWEBKIT_LINK_FLAGS) -o $(STATIC_OUT)
|
||||
@$(LLVM_OPT)strip $(STRIP_OPT) $(STATIC_OUT)
|
||||
endif
|
||||
# Dynamic Release
|
||||
@echo "Build C Example ($(CC) release dynamic)..."
|
||||
$(COPY_LIB_CMD)
|
||||
@$(CC) $(GUI_APP) $(DYN_BUILD_FLAGS) $(LWS2_OPT) -o $(DYN_OUT)
|
||||
@$(CC) $(GUI_APP) $(DYN_BUILD_FLAGS) $(LWS2_OPT) $(WKWEBKIT_LINK_FLAGS) -o $(DYN_OUT)
|
||||
@$(LLVM_OPT)strip $(STRIP_OPT) $(DYN_OUT)
|
||||
# Clean
|
||||
ifeq ($(PLATFORM),windows)
|
||||
|
@ -24,6 +24,7 @@ BUILD_LIB ?=
|
||||
# BUILD FLAGS
|
||||
STATIC_BUILD_FLAGS = main.c -I"$(INCLUDE_DIR)" -L"$(LIB_DIR)"
|
||||
DYN_BUILD_FLAGS = main.c -I"$(INCLUDE_DIR)" -L"$(LIB_DIR)"
|
||||
WKWEBKIT_LINK_FLAGS := -framework Cocoa -framework WebKit
|
||||
|
||||
# Platform conditions
|
||||
ifeq ($(OS),Windows_NT)
|
||||
@ -35,7 +36,7 @@ ifeq ($(OS),Windows_NT)
|
||||
DYN_BUILD_FLAGS += "$(WEBUI_LIB_NAME).dll" -lws2_32 -Wall -luser32
|
||||
STATIC_OUT := main.exe
|
||||
DYN_OUT := main-dyn.exe
|
||||
LWS2_OPT := -lws2_32
|
||||
LWS2_OPT := -lws2_32 -lOle32
|
||||
STRIP_OPT := --strip-all
|
||||
CONSOLE_APP := -Wl,-subsystem=console
|
||||
GUI_APP := -Wl,-subsystem=windows
|
||||
@ -75,12 +76,12 @@ endif
|
||||
# Static with Debug info
|
||||
ifneq ($(WEBUI_USE_TLS), 1)
|
||||
@echo "Build C Example ($(CC) debug static)..."
|
||||
@$(CC) -g $(CONSOLE_APP) $(STATIC_BUILD_FLAGS) $(LWS2_OPT) -o $(STATIC_OUT)
|
||||
@$(CC) -g $(CONSOLE_APP) $(STATIC_BUILD_FLAGS) $(LWS2_OPT) $(WKWEBKIT_LINK_FLAGS) -o $(STATIC_OUT)
|
||||
endif
|
||||
# Dynamic with Debug info
|
||||
@echo "Build C Example ($(CC) debug dynamic)..."
|
||||
$(COPY_LIB_CMD)
|
||||
@$(CC) -g $(CONSOLE_APP) $(DYN_BUILD_FLAGS) $(LWS2_OPT) -o $(DYN_OUT)
|
||||
@$(CC) -g $(CONSOLE_APP) $(DYN_BUILD_FLAGS) $(LWS2_OPT) $(WKWEBKIT_LINK_FLAGS) -o $(DYN_OUT)
|
||||
# Clean
|
||||
ifeq ($(PLATFORM),windows)
|
||||
@- del *.o >nul 2>&1
|
||||
@ -97,13 +98,13 @@ endif
|
||||
# Static Release
|
||||
ifneq ($(WEBUI_USE_TLS), 1)
|
||||
@echo "Build C Example ($(CC) release static)..."
|
||||
@$(CC) -Os $(GUI_APP) $(STATIC_BUILD_FLAGS) $(LWS2_OPT) -o $(STATIC_OUT)
|
||||
@$(CC) -Os $(GUI_APP) $(STATIC_BUILD_FLAGS) $(LWS2_OPT) $(WKWEBKIT_LINK_FLAGS) -o $(STATIC_OUT)
|
||||
@$(LLVM_OPT)strip $(STRIP_OPT) $(STATIC_OUT)
|
||||
endif
|
||||
# Dynamic Release
|
||||
@echo "Build C Example ($(CC) release dynamic)..."
|
||||
$(COPY_LIB_CMD)
|
||||
@$(CC) $(GUI_APP) $(DYN_BUILD_FLAGS) $(LWS2_OPT) -o $(DYN_OUT)
|
||||
@$(CC) $(GUI_APP) $(DYN_BUILD_FLAGS) $(LWS2_OPT) $(WKWEBKIT_LINK_FLAGS) -o $(DYN_OUT)
|
||||
@$(LLVM_OPT)strip $(STRIP_OPT) $(DYN_OUT)
|
||||
# Clean
|
||||
ifeq ($(PLATFORM),windows)
|
||||
|
@ -24,6 +24,7 @@ BUILD_LIB ?=
|
||||
# BUILD FLAGS
|
||||
STATIC_BUILD_FLAGS = main.c -I"$(INCLUDE_DIR)" -L"$(LIB_DIR)"
|
||||
DYN_BUILD_FLAGS = main.c -I"$(INCLUDE_DIR)" -L"$(LIB_DIR)"
|
||||
WKWEBKIT_LINK_FLAGS := -framework Cocoa -framework WebKit
|
||||
|
||||
# Platform conditions
|
||||
ifeq ($(OS),Windows_NT)
|
||||
@ -35,7 +36,7 @@ ifeq ($(OS),Windows_NT)
|
||||
DYN_BUILD_FLAGS += "$(WEBUI_LIB_NAME).dll" -lws2_32 -Wall -luser32
|
||||
STATIC_OUT := main.exe
|
||||
DYN_OUT := main-dyn.exe
|
||||
LWS2_OPT := -lws2_32
|
||||
LWS2_OPT := -lws2_32 -lOle32
|
||||
STRIP_OPT := --strip-all
|
||||
CONSOLE_APP := -Wl,-subsystem=console
|
||||
GUI_APP := -Wl,-subsystem=windows
|
||||
@ -75,12 +76,12 @@ endif
|
||||
# Static with Debug info
|
||||
ifneq ($(WEBUI_USE_TLS), 1)
|
||||
@echo "Build C Example ($(CC) debug static)..."
|
||||
@$(CC) -g $(CONSOLE_APP) $(STATIC_BUILD_FLAGS) $(LWS2_OPT) -o $(STATIC_OUT)
|
||||
@$(CC) -g $(CONSOLE_APP) $(STATIC_BUILD_FLAGS) $(LWS2_OPT) $(WKWEBKIT_LINK_FLAGS) -o $(STATIC_OUT)
|
||||
endif
|
||||
# Dynamic with Debug info
|
||||
@echo "Build C Example ($(CC) debug dynamic)..."
|
||||
$(COPY_LIB_CMD)
|
||||
@$(CC) -g $(CONSOLE_APP) $(DYN_BUILD_FLAGS) $(LWS2_OPT) -o $(DYN_OUT)
|
||||
@$(CC) -g $(CONSOLE_APP) $(DYN_BUILD_FLAGS) $(LWS2_OPT) $(WKWEBKIT_LINK_FLAGS) -o $(DYN_OUT)
|
||||
# Clean
|
||||
ifeq ($(PLATFORM),windows)
|
||||
@- del *.o >nul 2>&1
|
||||
@ -97,13 +98,13 @@ endif
|
||||
# Static Release
|
||||
ifneq ($(WEBUI_USE_TLS), 1)
|
||||
@echo "Build C Example ($(CC) release static)..."
|
||||
@$(CC) -Os $(GUI_APP) $(STATIC_BUILD_FLAGS) $(LWS2_OPT) -o $(STATIC_OUT)
|
||||
@$(CC) -Os $(GUI_APP) $(STATIC_BUILD_FLAGS) $(LWS2_OPT) $(WKWEBKIT_LINK_FLAGS) -o $(STATIC_OUT)
|
||||
@$(LLVM_OPT)strip $(STRIP_OPT) $(STATIC_OUT)
|
||||
endif
|
||||
# Dynamic Release
|
||||
@echo "Build C Example ($(CC) release dynamic)..."
|
||||
$(COPY_LIB_CMD)
|
||||
@$(CC) $(GUI_APP) $(DYN_BUILD_FLAGS) $(LWS2_OPT) -o $(DYN_OUT)
|
||||
@$(CC) $(GUI_APP) $(DYN_BUILD_FLAGS) $(LWS2_OPT) $(WKWEBKIT_LINK_FLAGS) -o $(DYN_OUT)
|
||||
@$(LLVM_OPT)strip $(STRIP_OPT) $(DYN_OUT)
|
||||
# Clean
|
||||
ifeq ($(PLATFORM),windows)
|
||||
|
@ -24,6 +24,7 @@ BUILD_LIB ?=
|
||||
# BUILD FLAGS
|
||||
STATIC_BUILD_FLAGS = main.c -I"$(INCLUDE_DIR)" -L"$(LIB_DIR)"
|
||||
DYN_BUILD_FLAGS = main.c -I"$(INCLUDE_DIR)" -L"$(LIB_DIR)"
|
||||
WKWEBKIT_LINK_FLAGS := -framework Cocoa -framework WebKit
|
||||
|
||||
# Platform conditions
|
||||
ifeq ($(OS),Windows_NT)
|
||||
@ -35,7 +36,7 @@ ifeq ($(OS),Windows_NT)
|
||||
DYN_BUILD_FLAGS += "$(WEBUI_LIB_NAME).dll" -lws2_32 -Wall -luser32
|
||||
STATIC_OUT := main.exe
|
||||
DYN_OUT := main-dyn.exe
|
||||
LWS2_OPT := -lws2_32
|
||||
LWS2_OPT := -lws2_32 -lOle32
|
||||
STRIP_OPT := --strip-all
|
||||
CONSOLE_APP := -Wl,-subsystem=console
|
||||
GUI_APP := -Wl,-subsystem=windows
|
||||
@ -75,12 +76,12 @@ endif
|
||||
# Static with Debug info
|
||||
ifneq ($(WEBUI_USE_TLS), 1)
|
||||
@echo "Build C Example ($(CC) debug static)..."
|
||||
@$(CC) -g $(CONSOLE_APP) $(STATIC_BUILD_FLAGS) $(LWS2_OPT) -o $(STATIC_OUT)
|
||||
@$(CC) -g $(CONSOLE_APP) $(STATIC_BUILD_FLAGS) $(LWS2_OPT) $(WKWEBKIT_LINK_FLAGS) -o $(STATIC_OUT)
|
||||
endif
|
||||
# Dynamic with Debug info
|
||||
@echo "Build C Example ($(CC) debug dynamic)..."
|
||||
$(COPY_LIB_CMD)
|
||||
@$(CC) -g $(CONSOLE_APP) $(DYN_BUILD_FLAGS) $(LWS2_OPT) -o $(DYN_OUT)
|
||||
@$(CC) -g $(CONSOLE_APP) $(DYN_BUILD_FLAGS) $(LWS2_OPT) $(WKWEBKIT_LINK_FLAGS) -o $(DYN_OUT)
|
||||
# Clean
|
||||
ifeq ($(PLATFORM),windows)
|
||||
@- del *.o >nul 2>&1
|
||||
@ -97,13 +98,13 @@ endif
|
||||
# Static Release
|
||||
ifneq ($(WEBUI_USE_TLS), 1)
|
||||
@echo "Build C Example ($(CC) release static)..."
|
||||
@$(CC) -Os $(GUI_APP) $(STATIC_BUILD_FLAGS) $(LWS2_OPT) -o $(STATIC_OUT)
|
||||
@$(CC) -Os $(GUI_APP) $(STATIC_BUILD_FLAGS) $(LWS2_OPT) $(WKWEBKIT_LINK_FLAGS) -o $(STATIC_OUT)
|
||||
@$(LLVM_OPT)strip $(STRIP_OPT) $(STATIC_OUT)
|
||||
endif
|
||||
# Dynamic Release
|
||||
@echo "Build C Example ($(CC) release dynamic)..."
|
||||
$(COPY_LIB_CMD)
|
||||
@$(CC) $(GUI_APP) $(DYN_BUILD_FLAGS) $(LWS2_OPT) -o $(DYN_OUT)
|
||||
@$(CC) $(GUI_APP) $(DYN_BUILD_FLAGS) $(LWS2_OPT) $(WKWEBKIT_LINK_FLAGS) -o $(DYN_OUT)
|
||||
@$(LLVM_OPT)strip $(STRIP_OPT) $(DYN_OUT)
|
||||
# Clean
|
||||
ifeq ($(PLATFORM),windows)
|
||||
|
@ -24,6 +24,7 @@ BUILD_LIB ?=
|
||||
# BUILD FLAGS
|
||||
STATIC_BUILD_FLAGS = main.c -I"$(INCLUDE_DIR)" -L"$(LIB_DIR)"
|
||||
DYN_BUILD_FLAGS = main.c -I"$(INCLUDE_DIR)" -L"$(LIB_DIR)"
|
||||
WKWEBKIT_LINK_FLAGS := -framework Cocoa -framework WebKit
|
||||
|
||||
# Platform conditions
|
||||
ifeq ($(OS),Windows_NT)
|
||||
@ -35,7 +36,7 @@ ifeq ($(OS),Windows_NT)
|
||||
DYN_BUILD_FLAGS += "$(WEBUI_LIB_NAME).dll" -lws2_32 -Wall -luser32
|
||||
STATIC_OUT := main.exe
|
||||
DYN_OUT := main-dyn.exe
|
||||
LWS2_OPT := -lws2_32
|
||||
LWS2_OPT := -lws2_32 -lOle32
|
||||
STRIP_OPT := --strip-all
|
||||
CONSOLE_APP := -Wl,-subsystem=console
|
||||
GUI_APP := -Wl,-subsystem=windows
|
||||
@ -75,12 +76,12 @@ endif
|
||||
# Static with Debug info
|
||||
ifneq ($(WEBUI_USE_TLS), 1)
|
||||
@echo "Build C Example ($(CC) debug static)..."
|
||||
@$(CC) -g $(CONSOLE_APP) $(STATIC_BUILD_FLAGS) $(LWS2_OPT) -o $(STATIC_OUT)
|
||||
@$(CC) -g $(CONSOLE_APP) $(STATIC_BUILD_FLAGS) $(LWS2_OPT) $(WKWEBKIT_LINK_FLAGS) -o $(STATIC_OUT)
|
||||
endif
|
||||
# Dynamic with Debug info
|
||||
@echo "Build C Example ($(CC) debug dynamic)..."
|
||||
$(COPY_LIB_CMD)
|
||||
@$(CC) -g $(CONSOLE_APP) $(DYN_BUILD_FLAGS) $(LWS2_OPT) -o $(DYN_OUT)
|
||||
@$(CC) -g $(CONSOLE_APP) $(DYN_BUILD_FLAGS) $(LWS2_OPT) $(WKWEBKIT_LINK_FLAGS) -o $(DYN_OUT)
|
||||
# Clean
|
||||
ifeq ($(PLATFORM),windows)
|
||||
@- del *.o >nul 2>&1
|
||||
@ -97,13 +98,13 @@ endif
|
||||
# Static Release
|
||||
ifneq ($(WEBUI_USE_TLS), 1)
|
||||
@echo "Build C Example ($(CC) release static)..."
|
||||
@$(CC) -Os $(GUI_APP) $(STATIC_BUILD_FLAGS) $(LWS2_OPT) -o $(STATIC_OUT)
|
||||
@$(CC) -Os $(GUI_APP) $(STATIC_BUILD_FLAGS) $(LWS2_OPT) $(WKWEBKIT_LINK_FLAGS) -o $(STATIC_OUT)
|
||||
@$(LLVM_OPT)strip $(STRIP_OPT) $(STATIC_OUT)
|
||||
endif
|
||||
# Dynamic Release
|
||||
@echo "Build C Example ($(CC) release dynamic)..."
|
||||
$(COPY_LIB_CMD)
|
||||
@$(CC) $(GUI_APP) $(DYN_BUILD_FLAGS) $(LWS2_OPT) -o $(DYN_OUT)
|
||||
@$(CC) $(GUI_APP) $(DYN_BUILD_FLAGS) $(LWS2_OPT) $(WKWEBKIT_LINK_FLAGS) -o $(DYN_OUT)
|
||||
@$(LLVM_OPT)strip $(STRIP_OPT) $(DYN_OUT)
|
||||
# Clean
|
||||
ifeq ($(PLATFORM),windows)
|
||||
|
@ -24,6 +24,7 @@ BUILD_LIB ?=
|
||||
# BUILD FLAGS
|
||||
STATIC_BUILD_FLAGS = main.c -I"$(INCLUDE_DIR)" -L"$(LIB_DIR)"
|
||||
DYN_BUILD_FLAGS = main.c -I"$(INCLUDE_DIR)" -L"$(LIB_DIR)"
|
||||
WKWEBKIT_LINK_FLAGS := -framework Cocoa -framework WebKit
|
||||
|
||||
# Platform conditions
|
||||
ifeq ($(OS),Windows_NT)
|
||||
@ -35,7 +36,7 @@ ifeq ($(OS),Windows_NT)
|
||||
DYN_BUILD_FLAGS += "$(WEBUI_LIB_NAME).dll" -lws2_32 -Wall -luser32
|
||||
STATIC_OUT := main.exe
|
||||
DYN_OUT := main-dyn.exe
|
||||
LWS2_OPT := -lws2_32
|
||||
LWS2_OPT := -lws2_32 -lOle32
|
||||
STRIP_OPT := --strip-all
|
||||
CONSOLE_APP := -Wl,-subsystem=console
|
||||
GUI_APP := -Wl,-subsystem=windows
|
||||
@ -75,12 +76,12 @@ endif
|
||||
# Static with Debug info
|
||||
ifneq ($(WEBUI_USE_TLS), 1)
|
||||
@echo "Build C Example ($(CC) debug static)..."
|
||||
@$(CC) -g $(CONSOLE_APP) $(STATIC_BUILD_FLAGS) $(LWS2_OPT) -o $(STATIC_OUT)
|
||||
@$(CC) -g $(CONSOLE_APP) $(STATIC_BUILD_FLAGS) $(LWS2_OPT) $(WKWEBKIT_LINK_FLAGS) -o $(STATIC_OUT)
|
||||
endif
|
||||
# Dynamic with Debug info
|
||||
@echo "Build C Example ($(CC) debug dynamic)..."
|
||||
$(COPY_LIB_CMD)
|
||||
@$(CC) -g $(CONSOLE_APP) $(DYN_BUILD_FLAGS) $(LWS2_OPT) -o $(DYN_OUT)
|
||||
@$(CC) -g $(CONSOLE_APP) $(DYN_BUILD_FLAGS) $(LWS2_OPT) $(WKWEBKIT_LINK_FLAGS) -o $(DYN_OUT)
|
||||
# Clean
|
||||
ifeq ($(PLATFORM),windows)
|
||||
@- del *.o >nul 2>&1
|
||||
@ -97,13 +98,13 @@ endif
|
||||
# Static Release
|
||||
ifneq ($(WEBUI_USE_TLS), 1)
|
||||
@echo "Build C Example ($(CC) release static)..."
|
||||
@$(CC) -Os $(GUI_APP) $(STATIC_BUILD_FLAGS) $(LWS2_OPT) -o $(STATIC_OUT)
|
||||
@$(CC) -Os $(GUI_APP) $(STATIC_BUILD_FLAGS) $(LWS2_OPT) $(WKWEBKIT_LINK_FLAGS) -o $(STATIC_OUT)
|
||||
@$(LLVM_OPT)strip $(STRIP_OPT) $(STATIC_OUT)
|
||||
endif
|
||||
# Dynamic Release
|
||||
@echo "Build C Example ($(CC) release dynamic)..."
|
||||
$(COPY_LIB_CMD)
|
||||
@$(CC) $(GUI_APP) $(DYN_BUILD_FLAGS) $(LWS2_OPT) -o $(DYN_OUT)
|
||||
@$(CC) $(GUI_APP) $(DYN_BUILD_FLAGS) $(LWS2_OPT) $(WKWEBKIT_LINK_FLAGS) -o $(DYN_OUT)
|
||||
@$(LLVM_OPT)strip $(STRIP_OPT) $(DYN_OUT)
|
||||
# Clean
|
||||
ifeq ($(PLATFORM),windows)
|
||||
|
Loading…
Reference in New Issue
Block a user