Separate Wayland and x11

This commit is contained in:
PedroEdiaz
2024-10-29 20:02:36 -06:00
parent 8c565ffd25
commit 303f16d155
2 changed files with 16 additions and 8 deletions

View File

@@ -31,7 +31,8 @@ help:
@echo "Para compilar el proyecto a tu sistema operativo"
@echo "porfavor usa uno de los siguientes comandos:"
@echo " $(MAKE) windows"
@echo " $(MAKE) linux"
@echo " $(MAKE) linux-x11"
@echo " $(MAKE) linux-wayland"
@echo " $(MAKE) cocoa"
@echo "Para limpiar los archivos compilados se puede usar"
@echo " $(MAKE) clean"
@@ -48,13 +49,17 @@ glfw.dll:
$(CC) -fPIC -shared -D_GLFW_WIN32 -D_GLFW_BUILD_DLL ./ext/glfw/src/*.c -o $@ -lgdi32
# LINUX
linux: $(OBJ)
linux-wayland: $(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) DFLAGS="-D_GLFW_WAYLAND -D_GLFW_X11" libglfw.so
$(MAKE) DFLAGS="-D_GLFW_WAYLAND" libglfw.so
$(CC) -o $(BIN) $(OBJ) -L. -lGLEW -lGL -lglfw -lm
linux-x11: $(OBJ)
$(MAKE) DFLAGS="-D_GLFW_X11" libglfw.so
$(CC) -o $(BIN) $(OBJ) -L. -lGLEW -lGL -lglfw -lm
run-linux:
@@ -66,12 +71,12 @@ cocoa: $(OBJ)
$(CC) -framework OpenGL -o $(BIN) $(OBJ) -L. -lGLEW -lGL -lglfw
libglfw.so:
$(CC) -fPIC -shared $(DFLAGS)-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
.SUFFIXES: .c .o
.c.o:
.c.o: src/main.h
$(CC) $(CFLAGS) -c -o $@ $<