master build.ninja
ohmu  ·  2026-11-23
 1# i know this is a ninja file, but you're allowed to edit it.
 2# you can also pass things on the command line if you like, eg
 3# 
 4# 	CC=clang ninja
 5
 6cc = $${CC:-cc}
 7cflags = $${CFLAGS:--D_POSIX_C_SOURCE=200809L -Isource/include -O2 -std=c99}
 8ldflags = $${LDFLAGS:-}
 9# add xcb stuff if you want Xwayland:
10# libs = `pkg-config --static --libs swc wayland-server xkbcommon libinput pixman-1 libdrm wld libudev xcb xcb-composite xcb-ewmh xcb-icccm`
11# remove libudev if you don't use udev.
12# libs = `pkg-config --static --libs swc wayland-server xkbcommon libinput pixman-1 libdrm wld`
13libs = $${LIBS:-`pkg-config --static --libs swc wayland-server xkbcommon libinput pixman-1 libdrm wld libudev`}
14prefix = $${PREFIX:-/usr/local}
15destdir = $${DESTDIR:-}
16bindir = $destdir$prefix/bin
17
18rule cc
19  command = $cc $cflags -MMD -MF $out.d -c -o $out $in
20  deps = gcc
21  depfile = $out.d
22  description = cc $out
23
24rule link
25  command = $cc $ldflags -o $out $in $libs
26  description = link $out
27
28rule install
29  command = rm -f $bindir/nosferatu && mkdir -p $bindir && cp nosferatu $bindir/
30  description = install nosferatu
31
32build source/nosferatu.o: cc source/nosferatu.c
33build source/hevelcursor.o: cc source/hevelcursor.c
34build source/util.o: cc source/util.c
35
36build nosferatu: link source/nosferatu.o source/util.o source/hevelcursor.c
37build all: phony nosferatu
38build install: install nosferatu
39
40default all