summaryrefslogtreecommitdiff
path: root/Makefile
blob: 0d5a31188db4e07165fd0dc3c864dce9c389bdc0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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

default_target: options dmenu-wl

options:
	@echo ${OBJ}

wlr-layer-shell-protocol.h:
	wayland-scanner client-header < ${WLR_LAYER_SHELL} > $@

wlr-layer-shell-protocol.c: wlr-layer-shell-protocol.h
	wayland-scanner private-code < ${WLR_LAYER_SHELL} > $@

xdg-shell-protocol.h:
	wayland-scanner client-header < ${XDG_SHELL} > $@

xdg-shell-protocol.c: xdg-shell-protocol.h
	wayland-scanner private-code < ${XDG_SHELL} > $@

dwl-bar-ipc-protocol.h:
	wayland-scanner client-header < ${DWL_IPC} > $@

dwl-bar-ipc-protocol.c: dwl-bar-ipc-protocol.h
	wayland-scanner private-code < ${DWL_IPC} > $@

.c.o:
	${CC} -c $< ${CFLAGS}

${OBJ}: ${PROTOCOLS} config.h

dmenu-wl: ${OBJ}
	${CC} -o $@ ${OBJ} ${LDFLAGS}

clean:
	rm ${OBJ} dmenu-wl ${PROTOCOLS} ${PROTOCOLS:.c=.h}