Skip to content

Commit

Permalink
Fix GNU Makefile - CreateProcess failed
Browse files Browse the repository at this point in the history
process_begin: CreateProcess(NULL, uname, ...) failed.
GNUmakefile:30: pipe: No error
process_begin: CreateProcess(NULL, uname, ...) failed.
GNUmakefile:111: pipe: No error
process_begin: CreateProcess(NULL, uname, ...) failed.
GNUmakefile:144: pipe: No error
  • Loading branch information
AlbertShown committed Nov 29, 2024
1 parent 734f00a commit 0f4cf1a
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@

WEBUI_OUT_LIB_NAME = webui-2

# Detect the OS once
ifeq ($(OS),Windows_NT)
DETECTED_OS := Windows
else
DETECTED_OS := $(shell uname -s)
endif

# TLS
WEBUI_USE_TLS =
WEBUI_TLS_INCLUDE ?= .
Expand All @@ -13,7 +20,7 @@ TLS_LDFLAG_DYNAMIC =
ifeq ($(WEBUI_USE_TLS), 1)
WEBUI_OUT_LIB_NAME = webui-2-secure
TLS_CFLAG = -DWEBUI_TLS -DNO_SSL_DL -DOPENSSL_API_1_1
ifeq ($(OS),Windows_NT)
ifeq ($(DETECTED_OS),Windows)
TLS_LDFLAG_DYNAMIC = -lssl -lcrypto -lbcrypt
else
TLS_LDFLAG_DYNAMIC = -lssl -lcrypto
Expand All @@ -27,7 +34,7 @@ BUILD_DIR := $(MAKEFILE_DIR)/dist
# ARGS
CC ?= gcc
ifeq ($(CC), cc)
ifeq ($(shell uname),Darwin)
ifeq ($(DETECTED_OS),Darwin)
CC = clang
else
CC = gcc
Expand All @@ -50,14 +57,14 @@ WARNING_LOG := -Wall -Wno-unused
LIB_STATIC_OUT := lib$(WEBUI_OUT_LIB_NAME)-static.a

# Platform defaults and dynamic library outputs
ifeq ($(OS),Windows_NT)
ifeq ($(DETECTED_OS),Windows)
# Windows
SHELL := CMD
PLATFORM := windows
LIB_DYN_OUT := $(WEBUI_OUT_LIB_NAME).dll
LWS2_OPT := -lws2_32 -lole32
CIVETWEB_DEFINE_FLAGS += -DMUST_IMPLEMENT_CLOCK_GETTIME
else ifeq ($(shell uname),Darwin)
else ifeq ($(DETECTED_OS),Darwin)
# MacOS
PLATFORM := macos
CC = clang
Expand Down Expand Up @@ -108,7 +115,7 @@ else
@mkdir -p "$(BUILD_DIR)/debug"
endif
# Build macOS WKWebView
ifeq ($(shell uname),Darwin)
ifeq ($(DETECTED_OS),Darwin)
@cd "$(BUILD_DIR)/debug" \
&& echo "Build WebUI Objective-C WKWebKit ($(CC) $(TARGET) debug)..." \
&& $(CC) $(TARGET) $(WKWEBKIT_BUILD_FLAGS) -g -DWEBUI_LOG
Expand Down Expand Up @@ -141,7 +148,7 @@ else
@mkdir -p "$(BUILD_DIR)"
endif
# Build macOS WKWebView
ifeq ($(shell uname),Darwin)
ifeq ($(DETECTED_OS),Darwin)
@cd "$(BUILD_DIR)" \
&& echo "Build WebUI Objective-C WKWebKit ($(CC) $(TARGET) release)..." \
&& $(CC) $(TARGET) $(WKWEBKIT_BUILD_FLAGS) -Os
Expand Down

0 comments on commit 0f4cf1a

Please sign in to comment.