forked from thestinger/termite
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
56 lines (47 loc) · 1.46 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
VERSION = $(shell git describe --tags)
GTK = gtk+-3.0
VTE = vte-2.91
PREFIX ?= /usr/local
BINDIR ?= ${PREFIX}/bin
DATADIR ?= ${PREFIX}/share
MANDIR ?= ${DATADIR}/man
TERMINFO ?= ${DATADIR}/terminfo
CXXFLAGS := -std=c++17 -O3 \
-Wall -Wextra -pedantic \
-Winit-self \
-Wshadow \
-Wformat=2 \
-Wmissing-declarations \
-Wstrict-overflow=5 \
-Wcast-align \
-Wconversion \
-Wunused-macros \
-Wwrite-strings \
-DNDEBUG \
-D_POSIX_C_SOURCE=200809L \
-DTERMITE_VERSION=\"${VERSION}\" \
${shell pkg-config --cflags ${GTK} ${VTE}} \
${CXXFLAGS}
ifeq (${CXX}, g++)
CXXFLAGS += -Wno-missing-field-initializers
endif
ifeq (${CXX}, clang++)
CXXFLAGS += -Wimplicit-fallthrough
endif
LDFLAGS := -s -Wl,--as-needed ${LDFLAGS}
LDLIBS := ${shell pkg-config --libs ${GTK} ${VTE}}
termite: termite.cc url_regex.hh
${CXX} ${CXXFLAGS} ${LDFLAGS} $< ${LDLIBS} -o $@
install: termite termite.desktop termite.terminfo
mkdir -p ${DESTDIR}${TERMINFO}
install -Dm755 termite ${DESTDIR}${BINDIR}/termite
install -Dm644 config ${DESTDIR}/etc/xdg/termite/config
install -Dm644 termite.desktop ${DESTDIR}${DATADIR}/applications/termite.desktop
install -Dm644 man/termite.1 ${DESTDIR}${MANDIR}/man1/termite.1
install -Dm644 man/termite.config.5 ${DESTDIR}${MANDIR}/man5/termite.config.5
tic -x -o ${DESTDIR}${TERMINFO} termite.terminfo
uninstall:
rm -f ${DESTDIR}${BINDIR}/termite
clean:
rm termite
.PHONY: clean install uninstall