aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-12-03 10:57:37 +0100
committerMattias Andrée <maandree@operamail.com>2014-12-03 10:57:37 +0100
commit600af502aaedcc496ac3dc0771888de978f3e31c (patch)
treec5e496ea976bb602e232b55bfc664b16bb9fd049 /Makefile
parentchange license (diff)
downloadkrandom-600af502aaedcc496ac3dc0771888de978f3e31c.tar.gz
krandom-600af502aaedcc496ac3dc0771888de978f3e31c.tar.bz2
krandom-600af502aaedcc496ac3dc0771888de978f3e31c.tar.xz
add completion
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'Makefile')
-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: