mirror of
https://github.com/webui-dev/webui.git
synced 2024-09-11 22:17:13 +03:00
✨Add a build for MacOS
This copies the Linux build to generate binaries for MacOS
This commit is contained in:
parent
9aca227129
commit
599d452a70
44
build/MacOS/Clang/Makefile
Normal file
44
build/MacOS/Clang/Makefile
Normal file
@ -0,0 +1,44 @@
|
||||
# WebUI Library
|
||||
# MacOS - Clang
|
||||
|
||||
SOURCE=../../../src
|
||||
INCLUDE=../../../include
|
||||
|
||||
all: release
|
||||
|
||||
debug:
|
||||
# Static with Debug info
|
||||
@echo "Build WebUI Library (Debug Static)..."
|
||||
@clang -g -m64 -o mongoose.o -I "$(INCLUDE)" -c "$(SOURCE)/mongoose.c"
|
||||
@clang -g -m64 -o webui.o -I "$(INCLUDE)" -c "$(SOURCE)/webui.c"
|
||||
@ar rc libwebui-2-aarch64-apple-darwin.a webui.o mongoose.o
|
||||
@ranlib libwebui-2-aarch64-apple-darwin.a
|
||||
# Dynamic with Debug info
|
||||
@echo "Build WebUI Library (Debug Dynamic)..."
|
||||
@clang -g -fPIC -m64 -o mongoose.o -I "$(INCLUDE)" -c "$(SOURCE)/mongoose.c"
|
||||
@clang -g -fPIC -m64 -o webui.o -I "$(INCLUDE)" -c "$(SOURCE)/webui.c"
|
||||
@clang -g -shared -o webui-2-aarch64-apple-darwin.dylib webui.o mongoose.o
|
||||
# Clean
|
||||
@- rm -f *.o
|
||||
@echo "Done."
|
||||
|
||||
release:
|
||||
# Static Release
|
||||
@echo "Build WebUI Library (Release Static)..."
|
||||
@clang -Os -m64 -o mongoose.o -I "$(INCLUDE)" -c "$(SOURCE)/mongoose.c"
|
||||
@clang -Os -m64 -o webui.o -I "$(INCLUDE)" -c "$(SOURCE)/webui.c"
|
||||
@ar rc libwebui-2-aarch64-apple-darwin.a webui.o mongoose.o
|
||||
@ranlib libwebui-2-aarch64-apple-darwin.a
|
||||
# Dynamic Release
|
||||
@echo "Build WebUI Library (Release Dynamic)..."
|
||||
@clang -O3 -fPIC -m64 -o mongoose.o -I "$(INCLUDE)" -c "$(SOURCE)/mongoose.c"
|
||||
@clang -O3 -fPIC -m64 -o webui.o -I "$(INCLUDE)" -c "$(SOURCE)/webui.c"
|
||||
@clang -shared -o webui-2-aarch64-apple-darwin.dylib webui.o mongoose.o
|
||||
# Clean
|
||||
@- rm -f *.o
|
||||
@echo "Done."
|
||||
|
||||
clean:
|
||||
- rm -f *.o
|
||||
- rm -f *.dylib
|
||||
- rm -f *.a
|
@ -82,6 +82,21 @@
|
||||
#define WEBUI_PCLOSE pclose
|
||||
#define WEBUI_MAX_PATH PATH_MAX
|
||||
#endif
|
||||
// -- Apple ---------------------------
|
||||
#ifdef __APPLE__
|
||||
#include <pthread.h> // POSIX threading
|
||||
#include <unistd.h>
|
||||
#include <limits.h>
|
||||
#include <dirent.h>
|
||||
#include <sys/socket.h>
|
||||
#include <fcntl.h>
|
||||
#include <poll.h>
|
||||
#define WEBUI_GET_CURRENT_DIR getcwd
|
||||
#define WEBUI_FILE_EXIST access
|
||||
#define WEBUI_POPEN popen
|
||||
#define WEBUI_PCLOSE pclose
|
||||
#define WEBUI_MAX_PATH PATH_MAX
|
||||
#endif
|
||||
|
||||
// -- Structs -------------------------
|
||||
struct webui_event_t;
|
||||
|
Loading…
Reference in New Issue
Block a user