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 CFLAGS
+= -DCONFIG_LUA
=${CONFIG_LUA}
29 CFLAGS
+= -DCONFIG_SELINUX
=${CONFIG_SELINUX}
30 CFLAGS
+= -DCONFIG_ACL
=${CONFIG_ACL}
32 ifeq (${CONFIG_ACL},1)
39 ifeq (${CONFIG_SELINUX},1)
42 else ifeq (${OS},Darwin
)
43 CFLAGS
+= -D_DARWIN_C_SOURCE
44 else ifeq (${OS},OpenBSD
)
45 CFLAGS
+= -D_BSD_SOURCE
46 else ifeq (${OS},FreeBSD
)
47 CFLAGS
+= -D_BSD_SOURCE
48 else ifeq (${OS},NetBSD
)
49 CFLAGS
+= -D_BSD_SOURCE
51 CFLAGS
+= -D_ALL_SOURCE
54 CFLAGS_LIBS
= $(CFLAGS_LUA
) $(CFLAGS_TERMKEY
) $(CFLAGS_CURSES
)
55 LDFLAGS_LIBS
= $(LDFLAGS_LUA
) $(LDFLAGS_TERMKEY
) $(LDFLAGS_CURSES
) $(LIBS
)
57 CFLAGS_VIS
= $(CFLAGS_LIBS
) -std
=c99
-Os
-DVERSION
=\"${VERSION}\" -DNDEBUG
-D_POSIX_C_SOURCE
=200809L -D_XOPEN_SOURCE
=700 -DLUA_COMPAT_5_1
-DLUA_COMPAT_5_2
-DLUA_COMPAT_ALL
58 LDFLAGS_VIS
= $(LDFLAGS_LIBS
)
60 DEBUG_CFLAGS_VIS
= ${CFLAGS_VIS} -UNDEBUG
-O0
-g
-ggdb
-Wall
-Wextra
-pedantic
-Wno-missing-field-initializers
-Wno-unused-parameter
67 CFLAGS
+= -fPIC
-fstack-protector-all
-D_FORTIFY_SOURCE
=2
68 LDFLAGS
+= -z now
-z relro
-pie
69 else ifeq (${CC},clang
)
70 CFLAGS
+= -fPIE
-fstack-protector-all
-D_FORTIFY_SOURCE
=2
71 LDFLAGS
+= -z now
-z relro
-pie