2012-06-20 00:54:38 +02:00
|
|
|
VERSION = $(shell git describe --tags)
|
2012-05-22 06:34:35 +02:00
|
|
|
PREFIX = /usr/local
|
2012-06-01 10:15:49 +02:00
|
|
|
GTK = gtk+-3.0
|
|
|
|
VTE = vte-2.90
|
2012-06-25 06:39:32 +02:00
|
|
|
TERMINFO = ${PREFIX}/share/terminfo
|
2012-05-22 20:19:47 +02:00
|
|
|
|
2012-06-08 18:13:40 +02:00
|
|
|
CFLAGS := -std=c99 -O3 \
|
2012-05-22 15:10:19 +02:00
|
|
|
-Wall -Wextra -pedantic \
|
|
|
|
-Winit-self \
|
|
|
|
-Wshadow \
|
|
|
|
-Wformat=2 \
|
|
|
|
-Wmissing-declarations \
|
2012-06-01 14:29:18 +02:00
|
|
|
-Wstrict-overflow=5 \
|
|
|
|
-Wcast-align \
|
|
|
|
-Wcast-qual \
|
2012-06-01 11:42:05 +02:00
|
|
|
-Wconversion \
|
2012-06-02 12:13:59 +02:00
|
|
|
-Wc++-compat \
|
|
|
|
-Wbad-function-cast \
|
2012-06-07 22:43:35 +02:00
|
|
|
-Wunused-macros \
|
2012-06-08 22:01:36 +02:00
|
|
|
-Wwrite-strings \
|
2012-06-20 00:54:38 +02:00
|
|
|
-DTERMITE_VERSION=\"${VERSION}\" \
|
2012-06-08 18:46:58 +02:00
|
|
|
${shell pkg-config --cflags ${GTK} ${VTE}} \
|
2012-06-08 18:13:40 +02:00
|
|
|
${CFLAGS}
|
2012-05-22 06:34:35 +02:00
|
|
|
|
2012-06-08 03:50:44 +02:00
|
|
|
ifeq (${CC}, clang)
|
|
|
|
CFLAGS += -Wno-missing-field-initializers
|
|
|
|
endif
|
|
|
|
|
2012-06-08 18:46:58 +02:00
|
|
|
LDFLAGS := -s -Wl,--as-needed ${shell pkg-config --libs ${GTK} ${VTE}} ${LDFLAGS}
|
2012-05-22 06:34:35 +02:00
|
|
|
|
2012-06-08 22:16:41 +02:00
|
|
|
termite: termite.c
|
2012-05-22 06:34:35 +02:00
|
|
|
${CC} ${CFLAGS} -o $@ $< ${LDFLAGS}
|
|
|
|
|
2012-05-22 15:50:21 +02:00
|
|
|
install: termite
|
2012-06-25 21:43:32 +02:00
|
|
|
mkdir -p ${DESTDIR}${PREFIX}/bin ${DESTDIR}${TERMINFO}
|
2012-06-27 07:36:39 +02:00
|
|
|
install -Dm755 termite ${DESTDIR}${PREFIX}/bin/termite
|
2012-06-25 06:39:32 +02:00
|
|
|
tic termite.terminfo -o ${DESTDIR}${TERMINFO}
|
2012-06-27 06:38:08 +02:00
|
|
|
install -Dm644 termite.vim ${DESTDIR}${PREFIX}/share/vim/vimfiles/plugin/termite.vim
|
2012-05-22 06:34:35 +02:00
|
|
|
|
|
|
|
uninstall:
|
2012-05-22 15:50:21 +02:00
|
|
|
rm -f ${DESTDIR}${PREFIX}/bin/termite
|
2012-05-22 06:34:35 +02:00
|
|
|
|
2012-06-08 18:13:40 +02:00
|
|
|
clean:
|
|
|
|
rm termite
|
|
|
|
|
|
|
|
.PHONY: clean install uninstall
|