aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2017-04-02 21:15:31 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2017-04-02 21:45:10 +0530
commit87e0891b8d8b9ac2779d2785ac6fd6e946fdcc5b (patch)
tree735286b4f89d0f297483d9be768e028569f194db /Makefile
parent4bc2ce0fbc27180ea5108121fec93eebf3112de1 (diff)
downloadnnn-87e0891b8d8b9ac2779d2785ac6fd6e946fdcc5b.tar.gz
Remove redundant stuff
1. Have a faster copy of strlcpy() 2. Remove redundant legacy files 3. Fix an issue with NULL check on array name
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile23
1 files changed, 11 insertions, 12 deletions
diff --git a/Makefile b/Makefile
index e971355..02f4661 100644
--- a/Makefile
+++ b/Makefile
@@ -5,25 +5,24 @@ MANPREFIX = $(PREFIX)/man
#CPPFLAGS = -DDEBUG
#CFLAGS = -g
-CFLAGS = -O3 -march=native -s
+CFLAGS = -O3 -march=native
LDLIBS = -lcurses
-DISTFILES = nnn.c strlcat.c strlcpy.c util.h config.def.h \
- nnn.1 Makefile README.md LICENSE
-OBJ = nnn.o strlcat.o strlcpy.o
+DISTFILES = nnn.c config.def.h nnn.1 Makefile README.md LICENSE
+LOCALCONFIG = config.h
+SRC = nnn.c
BIN = nnn
all: $(BIN)
-$(BIN): $(OBJ)
- $(CC) $(CFLAGS) -o $@ $(OBJ) $(LDFLAGS) $(LDLIBS)
+$(LOCALCONFIG): config.def.h
+ cp config.def.h $@
-nnn.o: util.h config.h
-strlcat.o: util.h
-strlcpy.o: util.h
+$(SRC): $(LOCALCONFIG)
-config.h: config.def.h
- cp config.def.h $@
+$(BIN): $(SRC)
+ $(CC) $(CFLAGS) -o $@ $(SRC) $(LDFLAGS) $(LDLIBS)
+ strip $(BIN)
install: all
mkdir -p $(DESTDIR)$(PREFIX)/bin
@@ -43,4 +42,4 @@ dist:
rm -rf nnn-$(VERSION)
clean:
- rm -f $(BIN) $(OBJ) nnn-$(VERSION).tar.gz
+ rm -f $(BIN) nnn-$(VERSION).tar.gz