diff options
author | Squibid <me@zacharyscheiman.com> | 2024-03-30 14:55:57 -0400 |
---|---|---|
committer | Squibid <me@zacharyscheiman.com> | 2024-03-30 14:55:57 -0400 |
commit | 30bea0c6c1b068cd00dc3429cffeeed3c6766b43 (patch) | |
tree | 3b3ad0c04367e7caf44d7d16123a028db3e6a72e /Makefile | |
download | waytils-30bea0c6c1b068cd00dc3429cffeeed3c6766b43.tar.gz waytils-30bea0c6c1b068cd00dc3429cffeeed3c6766b43.tar.bz2 waytils-30bea0c6c1b068cd00dc3429cffeeed3c6766b43.zip |
initial commit
Diffstat (limited to '')
-rw-r--r-- | Makefile | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..e85901a --- /dev/null +++ b/Makefile @@ -0,0 +1,62 @@ +PKG_CONFIG = pkg-config +VERSION = 0.1 + +# flags and incs +PKGS = wayland-client wayland-server +CFLAGS = -DVERSION=\"$(VERSION)\" -Wall +LIBS = `$(PKG_CONFIG) --libs $(PKGS)` + +PREFIX = /usr/local +MANDIR = $(PREFIX)/share/man + +# compiler and linker +CC = cc + +# wayland-scanner is a tool which generates C headers and rigging for Wayland +# protocols, which are specified in XML. wlroots requires you to rig these up +# to your build system yourself and provide them in the include path. +WAYLAND_PROTOCOLS = `$(PKG_CONFIG) --variable=pkgdatadir wayland-protocols` +WAYLAND_SCANNER = `$(PKG_CONFIG) --variable=wayland_scanner wayland-scanner` + +all: zwp-idle-inhibit-manager-v1-protocol.o xdg-shell-client-protocol.o ext-idle-notify-v1-protocol.o waytils +waytils: waytils.o + $(CC) -o $@ *.o $(CFLAGS) $(LIBS) +waytils.o: waytils.c +zwp-idle-inhibit-manager-v1-protocol.o: zwp-idle-inhibit-manager-v1-protocol.c zwp-idle-inhibit-manager-v1-protocol.h +xdg-shell-client-protocol.o: xdg-shell-client-protocol.c xdg-shell-client-protocol.h +ext-idle-notify-v1-protocol.o: ext-idle-notify-v1-protocol.c ext-idle-notify-v1-protocol.h + +zwp-idle-inhibit-manager-v1-protocol.h: + $(WAYLAND_SCANNER) client-header \ + $(WAYLAND_PROTOCOLS)/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml $@ +zwp-idle-inhibit-manager-v1-protocol.c: + $(WAYLAND_SCANNER) private-code \ + $(WAYLAND_PROTOCOLS)/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml $@ + +xdg-shell-client-protocol.h: + $(WAYLAND_SCANNER) client-header \ + $(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml $@ +xdg-shell-client-protocol.c: + $(WAYLAND_SCANNER) private-code \ + $(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml $@ + +ext-idle-notify-v1-protocol.h: + $(WAYLAND_SCANNER) client-header \ + $(WAYLAND_PROTOCOLS)/staging/ext-idle-notify/ext-idle-notify-v1.xml $@ +ext-idle-notify-v1-protocol.c: + $(WAYLAND_SCANNER) private-code \ + $(WAYLAND_PROTOCOLS)/staging/ext-idle-notify/ext-idle-notify-v1.xml $@ + +clean: + rm -f waytils *.o *-protocol.* + +install: waytils + mkdir -p $(PREFIX)/bin + cp -f waytils $(PREFIX)/bin + chmod 755 $(PREFIX)/bin/waytils + mkdir -p $(MANDIR)/man1 + cp -f waytils.1 $(MANDIR)/man1 + chmod 644 $(MANDIR)/man1/waytils.1 + +uninstall: waytils + rm -f $(PREFIX)/bin/waytils $(MANDIR)/man1/waytils.1 |