Makefile (2232B)
1 # mew - dynamic menu for wayland 2 # See LICENSE file for copyright and license details. 3 .POSIX: 4 5 VERSION = 1.0 6 7 PKG_CONFIG = pkg-config 8 9 PREFIX = /usr/local 10 MANPREFIX = $(PREFIX)/share/man 11 12 PKGS = fcft pixman-1 wayland-client xkbcommon 13 INCS != $(PKG_CONFIG) --cflags $(PKGS) 14 LIBS != $(PKG_CONFIG) --libs $(PKGS) 15 16 MWCPPFLAGS = -D_POSIX_C_SOURCE=200809L -D_GNU_SOURCE -DVERSION=\"$(VERSION)\" 17 MWCFLAGS = -pedantic -Wall $(INCS) $(MWCPPFLAGS) $(CFLAGS) 18 LDLIBS = $(LIBS) 19 20 PROTO = wlr-layer-shell-unstable-v1-protocol.h xdg-activation-v1-protocol.h xdg-shell-protocol.h 21 SRC = mew.c $(PROTO:.h=.c) 22 OBJ = $(SRC:.c=.o) 23 24 all: mew 25 26 .c.o: 27 $(CC) -o $@ $(MWCFLAGS) -c $< 28 29 config.h: 30 cp config.def.h $@ 31 32 $(OBJ): config.h $(PROTO) 33 34 mew: $(OBJ) 35 $(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS) 36 37 WAYLAND_PROTOCOLS != $(PKG_CONFIG) --variable=pkgdatadir wayland-protocols 38 WAYLAND_SCANNER != $(PKG_CONFIG) --variable=wayland_scanner wayland-scanner 39 40 xdg-activation-v1-protocol.h: 41 $(WAYLAND_SCANNER) client-header $(WAYLAND_PROTOCOLS)/staging/xdg-activation/xdg-activation-v1.xml $@ 42 xdg-activation-v1-protocol.c: 43 $(WAYLAND_SCANNER) private-code $(WAYLAND_PROTOCOLS)/staging/xdg-activation/xdg-activation-v1.xml $@ 44 xdg-shell-protocol.h: 45 $(WAYLAND_SCANNER) client-header $(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml $@ 46 xdg-shell-protocol.c: 47 $(WAYLAND_SCANNER) private-code $(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml $@ 48 wlr-layer-shell-unstable-v1-protocol.h: 49 $(WAYLAND_SCANNER) client-header wlr-layer-shell-unstable-v1.xml $@ 50 wlr-layer-shell-unstable-v1-protocol.c: 51 $(WAYLAND_SCANNER) private-code wlr-layer-shell-unstable-v1.xml $@ 52 wlr-layer-shell-unstable-v1-protocol.o: xdg-shell-protocol.o 53 54 clean: 55 rm -f mew $(OBJ) $(PROTO:.h=.c) $(PROTO) 56 57 install: all 58 mkdir -p $(DESTDIR)$(PREFIX)/bin 59 cp -f mew mew-run $(DESTDIR)$(PREFIX)/bin 60 chmod 755 $(DESTDIR)$(PREFIX)/bin/mew 61 chmod 755 $(DESTDIR)$(PREFIX)/bin/mew-run 62 mkdir -p $(DESTDIR)$(MANPREFIX)/man1 63 sed "s/VERSION/$(VERSION)/g" < mew.1 > $(DESTDIR)$(MANPREFIX)/man1/mew.1 64 chmod 644 $(DESTDIR)$(MANPREFIX)/man1/mew.1 65 66 uninstall: 67 rm -f $(DESTDIR)$(PREFIX)/bin/mew \ 68 $(DESTDIR)$(PREFIX)/bin/mew-run \ 69 $(DESTDIR)$(MANPREFIX)/man1/mew.1 70 71 .PHONY: all clean install uninstall