aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2018-12-17 17:54:49 +0530
committerGravatar GitHub <noreply@github.com>2018-12-17 17:54:49 +0530
commit4fb96ba575d6272ac6aaee6c94f44204aeb53a22 (patch)
tree0c8ccd5dad89bc121d68b794477523df4c8c83f3
parentd360b08eb082c7d17573d5272a15cf26858cf604 (diff)
parent6658af3f66232211fe4720cf611bf4cf10ce415e (diff)
downloadnnn-4fb96ba575d6272ac6aaee6c94f44204aeb53a22.tar.gz
Merge pull request #166 from sjmulder/pr/makefile
Makefile portability tweaks
-rw-r--r--Makefile18
1 files changed, 13 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index b1f1af1..e5b645e 100644
--- a/Makefile
+++ b/Makefile
@@ -6,16 +6,24 @@ STRIP ?= strip
PKG_CONFIG ?= pkg-config
INSTALL ?= install
-CFLAGS ?= -O3
-CFLAGS += -Wall -Wextra -Wno-unused-parameter
+CFLAGS_OPTIMIZATION ?= -O3
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_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