9 # Customize below to fit your system
12 MANPREFIX
= ${PREFIX}/share
/man
13 SHAREPREFIX
= ${PREFIX}/share
/vis
17 CFLAGS_TERMKEY
= $(shell pkg-config
--cflags termkey
2> /dev
/null || echo
"")
18 LDFLAGS_TERMKEY
= $(shell pkg-config
--libs termkey
2> /dev
/null || echo
"-ltermkey")
20 CFLAGS_CURSES
= $(shell pkg-config
--cflags ncursesw
2> /dev
/null || echo
"-I/usr/include/ncursesw")
21 LDFLAGS_CURSES
= $(shell pkg-config
--libs ncursesw
2> /dev
/null || echo
"-lncursesw")
23 ifeq (${CONFIG_LUA},1)
24 CFLAGS_LUA
= $(shell pkg-config
--cflags lua5.2
2> /dev
/null || echo
"-I/usr/include/lua5.2")
25 LDFLAGS_LUA
= $(shell pkg-config
--libs lua5.2
2> /dev
/null || echo
"-llua -lm")
28 ifeq (${CONFIG_ACL},1)
35 ifeq (${CONFIG_SELINUX},1)
38 else ifeq (${OS},Darwin
)
39 CFLAGS
+= -D_DARWIN_C_SOURCE
40 else ifeq (${OS},OpenBSD
)
41 CFLAGS
+= -D_BSD_SOURCE
42 else ifeq (${OS},FreeBSD
)
43 CFLAGS
+= -D_BSD_SOURCE
44 else ifeq (${OS},NetBSD
)
45 CFLAGS
+= -D_BSD_SOURCE
47 CFLAGS
+= -D_ALL_SOURCE
50 CFLAGS_LIBS
= $(CFLAGS_LUA
) $(CFLAGS_TERMKEY
) $(CFLAGS_CURSES
)
51 LDFLAGS_LIBS
= $(LDFLAGS_LUA
) $(LDFLAGS_TERMKEY
) $(LDFLAGS_CURSES
) $(LIBS
)
53 CFLAGS_STD
= -std
=c99
-D_POSIX_C_SOURCE
=200809L -D_XOPEN_SOURCE
=700
55 CFLAGS_VIS
= $(CFLAGS_LIBS
) $(CFLAGS_STD
) -Os
-DVERSION
=\"${VERSION}\" -DNDEBUG
56 CFLAGS_VIS
+= -DCONFIG_LUA
=${CONFIG_LUA}
57 CFLAGS_VIS
+= -DCONFIG_SELINUX
=${CONFIG_SELINUX}
58 CFLAGS_VIS
+= -DCONFIG_ACL
=${CONFIG_ACL}
59 ifeq (${CONFIG_LUA},1)
60 CFLAGS_VIS
+= -DLUA_COMPAT_5_1
-DLUA_COMPAT_5_2
-DLUA_COMPAT_ALL
63 LDFLAGS_VIS
= $(LDFLAGS_LIBS
)
65 DEBUG_CFLAGS_VIS
= ${CFLAGS_VIS} -UNDEBUG
-O0
-g
-ggdb
-Wall
-Wextra
-pedantic
-Wno-missing-field-initializers
-Wno-unused-parameter