From 87e0891b8d8b9ac2779d2785ac6fd6e946fdcc5b Mon Sep 17 00:00:00 2001 From: Arun Prakash Jana Date: Sun, 2 Apr 2017 21:15:31 +0530 Subject: 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 --- Makefile | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'Makefile') 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 -- cgit v1.2.3-70-g09d2