aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2017-06-19 22:21:08 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2017-06-20 00:50:19 +0530
commit370ed32a28f2ef3a8b875a208749ab8172f87d0c (patch)
tree74614e53bacfe843e55a1634e64f6ecc396a5197 /Makefile
parentb66fa0325d59ce8639877c939327cf1b9d58134d (diff)
downloadnnn-370ed32a28f2ef3a8b875a208749ab8172f87d0c.tar.gz
An undocumented debug mode
1. The debug file is located at /tmp/nnn_debug. 2. Debug mode is completely disabled by default. The debug binary `nnndbg` can be built by running `make debug`.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile7
1 files changed, 5 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 2394a47..dd562ad 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
VERSION = 1.1
-PREFIX = /usr/local
+PREFIX ?= /usr/local
MANPREFIX = $(PREFIX)/share/man
CFLAGS += -O2 -Wall -Wextra -Wno-unused-parameter
@@ -27,9 +27,12 @@ $(LOCALCONFIG): config.def.h
$(SRC): $(LOCALCONFIG)
$(BIN): $(SRC)
- $(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS)
+ $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS)
strip $@
+debug: $(SRC)
+ $(CC) -DDEBUGMODE -g $(CFLAGS) -o nnndbg $^ $(LDFLAGS) $(LDLIBS)
+
install: all
mkdir -p $(DESTDIR)$(PREFIX)/bin
cp -f $(BIN) $(DESTDIR)$(PREFIX)/bin