From 78337812218f12c1d6fc7ac35b4deff21b6a0d6b Mon Sep 17 00:00:00 2001 From: "Sijmen J. Mulder" Date: Sun, 16 Dec 2018 18:01:24 +0100 Subject: [PATCH] Make curses flags configurable --- Makefile | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 7d983e8f..e5b645e0 100644 --- a/Makefile +++ b/Makefile @@ -8,18 +8,21 @@ INSTALL ?= install CFLAGS_OPTIMIZATION ?= -O3 +ifeq ($(shell $(PKG_CONFIG) ncursesw && echo 1),1) + CFLAGS_CURSES ?= $(shell $(PKG_CONFIG) --cflags ncursesw) + LDLIBS_CURSES ?= $(shell $(PKG_CONFIG) --libs ncursesw) +else ifeq ($(shell $(PKG_CONFIG) ncurses && echo 1),1) + CFLAGS_CURSES ?= $(shell $(PKG_CONFIG) --cflags ncurses) + LDLIBS_CURSES ?= $(shell $(PKG_CONFIG) --libs ncurses) +else + LDLIBS_CURSES ?= -lncurses +endif + CFLAGS += -Wall -Wextra -Wno-unused-parameter CFLAGS += $(CFLAGS_OPTIMIZATION) +CFLAGS += $(CFLAGS_CURSES) -ifeq ($(shell $(PKG_CONFIG) ncursesw && echo 1),1) - CFLAGS += $(shell $(PKG_CONFIG) --cflags ncursesw) - LDLIBS += $(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) -else - LDLIBS += -lncurses -endif +LDLIBS += $(LDLIBS_CURSES) DISTFILES = src nnn.1 Makefile README.md LICENSE SRC = src/nnn.c