]> Sergey Matveev's repositories - nnn.git/commitdiff
Make curses flags configurable
authorSijmen J. Mulder <ik@sjmulder.nl>
Sun, 16 Dec 2018 17:01:24 +0000 (18:01 +0100)
committerSijmen J. Mulder <ik@sjmulder.nl>
Sun, 16 Dec 2018 19:19:08 +0000 (20:19 +0100)
Makefile

index 7d983e8fba1fc59d292f87206d3fd0ea83a6bcd8..e5b645e0810727bfe2e78b27f95610685b6d8763 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -8,19 +8,22 @@ INSTALL ?= install
 
 CFLAGS_OPTIMIZATION ?= -O3
 
-CFLAGS += -Wall -Wextra -Wno-unused-parameter
-CFLAGS += $(CFLAGS_OPTIMIZATION)
-
 ifeq ($(shell $(PKG_CONFIG) ncursesw && echo 1),1)
-       CFLAGS += $(shell $(PKG_CONFIG) --cflags ncursesw)
-       LDLIBS += $(shell $(PKG_CONFIG) --libs   ncursesw)
+       CFLAGS_CURSES ?= $(shell $(PKG_CONFIG) --cflags ncursesw)
+       LDLIBS_CURSES ?= $(shell $(PKG_CONFIG) --libs   ncursesw)
 else ifeq ($(shell $(PKG_CONFIG) ncurses && echo 1),1)
-       CFLAGS += $(shell $(PKG_CONFIG) --cflags ncurses)
-       LDLIBS += $(shell $(PKG_CONFIG) --libs   ncurses)
+       CFLAGS_CURSES ?= $(shell $(PKG_CONFIG) --cflags ncurses)
+       LDLIBS_CURSES ?= $(shell $(PKG_CONFIG) --libs   ncurses)
 else
-       LDLIBS += -lncurses
+       LDLIBS_CURSES ?= -lncurses
 endif
 
+CFLAGS += -Wall -Wextra -Wno-unused-parameter
+CFLAGS += $(CFLAGS_OPTIMIZATION)
+CFLAGS += $(CFLAGS_CURSES)
+
+LDLIBS += $(LDLIBS_CURSES)
+
 DISTFILES = src nnn.1 Makefile README.md LICENSE
 SRC = src/nnn.c
 BIN = nnn