From f257cda04ad0f5b6efbb435de61e45d2ae5acbb1 Mon Sep 17 00:00:00 2001 From: "Sijmen J. Mulder" Date: Sun, 16 Dec 2018 17:56:41 +0100 Subject: Make optimization flags configurable --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b1f1af1..30d66f4 100644 --- a/Makefile +++ b/Makefile @@ -6,8 +6,10 @@ STRIP ?= strip PKG_CONFIG ?= pkg-config INSTALL ?= install -CFLAGS ?= -O3 +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) -- cgit v1.2.3-70-g09d2 From 599f4e82b7cc030eb3d10876677f44fabe5194b5 Mon Sep 17 00:00:00 2001 From: "Sijmen J. Mulder" Date: Sun, 16 Dec 2018 17:59:20 +0100 Subject: Also use pkg-config for regular ncurses --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index 30d66f4..7d983e8 100644 --- a/Makefile +++ b/Makefile @@ -14,6 +14,9 @@ CFLAGS += $(CFLAGS_OPTIMIZATION) 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 -- cgit v1.2.3-70-g09d2 From 78337812218f12c1d6fc7ac35b4deff21b6a0d6b Mon Sep 17 00:00:00 2001 From: "Sijmen J. Mulder" Date: Sun, 16 Dec 2018 18:01:24 +0100 Subject: Make curses flags configurable --- Makefile | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 7d983e8..e5b645e 100644 --- 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 -- cgit v1.2.3-70-g09d2 From 4005a1fa4679adcfcb4d51fa89aca0ab1db3cd26 Mon Sep 17 00:00:00 2001 From: "Sijmen J. Mulder" Date: Sun, 16 Dec 2018 18:02:19 +0100 Subject: Remove CPPFLAGS since C++ is not used --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index e5b645e..0235c02 100644 --- a/Makefile +++ b/Makefile @@ -33,10 +33,10 @@ all: $(BIN) $(SRC): src/nnn.h $(BIN): $(SRC) - $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS) + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS) debug: $(SRC) - $(CC) -DDEBUGMODE -g $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(BIN) $^ $(LDLIBS) + $(CC) -DDEBUGMODE -g $(CFLAGS) $(LDFLAGS) -o $(BIN) $^ $(LDLIBS) install: all $(INSTALL) -m 0755 -d $(DESTDIR)$(PREFIX)/bin -- cgit v1.2.3-70-g09d2 From 6658af3f66232211fe4720cf611bf4cf10ce415e Mon Sep 17 00:00:00 2001 From: "Sijmen J. Mulder" Date: Mon, 17 Dec 2018 09:50:29 +0100 Subject: Revert "Remove CPPFLAGS since C++ is not used" Mistook CPPFLAGS ("C preprocessor flags") for CXXFLAGS ("C++ flags"). This reverts commit 0956b82d33fb2956da837e6a06a2a6f7216d47c0. --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 0235c02..e5b645e 100644 --- a/Makefile +++ b/Makefile @@ -33,10 +33,10 @@ all: $(BIN) $(SRC): src/nnn.h $(BIN): $(SRC) - $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS) + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS) debug: $(SRC) - $(CC) -DDEBUGMODE -g $(CFLAGS) $(LDFLAGS) -o $(BIN) $^ $(LDLIBS) + $(CC) -DDEBUGMODE -g $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(BIN) $^ $(LDLIBS) install: all $(INSTALL) -m 0755 -d $(DESTDIR)$(PREFIX)/bin -- cgit v1.2.3-70-g09d2