This commit is contained in:
2026-01-13 19:24:29 +00:00
commit a7ad6f7ba0
14 changed files with 3272 additions and 0 deletions

35
Makefile Normal file
View File

@@ -0,0 +1,35 @@
# Makefile
CXX = g++
CXXFLAGS = -Wall -g -std=c++17
LIBS = $(shell pkg-config --cflags --libs wayland-client wayland-egl egl glesv2 xkbcommon)
# Wayland protocols
WAYLAND_PROTOCOLS_DIR = $(shell pkg-config --variable=pkgdatadir wayland-protocols)
WAYLAND_SCANNER = $(shell pkg-config --variable=wayland_scanner wayland-scanner)
XDG_SHELL_XML = $(WAYLAND_PROTOCOLS_DIR)/stable/xdg-shell/xdg-shell.xml
all: shader-demo
# Generate code from xml
xdg-shell-protocol.c:
$(WAYLAND_SCANNER) private-code < $(XDG_SHELL_XML) > $@
xdg-shell-client-protocol.h:
$(WAYLAND_SCANNER) client-header < $(XDG_SHELL_XML) > $@
# Compile rule
OBJS = main.o xdg-shell-protocol.o
%.o: %.c
$(CC) -c -o $@ $< $(CFLAGS)
main.o: main.cpp xdg-shell-client-protocol.h
$(CXX) -c -o $@ $< $(CXXFLAGS)
shader-demo: $(OBJS)
$(CXX) -o $@ $(OBJS) $(LIBS)
clean:
rm -f shader-demo *.o xdg-shell-protocol.c xdg-shell-client-protocol.h