Merge: roberto -> main

This commit is contained in:
PedroEdiaz
2024-10-17 22:30:55 -06:00
parent 252aab3dd2
commit 7c1f691b46
9 changed files with 133 additions and 59 deletions

View File

@@ -8,13 +8,23 @@ OBJ = \
src/shader.o \
src/input.o \
src/mesh.o \
src/alan.o \
src/main.o
CFLAGS = \
-I./ext/cglm/include \
-I./ext/glfw/include \
-Wall -Wno-unused-function -std=c99 \
-Wall -Wno-unused-function -std=c99 \
WAYLAND-LIB = \
xdg-shell \
relative-pointer-unstable-v1 \
xdg-decoration-unstable-v1 \
pointer-constraints-unstable-v1 \
viewporter \
idle-inhibit-unstable-v1 \
fractional-scale-v1 \
xdg-activation-v1 \
wayland
help:
@echo "Para compilar el proyecto a tu sistema operativo"
@@ -28,6 +38,8 @@ help:
@echo "Para ejecturar el programa sin instalarlos se puede usar:"
@echo " $(MAKE) run-linux"
src/main.o: src/data/axis.h src/data/cube.h src/data/shaders.h
# WINDOWS
windows: $(OBJ) glfw.dll
$(CC) $(CFLAGS) $(OBJ) -o $(BIN) -L. -lglfw -lopengl32 -lglew32
@@ -38,11 +50,11 @@ glfw.dll:
# LINUX
linux-x11: $(OBJ)
$(MAKE) BKN=_GLFW_X11 libglfw.so
$(CC) -o $(BIN) $(OBJ) -L. -lGLEW -lGL -lglfw
$(CC) -o $(BIN) $(OBJ) -L. -lGLEW -lGL -lglfw -lm
linux-wayland: $(OBJ)
$(MAKE) BKN=_GLFW_WAYLAND libglfw.so
$(CC) -o $(BIN) $(OBJ) -L. -lGLEW -lGL -lglfw
$(CC) -o $(BIN) $(OBJ) -L. -lGLEW -lGL -lglfw -lm
run-linux:
LD_LIBRARY_PATH=. ./$(BIN)
@@ -50,15 +62,20 @@ run-linux:
# COCOA
cocoa: $(OBJ)
$(MAKE) BKN=_GLFW_COCOA libglfw.so
$(CC) -framework OpenGL -o $(BIN) $(OBJ) -L. -lGLEW -lGL -lglfw
$(CC) -framework OpenGL -o $(BIN) $(OBJ) -L. -lGLEW -lGL -lglfw
libglfw.so:
$(CC) -fPIC -shared -D$(BKN) -D_GLFW_BUILD_DLL ./ext/glfw/src/*.c -o $@
libglfw.so:
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
$(CC) -fPIC -shared -D$(BKN) -D_GLFW_BUILD_DLL -Iext/glfw/deps/wayland ./ext/glfw/src/*.c -o $@
clean:
rm $(OBJ) $(BIN)
rm $(OBJ) $(BIN) ext/glfw/deps/wayland/*.h
.SUFFIXES: .c .o
.SUFFIXES: .c .o
.c.o:
$(CC) $(CFLAGS) -c -o $@ $<