summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile31
1 files changed, 22 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index 0d5a311..edeb705 100644
--- a/Makefile
+++ b/Makefile
@@ -1,12 +1,11 @@
-WLR_LAYER_SHELL=protocol/wlr-layer-shell-unstable.xml
-XDG_SHELL=/usr/share/wayland-protocols/stable/xdg-shell/xdg-shell.xml
-DWL_IPC=protocol/dwl-bar-ipc-unstable-v1.xml
-PROTOCOLS=wlr-layer-shell-protocol.c xdg-shell-protocol.c dwl-bar-ipc-protocol.c
-SRC=dmenu-wl.c drw.c util.c wayland.c
-OBJ=${SRC:.c=.o} ${PROTOCOLS:.c=.o}
-LDFLAGS=-lfreetype -lwayland-client -lrt -lxkbcommon -lm -lgrapheme
-CFLAGS=-I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/sysprof-4 -pthread
-CC=gcc
+
+include config.mk
+
+WLR_LAYER_SHELL = protocol/wlr-layer-shell-unstable.xml
+DWL_IPC = protocol/dwl-bar-ipc-unstable-v1.xml
+PROTOCOLS = wlr-layer-shell-protocol.c xdg-shell-protocol.c dwl-bar-ipc-protocol.c
+SRC = dmenu-wl.c drw.c util.c wayland.c
+OBJ = ${SRC:.c=.o} ${PROTOCOLS:.c=.o}
default_target: options dmenu-wl
@@ -39,5 +38,19 @@ ${OBJ}: ${PROTOCOLS} config.h
dmenu-wl: ${OBJ}
${CC} -o $@ ${OBJ} ${LDFLAGS}
+install: default_target
+ mkdir -p ${DESTDIR}${PREFIX}/bin
+ install dmenu-wl dmenu_path dmenu-wl_run ${DESTDIR}${PREFIX}/bin
+ chmod 755 ${DESTDIR}${PREFIX}/bin/dmenu
+ chmod 755 ${DESTDIR}${PREFIX}/bin/dmenu_path
+ chmod 755 ${DESTDIR}${PREFIX}/bin/dmenu_run
+
+uninstall:
+ rm -f ${DESTDIR}${PREFIX}/bin/dmenu-wl \
+ ${DESTDIR}${PREFIX}/bin/dmenu_path \
+ ${DESTDIR}${PREFIX}/bin/dmenu_run
+
clean:
rm ${OBJ} dmenu-wl ${PROTOCOLS} ${PROTOCOLS:.c=.h}
+
+.PHONY: all options clean install uninstall