From 3b5237c3f5f1c57ea66c60ed7a10632d50881481 Mon Sep 17 00:00:00 2001 From: zawz Date: Tue, 14 Apr 2020 11:33:34 +0200 Subject: [PATCH] zcsf: fixes --- zcsf/Makefile | 2 +- zcsf/Makefile_cpp | 6 ++++-- zcsf/zcsf | 2 +- zcsf/zcsf.bash | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/zcsf/Makefile b/zcsf/Makefile index 6756aaf..9088c09 100644 --- a/zcsf/Makefile +++ b/zcsf/Makefile @@ -19,7 +19,7 @@ $(shell mkdir -p $(BINDIR)) # automatically finds .h DEPS = $(shell find $(IDIR) -type f -regex '.*\.h') # automatically finds .c and makes the corresponding .o rule -OBJ = $(shell find $(SRCDIR) -type f -regex '.*\.c' | sed 's|\.c$|.o|g;s|$(SRCDIR)/|$(ODIR)/|g') +OBJ = $(shell find $(SRCDIR) -type f -regex '.*\.c' | sed 's|\.c|.o|g;s|$(SRCDIR)/|$(ODIR)/|g') $(ODIR)/%.o: $(SRCDIR)/%.c $(DEPS) $(CC) $(CXXFLAGS) -c -o $@ $< diff --git a/zcsf/Makefile_cpp b/zcsf/Makefile_cpp index 8539564..734c82c 100644 --- a/zcsf/Makefile_cpp +++ b/zcsf/Makefile_cpp @@ -8,9 +8,11 @@ NAME = hello LDFLAGS = CC=g++ -CXXFLAGS= -I$(IDIR) -Wall -pedantic -std=c++17 -O2 +CXXFLAGS= -I$(IDIR) -Wall -pedantic -std=c++17 ifeq ($(DEBUG),true) CXXFLAGS += -g +else + CXXFLAGS += -O2 endif $(shell mkdir -p $(ODIR)) @@ -19,7 +21,7 @@ $(shell mkdir -p $(BINDIR)) # automatically finds .h and .hpp DEPS = $(shell find $(IDIR) -type f -regex '.*\.hp?p?') # automatically finds .c and .cpp and makes the corresponding .o rule -OBJ = $(shell find $(SRCDIR) -type f -regex '.*\.cp?p?' | sed 's|\.cp?p?$|.o|g;s|$(SRCDIR)/|$(ODIR)/|g') +OBJ = $(shell find $(SRCDIR) -type f -regex '.*\.cp?p?' | sed 's|\.cpp|.o|g;s|\.c|.o|g;s|$(SRCDIR)/|$(ODIR)/|g') $(ODIR)/%.o: $(SRCDIR)/%.c $(DEPS) $(CC) $(CXXFLAGS) -c -o $@ $< diff --git a/zcsf/zcsf b/zcsf/zcsf index 9bebcb9..8b9fb54 100755 --- a/zcsf/zcsf +++ b/zcsf/zcsf @@ -28,7 +28,7 @@ else local_configpath="$HOME/.config/zcsf" fi -usr_configpath="/usr/share/z/zcsf" +usr_configpath="/usr/share/zcsf" if [ -n "$CONFIGPATH" ] then diff --git a/zcsf/zcsf.bash b/zcsf/zcsf.bash index 33a02bc..9975259 100644 --- a/zcsf/zcsf.bash +++ b/zcsf/zcsf.bash @@ -19,7 +19,7 @@ _zcsf_completion() _compwords="" fi - COMPREPLY=($(compgen -W "$_compwords" "${COMP_WORDS[$COMP_CWORD]}")) + COMPREPLY=($(compgen -W "$_compwords" "${COMP_WORDS[$COMP_CWORD]}" 2>/dev/null)) } complete -F _zcsf_completion -o dirnames zcsf