Separate Wayland and x11
This commit is contained in:
15
Makefile
15
Makefile
@@ -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 $@ $<
|
||||
|
||||
@@ -19,7 +19,8 @@ Para poder compilar el proyecto hace falta lo siguiente.
|
||||
- `cglm`: Highly Optimized 2D / 3D Graphics Math (glm) for C.
|
||||
### Linux
|
||||
Para compilar `glfw` en linux hacen falta las siguientes librerías. (no incluidas)
|
||||
- libXcursor-devel libXi-devel libXinerama-devel libXrandr-devel libwayland-dev libxkbcommon-dev wayland-protocols
|
||||
- `x11`: libXcursor-devel libXi-devel libXinerama-devel libXrandr-devel
|
||||
- `wayland`: libwayland-dev libxkbcommon-dev wayland-protocols
|
||||
|
||||
# Descargas
|
||||
- [git](https://git-scm.com/downloads/win)
|
||||
@@ -42,7 +43,8 @@ Los siguientes comandos sirven para compilar `manigraph` deacuerdo al sistema op
|
||||
|
||||
```
|
||||
make windows
|
||||
make linux
|
||||
make linux-x11
|
||||
make linux-wayland
|
||||
make cocoa
|
||||
```
|
||||
|
||||
@@ -60,7 +62,8 @@ cc -fPIC -shared -D_GLFW_WIN32 -D_GLFW_BUILD_DLL ./ext/glfw/src/*.c -o glfw.dll
|
||||
|
||||
#### Linux
|
||||
```
|
||||
cc -fPIC -shared -D_GLFW_X11 -D_GLFW_WAYLAND -D_GLFW_BUILD_DLL ./ext/glfw/src/*.c -o libglfw.so
|
||||
cc -fPIC -shared -D_GLFW_X11 -D_GLFW_BUILD_DLL ./ext/glfw/src/*.c -o libglfw.so
|
||||
cc -fPIC -shared -D_GLFW_WAYLAND -D_GLFW_BUILD_DLL ./ext/glfw/src/*.c -o libglfw.so
|
||||
```
|
||||
|
||||
#### Mac
|
||||
|
||||
Reference in New Issue
Block a user