/
Makefile
85 lines (83 loc) · 2.56 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
83
84
85
# Copyright 2017-2020, Jeffrey E. Bedard
include config.mk
exe=jbxvt
PREFIX=/usr
AWK=/usr/bin/gawk
# Defining scheme as the shell built-in echo allows jbxvt to build on systems
# that do not have mit-scheme. mit-scheme regeneration rules are only
# necessary if one of the textual databases has been changed in development.
SCHEME=echo
#SCHEME=/usr/bin/mit-scheme <
#SCHEME=guile -s
CFLAGS+=-DUSE_LIKELY
CFLAGS+=-D_XOPEN_SOURCE=700 --std=c11
CFLAGS+=-Wall -Wextra
ldflags+=-lxcb -lxcb-keysyms -lxcb-cursor
objs=jbxvt.o lookup_key.o paint.o change_selection.o cmdtok.o esc.o
objs+=cursor.o display.o repaint.o save_selection.o move.o size.o gc.o
objs+=sbar.o erase.o selex.o edit.o command.o selection.o dcs.o utf.o
objs+=selreq.o scr_reset.o string.o screen.o scroll.o selend.o mc.o
objs+=xevents.o window.o xvt.o sgr.o dec_reset.o show_selection.o
objs+=mouse.o double.o dsr.o font.o color.o tab.o rstyle.o tk_char.o
objs+=xcb_screen.o mode.o button_events.o request.o
extra+=color_index.h
${exe}: ${objs}
cd libjb && ${MAKE} CC=${CC}
${CC} ${CFLAGS} -o ${exe} ${objs} ${static} ${ldflags}
strip -o ${exe}.tmp ${exe}
ls -l ${exe}.tmp >> sz.log
rm -f ${exe}.tmp
tail -n 5 sz.log
include depend.mk
JBXVTRenderStyle.h: JBXVTRenderStyle.txt rstylgen.sed
sed -f rstylgen.sed JBXVTRenderStyle.txt > JBXVTRenderStyle.h
color_index.h: color_index.txt cigen.sed
sed -f cigen.sed color_index.txt > color_index.h
JBXVTTokenIndex.h: JBXVTTokenIndex.txt JBXVTTokenIndex.scm
${SCHEME} JBXVTTokenIndex.scm
sgr_cases.c: sgr_cases.txt sgr_cases.scm
${SCHEME} sgr_cases.scm
dec_reset_cases.c: dec_reset_cases.txt dec_reset_cases.awk
awk -f dec_reset_cases.awk dec_reset_cases.txt > \
dec_reset_cases.c
bindest=${DESTDIR}${PREFIX}/bin
docdest=${DESTDIR}${PREFIX}/share/man/man1
install: ${exe}
install -d ${bindest}
install ${exe} ${bindest}
install -d ${docdest}
install ${exe}.1 ${docdest}
depend:
./mkdep.sh
clean:
cd libjb && make clean
rm -f ${exe} *.o *.gcda *.gcno *.gcov libjb/*.gcda \
libjb/*.gcno
distclean: clean
rm -f config.mk gcov.log *~
check:
tests/rgb
tests/sgr
tests/dec_reset
tests/cursor
tests/screen
reset
gcov:
gcov -b *.c > gcov.log
d: # DEBUG build
CFLAGS='-DDEBUG -ggdb -O0 -Werror' make -j8
f: # Optimized build
${MAKE} clean
CFLAGS='-Ofast -march=native -flto' make -j8
s: # Tiny build
${MAKE} clean
CFLAGS='-Os -march=native -flto' make -j8
cppcheck:
cppcheck --enable=all --inconclusive --std=c11 \
-D TIOCSCTTY -I /usr/include \
. 2> cppcheck.log
echo 'Results written to cppcheck.log'
tar.gz: distclean
cd .. && tar czvf jbxvt.tar.gz jbxvt
#EOF
# DO NOT DELETE