aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorGravatar Zhiming Wang <zmwangx@gmail.com>2017-04-03 14:50:21 -0400
committerGravatar Zhiming Wang <zmwangx@gmail.com>2017-04-03 14:50:21 -0400
commite758ff78e5294e4358a8208c58db9189a7059120 (patch)
tree6eed6334bee5ff87da39ace07ee9db29fdd66757 /Makefile
parent754ea4d3efbe54ef5649536fcef1600d2f090233 (diff)
downloadnnn-e758ff78e5294e4358a8208c58db9189a7059120.tar.gz
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.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile8
1 files changed, 3 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 02f4661..af8b10b 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