diff options
author | Squibid <me@zacharyscheiman.com> | 2024-02-20 20:49:57 -0500 |
---|---|---|
committer | Squibid <me@zacharyscheiman.com> | 2024-02-20 21:39:29 -0500 |
commit | f6475ab4cee0b824a6cc48bfc8f59bb5238df1d8 (patch) | |
tree | 2ad2f7626b0ec658aadc4487cab82863e4e94a70 /Makefile | |
download | wiz-f6475ab4cee0b824a6cc48bfc8f59bb5238df1d8.tar.gz wiz-f6475ab4cee0b824a6cc48bfc8f59bb5238df1d8.tar.bz2 wiz-f6475ab4cee0b824a6cc48bfc8f59bb5238df1d8.zip |
initial commit
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..16dfb04 --- /dev/null +++ b/Makefile @@ -0,0 +1,49 @@ +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: ext-idle-notify-v1-protocol.o config.h wiz +wiz: wiz.o + $(CC) -o $@ *.o $(CFLAGS) $(LIBS) +wiz.o: wiz.c config.h +ext-idle-notify-v1-protocol.o: ext-idle-notify-v1-protocol.c ext-idle-notify-v1-protocol.h + +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 $@ + +config.h: + cp config.def.h $@ + +clean: + rm -f wiz *.o *-protocol.* + +install: wiz + mkdir -p $(PREFIX)/bin + cp -f wiz $(PREFIX)/bin + chmod 755 $(PREFIX)/bin/wiz + mkdir -p $(MANDIR)/man1 + cp -f wiz.1 $(MANDIR)/man1 + chmod 644 $(MANDIR)/man1/wiz.1 + +uninstall: wiz + rm -f $(PREFIX)/bin/wiz $(MANDIR)/man1/wiz.1 |