diff --git a/Makefile b/Makefile index c8fe906..5ee4849 100644 --- a/Makefile +++ b/Makefile @@ -9,9 +9,11 @@ prefix = /usr/local includedir = $(prefix)/include libdir = $(prefix)/lib confdir = $(prefix)/etc +datadir = $(prefix)/share exec_prefix = $(prefix) bindir = $(exec_prefix)/bin +zshcompdir = $(datadir)/zsh/site-functions SRCS = $(sort $(wildcard src/*.c)) OBJS = $(SRCS:.c=.o) @@ -46,7 +48,9 @@ CFLAGS_MAIN=-DLIB_DIR=\"$(libdir)\" -DINSTALL_PREFIX=\"$(prefix)\" -DDLL_NAME=\" all: $(ALL_LIBS) $(ALL_TOOLS) #install: $(ALL_LIBS:lib/%=$(DESTDIR)$(libdir)/%) $(DESTDIR)$(LDSO_PATHNAME) -install: +install: install-exec install-config install-zsh-completion + +install-exec: install -d $(DESTDIR)/$(bindir) $(DESTDIR)/$(libdir) $(DESTDIR)/$(confdir) $(DESTDIR)/$(includedir) install $(INSTALL_FLAGS) 755 $(ALL_TOOLS) $(DESTDIR)/$(bindir)/ install $(INSTALL_FLAGS) 644 $(ALL_LIBS) $(DESTDIR)/$(libdir)/ @@ -55,6 +59,10 @@ install-config: install -d $(DESTDIR)/$(confdir) install $(INSTALL_FLAGS) 644 src/proxychains.conf $(DESTDIR)/$(confdir)/ +install-zsh-completion: + install -d $(DESTDIR)/$(zshcompdir) + install $(INSTALL_FLAGS) 644 completions/zsh/_proxychains4 -t $(DESTDIR)/$(zshcompdir) + clean: rm -f $(ALL_LIBS) rm -f $(ALL_TOOLS) @@ -70,6 +78,6 @@ $(LDSO_PATHNAME): $(LOBJS) $(ALL_TOOLS): $(OBJS) $(CC) src/main.o src/common.o -o $(PXCHAINS) -.PHONY: all clean install install-config +.PHONY: all clean install install-exec install-config install-zsh-completion -include $(DEPS) diff --git a/completions/zsh/_proxychains4 b/completions/zsh/_proxychains4 new file mode 100644 index 0000000..ed3481f --- /dev/null +++ b/completions/zsh/_proxychains4 @@ -0,0 +1,3 @@ +#compdef proxychains4 + +_arguments -s -S '1: :{_command_names -e}' '*:: :_normal'