aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: e0e15b95cc76b426980ba97e3ce83bacaf8594d9 (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
include config.mk

PROTOCOLS = xdg-shell-client-protocol.c
SRC = ${PROTOCOLS} swt.c drw.c util.c wayland.c term.c
OBJ = ${SRC:.c=.o}

all: swt

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

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

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

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

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

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

install: swt
	mkdir -p ${DESTDIR}${PREFIX}/bin
	cp -f swt ${DESTDIR}${PREFIX}/bin
	chmod 755 ${DESTDIR}${PREFIX}/bin/swt
	tic -sx swt.info
	@echo Please see the README file regarding the terminfo entry of st.

uinstall:
	rm -f ${DESTDIR}${PREFIX}/bin/st

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