Refactor Makefile

hledger-completion.bash does not depend on command-options because this
phony target is so slow. Use  make  once and subsequently only
make hledger-completion.bash
This commit is contained in:
Jakob Schöttl 2019-01-12 13:03:17 +01:00 committed by Simon Michael
parent a2dc1289a5
commit ae060d9f13

View File

@ -1,7 +1,10 @@
.PHONY: commands clean
.PHONY: command-options clean
all: generic-options.txt commands hledger-completion.bash
all: command-options hledger-completion.bash
hledger-completion.bash: hledger-completion.bash.m4 commands-list.txt generic-options.txt
m4 hledger-completion.bash.m4 > $@
generic-options.txt:
hledger -h | ./output-options.sh > $@
@ -12,11 +15,8 @@ commands.txt:
commands-list.txt: commands.txt
paste -sd, $^ | tr -d '\n' > $@
commands: commands.txt
command-options: commands.txt
parallel -j8 'hledger {} -h | ./output-options.sh > options-{}.txt' < commands.txt
hledger-completion.bash: hledger-completion.bash.m4 commands-list.txt
m4 hledger-completion.bash.m4 > $@
clean:
rm -f *.txt hledger-completion.bash