Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] _make-parseMakefile: skip non-targets
- X-seq: zsh-workers 44696
- From: Daniel Hahler <genml+zsh-workers@xxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH] _make-parseMakefile: skip non-targets
- Date: Thu, 22 Aug 2019 08:59:29 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/simple; d=thequod.de; h= content-transfer-encoding:mime-version:x-mailer:message-id:date :date:subject:subject:from:from:received:received:received; s= postfix2; t=1566457171; bh=X2uOWoLXWEi/akeVMjouAzPcMWLvByRbMljhs +SsXSw=; b=t7bpEYlomPkd+8Jh3RFCY2HKSmmwowd4Dnc8Dpn5gTpinrkGeRnAP c6ZmZnoa94QrBgy0sGhTyt8hfO3nE9ppM6wUCHiJHpnu6RQNDSpKjngFqcp5I+3c REMo4Kv4uNNy+okb72cXAKuQY8SKOTWZJjDBKfUHmV9/2hjBgU8xew=
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
From: Daniel Hahler <git@xxxxxxxxxx>
These look like this, and might come from pattern rules ("%.res" in this
case):
# Not a target:
test_autocmd.res:
# Implicit rule search has not been done.
# Modification time never checked.
# File has not been updated.
---
Completion/Unix/Command/_make | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/Completion/Unix/Command/_make b/Completion/Unix/Command/_make
index 38d0b0e76..695fc9907 100644
--- a/Completion/Unix/Command/_make
+++ b/Completion/Unix/Command/_make
@@ -69,7 +69,7 @@ _make-expandVars() {
}
_make-parseMakefile () {
- local input var val target dep TAB=$'\t' tmp IFS=
+ local input var val target dep TAB=$'\t' tmp IFS= not_a_target=0
while read input
do
@@ -92,11 +92,20 @@ _make-parseMakefile () {
VARIABLES[$var]=$val
;;
+ # Skip following TARGET: after "Not a target:" comment.
+ '# Not a target: ')
+ not_a_target=1
+ ;;
+
# TARGET: dependencies
# TARGET1 TARGET2 TARGET3: dependencies
([[*?[:alnum:]$][^$TAB:=%]#:[^=]*)
- target=$(_make-expandVars ${input%%:*})
- TARGETS+=( ${(z)target} )
+ if (( not_a_target )); then
+ not_a_target=0
+ else
+ target=$(_make-expandVars ${input%%:*})
+ TARGETS+=( ${(z)target} )
+ fi
;;
# Include another makefile
--
2.23.0
Messages sorted by:
Reverse Date,
Date,
Thread,
Author