aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--Makefile29
1 files changed, 27 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index ba128c6..8efdab5 100644
--- a/Makefile
+++ b/Makefile
@@ -50,10 +50,10 @@ FLAGS = $(WARN) -std=gnu99
.PHONY: default
-default: command
+default: command shell
.PHONY: all
-all: command
+all: command shell
.PHONY: command
@@ -68,6 +68,31 @@ obj/%.o: src/%.c
$(CC) $(FLAGS) $(COPTIMISE) -c -o $@ $< $(CFLAGS) $(CPPFLAGS)
+.PHONY: shell
+shell: bash zsh fish
+
+.PHONY: bash
+bash: bin/$(COMMAND).bash
+
+.PHONY: zsh
+zsh: bin/$(COMMAND).zsh
+
+.PHONY: fish
+fish: bin/$(COMMAND).fish
+
+bin/%.bash: src/completion
+ @mkdir -p bin
+ auto-auto-complete bash --output $@ --source $< command="$*"
+
+bin/%.zsh: src/completion
+ @mkdir -p bin
+ auto-auto-complete zsh --output $@ --source $< command="$*"
+
+bin/%.fish: src/completion
+ @mkdir -p bin
+ auto-auto-complete fish --output $@ --source $< command="$*"
+
+
.PHONY: clean
clean: