summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorSam Nystrom <sam@samnystrom.dev>2024-01-21 21:42:20 -0500
committerSam Nystrom <sam@samnystrom.dev>2024-01-21 21:42:20 -0500
commit7c506cb0696886c19fe56ec79077b6159272a3d9 (patch)
treec98f165d01b795513daa17d35623ae597fbb7fdc /Makefile
init
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile40
1 files changed, 40 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..a73963b
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,40 @@
+.POSIX:
+.SUFFIXES:
+
+CFLAGS = -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter
+LDFLAGS =
+LIBS = -lskarnet -lwayland-client -lpng
+
+PREFIX = /usr/local
+BINDIR = $(PREFIX)/bin
+SHAREDIR = $(PREFIX)/share
+MANDIR = $(SHAREDIR)/man
+
+all: keyview
+
+keyview: keyview.o xdg-shell-protocol.o
+ $(CC) $(LDFLAGS) keyview.o xdg-shell-protocol.o -o $@ $(LIBS)
+
+keyview.o: keyview.c xdg-shell-client-protocol.h
+ $(CC) $(CFLAGS) -c $< -o $@
+
+xdg-shell-protocol.o: xdg-shell-protocol.c
+ $(CC) $(CFLAGS) -c $< -o $@
+
+xdg-shell-protocol.c:
+ wayland-scanner private-code < /usr/share/wayland-protocols/stable/xdg-shell/xdg-shell.xml > $@
+
+xdg-shell-client-protocol.h:
+ wayland-scanner client-header < /usr/share/wayland-protocols/stable/xdg-shell/xdg-shell.xml > $@
+
+clean:
+ rm -f keyview xdg-shell-protocol.c xdg-shell-client-protocol.h *.o
+
+install:
+ install -Dm755 keyview $(BINDIR)/keyview
+ install -Dm644 keyview.1 $(MANDIR)/man1/keyview.1
+
+uninstall:
+ rm -f $(BINDIR)/keyview $(MANDIR)/man1/keyview.1
+
+.PHONY: all clean install uninstall