aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: ec65cfed5cf8979ac09ae9fcf9be33bd22caab0e (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
VERSION = 0.0.0
PROTOCOLS = xdg-shell-client-protocol.c
SRC = ${PROTOCOLS} swt.c drw.c util.c wayland.c term.c
OBJ = ${SRC:.c=.o}
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 -DVERSION=\"${VERSION}\"  -D_XOPEN_SOURCE=600
LIBS = -lfreetype -lwayland-client -lrt -lxkbcommon -lm -lgrapheme

all: swt

config.h:
	cp config.def.h config.h

xdg-shell-client-protocol.h:
	wayland-scanner client-header < /usr/share/wayland-protocols/stable/xdg-shell/xdg-shell.xml > xdg-shell-client-protocol.h

xdg-shell-client-protocol.c: xdg-shell-client-protocol.h
	wayland-scanner private-code < /usr/share/wayland-protocols/stable/xdg-shell/xdg-shell.xml > xdg-shell-client-protocol.c

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

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

swt: ${OBJ} ${SRC}
	gcc ${OBJ} -o swt ${LIBS}

install: swt
	install -D ./swt /usr/local/bin/swt

run: swt
	./swt

clean:
	rm *.o swt ${PROTOCOLS} ${PROTOCOLS:.c=.h}