From e758ff78e5294e4358a8208c58db9189a7059120 Mon Sep 17 00:00:00 2001 From: Zhiming Wang Date: Mon, 3 Apr 2017 14:50:21 -0400 Subject: [PATCH 1/2] Allow custom CFLAGS and CPPFLAGS in Makefile This is consistent with the fact that custom LDFLAGS are already allowed, and for once, it makes warning options easier to control. Also use automatic variables $@ and $^ consistently. --- Makefile | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 02f46614..af8b10b2 100644 --- a/Makefile +++ b/Makefile @@ -3,9 +3,7 @@ VERSION = 0.6 PREFIX = /usr/local MANPREFIX = $(PREFIX)/man -#CPPFLAGS = -DDEBUG -#CFLAGS = -g -CFLAGS = -O3 -march=native +CFLAGS += -O3 -march=native LDLIBS = -lcurses DISTFILES = nnn.c config.def.h nnn.1 Makefile README.md LICENSE @@ -21,8 +19,8 @@ $(LOCALCONFIG): config.def.h $(SRC): $(LOCALCONFIG) $(BIN): $(SRC) - $(CC) $(CFLAGS) -o $@ $(SRC) $(LDFLAGS) $(LDLIBS) - strip $(BIN) + $(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS) + strip $@ install: all mkdir -p $(DESTDIR)$(PREFIX)/bin From 1c0c6de635b87d6012694376f29bb3ed52a948f0 Mon Sep 17 00:00:00 2001 From: Zhiming Wang Date: Mon, 3 Apr 2017 15:00:17 -0400 Subject: [PATCH 2/2] Add .travis.yml --- .travis.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..1ff932a2 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,17 @@ +language: c +matrix: + include: + # Access more recent gcc and clang via a Trusty image + - os: linux + dist: trusty + compiler: gcc + - os: linux + dist: trusty + compiler: clang + - os: osx + compiler: gcc + - os: osx + compiler: clang +script: + - make CFLAGS='-Werror' + - make CFLAGS='-Wall -Wextra -Werror'