commit c316e7e

pita  ·  2026-07-16 20:26:01 +0000 UTC
parent 09937c3
remove bullshit from source
1 files changed,  +25, -5
+25, -5
 1@@ -2,6 +2,13 @@ RELEASE_flags=-DNDEBUG -O2 -g0 -s
 2 DEBUG_flags=-std=c99 -D_POSIX_C_SOURCE=199309L -DDEBUG -Wall -Wno-unknown-pragmas -Wpedantic -Wshadow -Wextra -Werror=implicit-int -Werror=incompatible-pointer-types -Werror=int-conversion -Wvla -g -Og -fsanitize=address -fsanitize=undefined
 3 PREFIX=${HOME}/.local
 4 
 5+WAYLAND_SCANNER=wayland-scanner
 6+XDG_XML=$(shell pkg-config --variable=pkgdatadir wayland-protocols)/stable/xdg-shell/xdg-shell.xml
 7+WLR_XML=src/wlr-layer-shell-unstable-v1.xml
 8+
 9+PROTO_C=src/xdg-shell-protocol.c src/wlr-layer-shell-client-protocol.c
10+PROTO_H=src/xdg-shell-client-protocol.h src/wlr-layer-shell-client-protocol.h
11+
12 run: bin/uxn12 bin/m_pc.rom bin/perifs.rom
13 	bin/uxn12 bin/m_pc.rom bin/perifs.rom run
14 gui: bin/uxn12 bin/screen.rom
15@@ -15,7 +22,7 @@ test: bin/uxn12-debug tests
16 	@ bin/uxn12-debug bin/file.rom
17 	@ bin/uxn12-debug bin/datetime.rom
18 clean:
19-	rm -fr bin
20+	rm -fr bin $(PROTO_C) $(PROTO_H)
21 format:
22 	clang-format -i src/uxn12.c
23 install: bin/uxn12
24@@ -41,12 +48,12 @@ archive:
25 
26 .PHONY: run test clean format install uninstall grab archive
27 
28-bin/uxn12: src/uxn12.c
29+bin/uxn12: src/uxn12.c $(PROTO_C) $(PROTO_H)
30 	mkdir -p bin
31-	cc ${RELEASE_flags} ${CFLAGS} -s src/uxn12.c src/wlr-layer-shell-client-protocol.c src/xdg-shell-protocol.c -lwayland-client -lxkbcommon -o bin/uxn12
32-bin/uxn12-debug: src/uxn12.c
33+	cc ${RELEASE_flags} ${CFLAGS} -s src/uxn12.c $(PROTO_C) -lwayland-client -lxkbcommon -o bin/uxn12
34+bin/uxn12-debug: src/uxn12.c $(PROTO_C) $(PROTO_H)
35 	mkdir -p bin
36-	cc ${DEBUG_flags} ${CFLAGS} -s src/uxn12.c src/wlr-layer-shell-client-protocol.c src/xdg-shell-protocol.c -lwayland-client -lxkbcommon -o bin/uxn12
37+	cc ${DEBUG_flags} ${CFLAGS} -s src/uxn12.c $(PROTO_C) -lwayland-client -lxkbcommon -o bin/uxn12-debug
38 
39 # Tools
40 
41@@ -73,3 +80,16 @@ bin/file.rom: bin/uxn12 bin/drifblim.rom etc/tests/file.tal
42 	@ bin/uxn12 bin/drifblim.rom etc/tests/file.tal bin/file.rom
43 bin/datetime.rom: bin/uxn12 bin/drifblim.rom etc/tests/datetime.tal
44 	@ bin/uxn12 bin/drifblim.rom etc/tests/datetime.tal bin/datetime.rom
45+
46+
47+src/xdg-shell-client-protocol.h:
48+	@$(WAYLAND_SCANNER) client-header $(XDG_XML) $@
49+
50+src/xdg-shell-protocol.c:
51+	@$(WAYLAND_SCANNER) private-code $(XDG_XML) $@
52+
53+src/wlr-layer-shell-client-protocol.h: $(WLR_XML)
54+	@$(WAYLAND_SCANNER) client-header $(WLR_XML) $@
55+
56+src/wlr-layer-shell-client-protocol.c: $(WLR_XML)
57+	@$(WAYLAND_SCANNER) private-code $(WLR_XML) $@