Makefile (1613B)
1 # torrent 2 VERSION = 0.1 3 PREFIX = /usr/local 4 5 PKGS = wlroots-0.19 wayland-server xkbcommon pixman-1 cairo dbus-1 libinput libdrm 6 PROTO = `pkg-config --variable=pkgdatadir wayland-protocols` 7 SCANNER = `pkg-config --variable=wayland_scanner wayland-scanner` 8 CFLAGS += -std=c11 -Wall -Os -D_DEFAULT_SOURCE -D_POSIX_C_SOURCE=200809L -DWLR_USE_UNSTABLE -DVERSION=\"$(VERSION)\" \ 9 -I. `pkg-config --cflags $(PKGS)` 10 LDLIBS += `pkg-config --libs $(PKGS)` -lpam 11 HDRS = xdg-shell-protocol.h cursor-shape-v1-protocol.h wlr-layer-shell-unstable-v1-protocol.h 12 13 torrent: torrent.c $(HDRS) 14 $(CC) $(CFLAGS) -o $@ torrent.c $(LDFLAGS) $(LDLIBS) 15 16 xdg-shell-protocol.h: 17 $(SCANNER) server-header $(PROTO)/stable/xdg-shell/xdg-shell.xml $@ 18 cursor-shape-v1-protocol.h: 19 $(SCANNER) server-header $(PROTO)/staging/cursor-shape/cursor-shape-v1.xml $@ 20 wlr-layer-shell-unstable-v1-protocol.h: 21 $(SCANNER) server-header protocols/wlr-layer-shell-unstable-v1.xml $@ 22 23 install: torrent 24 mkdir -p $(DESTDIR)$(PREFIX)/bin 25 install -m 755 torrent torrent-session $(DESTDIR)$(PREFIX)/bin/ 26 mkdir -p $(DESTDIR)/usr/share/fonts/torrent 27 install -m 644 vga.ttf $(DESTDIR)/usr/share/fonts/torrent/ 28 -fc-cache -f $(DESTDIR)/usr/share/fonts/torrent 29 mkdir -p $(DESTDIR)/usr/share/wayland-sessions 30 sed 's|@PREFIX@|$(PREFIX)|' torrent.desktop > $(DESTDIR)/usr/share/wayland-sessions/torrent.desktop 31 32 uninstall: 33 rm -rf $(DESTDIR)$(PREFIX)/bin/torrent $(DESTDIR)$(PREFIX)/bin/torrent-session $(DESTDIR)/usr/share/fonts/torrent \ 34 $(DESTDIR)/usr/share/wayland-sessions/torrent.desktop 35 36 clean: 37 rm -f torrent $(HDRS) 38 39 .PHONY: install uninstall clean