commit 999c916

shrub  ·  2026-06-21 13:19:05 +0000 UTC
parent 1e30001
use ninja for build
3 files changed,  +47, -22
+0, -22
 1@@ -1,22 +0,0 @@
 2-CC      ?= cc
 3-# CFLAGS   = -std=c99 -Wall -Wextra -O0 -g -fdiagnostics-color=auto # debug
 4-CFLAGS   = -std=c99 -Wall -Wextra -O2 
 5-CPPFLAGS = -D_POSIX_C_SOURCE=200809L -Isource/include
 6-
 7-OUT = tohu
 8-SRC = source/tohu.c source/util.c
 9-
10-PKGS = swc wayland-server xkbcommon libinput pixman-1 libdrm wld libudev xcb xcb-composite xcb-ewmh xcb-icccm
11-CFLAGS = `pkg-config --cflags $(PKGS)`  
12-LDLIBS = `pkg-config --libs $(PKGS)`  
13-all: ${OUT}
14-
15-${OUT}: ${SRC}
16-	${CC} ${CFLAGS} ${CPPFLAGS} -o ${OUT} ${SRC} ${LDLIBS}
17-
18-clean:
19-	rm -f ${OUT}
20-
21-compile_flags:
22-	rm -f compile_flags.txt
23-	for f in ${CFLAGS} ${CPPFLAGS}; do echo $$f >> compile_flags.txt; done
+8, -0
 1@@ -7,6 +7,14 @@ tohu is the wm i generally test new features for neuswc in, as such it is a good
 2 people to look at or fork to make their own compositor. it's a simple floating window manager,
 3 with server side decoration support.
 4 
 5+build
 6+-----
 7+tohu builds using the ninja build system:
 8+```
 9+ninja
10+sudo ninja install
11+```
12+
13 binds
14 -----
15 mod+enter to create terminal
+39, -0
 1@@ -0,0 +1,39 @@
 2+# i know this is a ninja file, but you're allowed to edit it.
 3+# you can also pass things on the command line if you like, eg
 4+# 
 5+# 	CC=clang ninja
 6+
 7+cc = $${CC:-cc}
 8+cflags = $${CFLAGS:--D_POSIX_C_SOURCE=200809L -Isource/include -O2 -std=c99}
 9+ldflags = $${LDFLAGS:-}
10+# add xcb stuff if you want Xwayland:
11+# libs = `pkg-config --static --libs swc wayland-server xkbcommon libinput pixman-1 libdrm wld libudev xcb xcb-composite xcb-ewmh xcb-icccm`
12+# remove libudev if you don't use udev.
13+# libs = `pkg-config --static --libs swc wayland-server xkbcommon libinput pixman-1 libdrm wld`
14+libs = $${LIBS:-`pkg-config --static --libs swc wayland-server xkbcommon libinput pixman-1 libdrm wld libudev`}
15+prefix = $${PREFIX:-/usr/local}
16+destdir = $${DESTDIR:-}
17+bindir = $destdir$prefix/bin
18+
19+rule cc
20+  command = $cc $cflags -MMD -MF $out.d -c -o $out $in
21+  deps = gcc
22+  depfile = $out.d
23+  description = cc $out
24+
25+rule link
26+  command = $cc $ldflags -o $out $in $libs
27+  description = link $out
28+
29+rule install
30+  command = mkdir -p $bindir && cp tohu $bindir/
31+  description = install tohu
32+
33+build source/tohu.o: cc source/tohu.c
34+build source/util.o: cc source/util.c
35+
36+build tohu: link source/tohu.o source/util.o
37+build all: phony tohu
38+build install: install tohu
39+
40+default all