Fix #17, Add nuklear, Unified linux compilation

This commit is contained in:
PedroEdiaz
2024-10-27 16:09:29 -06:00
parent 3fa4eed366
commit 8c565ffd25
6 changed files with 18 additions and 22 deletions

View File

@@ -14,7 +14,7 @@ OBJ = \
CFLAGS = \
-I./ext/cglm/include \
-I./ext/glfw/include \
-Wall -Wno-unused-function -std=c99 -D_GNU_SOURCE \
-Wall -Wno-unused-function -std=c99 -D_POSIX_C_SOURCE \
WAYLAND-LIB = \
xdg-shell \
@@ -31,8 +31,7 @@ help:
@echo "Para compilar el proyecto a tu sistema operativo"
@echo "porfavor usa uno de los siguientes comandos:"
@echo " $(MAKE) windows"
@echo " $(MAKE) linux-x11"
@echo " $(MAKE) linux-wayland"
@echo " $(MAKE) linux"
@echo " $(MAKE) cocoa"
@echo "Para limpiar los archivos compilados se puede usar"
@echo " $(MAKE) clean"
@@ -49,17 +48,13 @@ glfw.dll:
$(CC) -fPIC -shared -D_GLFW_WIN32 -D_GLFW_BUILD_DLL ./ext/glfw/src/*.c -o $@ -lgdi32
# LINUX
linux-x11: $(OBJ)
$(MAKE) BKN=_GLFW_X11 libglfw.so
$(CC) -o $(BIN) $(OBJ) -L. -lGLEW -lGL -lglfw -lm
linux-wayland: $(OBJ)
linux: $(OBJ)
for i in $(WAYLAND-LIB); \
do \
wayland-scanner client-header ext/glfw/deps/wayland/$$i.xml ext/glfw/deps/wayland/$$i-client-protocol.h; \
wayland-scanner private-code ext/glfw/deps/wayland/$$i.xml ext/glfw/deps/wayland/$$i-client-protocol-code.h; \
done
$(MAKE) BKN=_GLFW_WAYLAND libglfw.so
$(MAKE) DFLAGS="-D_GLFW_WAYLAND -D_GLFW_X11" libglfw.so
$(CC) -o $(BIN) $(OBJ) -L. -lGLEW -lGL -lglfw -lm
run-linux:
@@ -67,11 +62,11 @@ run-linux:
# COCOA
cocoa: $(OBJ)
$(MAKE) BKN=_GLFW_COCOA libglfw.so
$(MAKE) DFLAGS="-D_GLFW_COCOA" libglfw.so
$(CC) -framework OpenGL -o $(BIN) $(OBJ) -L. -lGLEW -lGL -lglfw
libglfw.so:
$(CC) -fPIC -shared -D$(BKN) -D_GLFW_BUILD_DLL -Iext/glfw/deps/wayland ./ext/glfw/src/*.c -o $@
$(CC) -fPIC -shared $(DFLAGS)-D_GLFW_BUILD_DLL -Iext/glfw/deps/wayland ./ext/glfw/src/*.c -o $@
clean:
rm $(OBJ) $(BIN) ext/glfw/deps/wayland/*.h