From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 02446d60 for ; Thu, 22 Aug 2019 07:00:10 +0000 (UTC) Received: (qmail 26541 invoked by alias); 22 Aug 2019 07:00:04 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 44696 Received: (qmail 12576 invoked by uid 1010); 22 Aug 2019 07:00:04 -0000 X-Qmail-Scanner-Diagnostics: from hahler.de by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.101.2/25545. spamassassin: 3.4.2. Clear:RC:0(188.40.33.212):SA:0(-1.7/5.0):. Processed in 0.646572 secs); 22 Aug 2019 07:00:04 -0000 X-Envelope-From: daniel@hahler.de X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.hahler.de designates 188.40.33.212 as permitted sender) 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= From: Daniel Hahler To: zsh-workers@zsh.org Subject: [PATCH] _make-parseMakefile: skip non-targets Date: Thu, 22 Aug 2019 08:59:29 +0200 Message-Id: <20190822065929.16277-1-genml+zsh-workers@thequod.de> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Qmail-Scanner-2.11: added fake Content-Type header Content-Type: text/plain From: Daniel Hahler 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