-
Notifications
You must be signed in to change notification settings - Fork 17
/
Makefile
82 lines (57 loc) · 1.95 KB
/
Makefile
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
include config.mk
SRC=src
WLDSRC=$(SRC)/wld
PKGS = fontconfig wayland-client wayland-cursor xkbcommon pixman-1 libdrm
WTERM_SOURCES += $(wildcard $(SRC)/*.c)
WTERM_HEADERS += $(wildcard $(SRC)/*.h)
ifeq ($(ENABLE_INTEL),1)
PKGS += libdrm_intel
CFLAGS += -DWITH_INTEL_DRM
endif
ifeq ($(ENABLE_NOUVEAU),1)
PKGS += libdrm_nouveau
CFLAGS += -DWITH_NOUVEAU_DRM
endif
CFLAGS += -std=gnu99 -Wall -g -DWITH_WAYLAND_DRM -DWITH_WAYLAND_SHM
CFLAGS += $(shell pkg-config --cflags $(PKGS)) -I include
LDFLAGS =src/wld/libwld.a $(shell pkg-config --libs $(PKGS)) -lm -lutil
WAYLAND_HEADERS = $(wildcard include/*.xml)
HDRS = $(WAYLAND_HEADERS:.xml=-client-protocol.h)
WAYLAND_SRC = $(HDRS:.h=.c)
SOURCES = $(WTERM_SOURCES) $(WAYLAND_SRC)
OBJECTS = $(SOURCES:.c=.o)
BIN_PREFIX = $(PREFIX)
SHARE_PREFIX = $(PREFIX)
all: wld wterm
include/config.h:
cp config.def.h include/config.h
include/%-client-protocol.c: include/%.xml
wayland-scanner code < $? > $@
include/%-client-protocol.h: include/%.xml
wayland-scanner client-header < $? > $@
$(OBJECTS): $(HDRS) include/config.h
wterm: $(OBJECTS)
$(CC) -o wterm $(OBJECTS) $(LDFLAGS)
wld:
$(MAKE) -C src/wld
clean:
rm -f $(OBJECTS) $(HDRS) $(WAYLAND_SRC) include/config.h wterm
$(MAKE) -C src/wld clean
install-icons:
mkdir -p $(SHARE_PREFIX)/share/icons/hicolor/scalable/apps/
cp contrib/logo/wterm.svg $(SHARE_PREFIX)/share/icons/hicolor/scalable/apps/wterm.svg
mkdir -p $(SHARE_PREFIX)/share/icons/hicolor/128x128/apps/
cp contrib/logo/wterm.png $(SHARE_PREFIX)/share/icons/hicolor/128x128/apps/wterm.png
install-bin: wterm
tic -s wterm.info
mkdir -p $(BIN_PREFIX)/bin/
cp wterm $(BIN_PREFIX)/bin/
install: install-bin install-icons
uninstall-icons:
rm -f $(SHARE_PREFIX)/share/icons/hicolor/128x128/apps/wterm.png
rm -f $(sHARE_PREFIX)/share/icons/hicolor/scalable/apps/wterm.svg
uninstall-bin:
rm -f $(BIN_PREFIX)/bin/wterm
uninstall: uninstall-bin uninstall-icons
format:
clang-format -i $(WTERM_SOURCES) $(WTERM_HEADERS)