Makefile | 9 ++++++--- nnn.c | 4 ---- diff --git a/Makefile b/Makefile index 69e19e3e2cbf93e6bb3df562a20420f2adc9dd97..efd9555a355332717073b078bd5f260cfe129b11 100644 --- a/Makefile +++ b/Makefile @@ -5,11 +5,14 @@ MANPREFIX = $(PREFIX)/share/man CFLAGS += -O3 -march=native -Wall -Wextra -Wno-unused-parameter LDLIBS = -lreadline -ifeq ($(shell uname), Darwin) - LDLIBS += -lncurses + +ifeq ($(shell pkg-config ncursesw && echo 1),1) + CFLAGS += $(shell pkg-config --cflags ncursesw) + LDLIBS += $(shell pkg-config --libs ncursesw) else - LDLIBS += -lncursesw + LDLIBS += -lncurses endif + DISTFILES = nlay nnn.c config.def.h nnn.1 Makefile README.md LICENSE LOCALCONFIG = config.h diff --git a/nnn.c b/nnn.c index cedaff199a81b18eb562e34c53a6ccbf30b11040..1bd9a6702e23caf635af23f097033852f15fd47e 100644 --- a/nnn.c +++ b/nnn.c @@ -6,11 +6,7 @@ #include #include #include -#ifdef __linux__ -#include -#else #include -#endif #include #include #include