www.delorie.com/archives/browse.cgi   search  
Mail Archives: geda-user/2021/07/01/13:33:47

X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f
X-Recipient: geda-user AT delorie DOT com
X-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20161025;
h=from:date:to:subject:message-id:mail-followup-to:references
:mime-version:content-disposition:in-reply-to;
bh=J3PbJRsiz96zmhLGGFK+ix38J6SC74chKvuncJStj2g=;
b=JAIc9RP6iMeHOJBaTTjrUdDqBM46V2zljI40MXynGq462FVssrou3ry2oPARsYJmsC
1z61M8TkCCeY2cfs79yDEzcBs6eiI5B4QertzI3Hj46d3wPGWTgrjFVYMgQM0idkWSfB
8PsJ11WcafzeLGSYON0w+WPsfawDP7AA8R0Z+2yLJCUaGP4K7F6Yczi0rqrg3WxdFCdZ
BuR6dntneipy7KSBnE7NdnveK7WTd1pXrFwvePZkm9TU/361+GQAE73ek6j2b/9XNNOX
hXFDkE8p3AqJGK/rwLTXXwffZEqT1RH/GgJaXtJyy3Ss6V60FyAaJvMcS/ihuvMAA+Ks
AJ3g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20161025;
h=x-gm-message-state:from:date:to:subject:message-id:mail-followup-to
:references:mime-version:content-disposition:in-reply-to;
bh=J3PbJRsiz96zmhLGGFK+ix38J6SC74chKvuncJStj2g=;
b=YEH38Tojt8Q/acjokbY4avR8byrgE+LyDZf+6jgfuE7h7h3NVLyAQ1GGzYZsB9vKfY
NlsYI+Na5J8TZeIces1/zokl/gpU34kFjQqZj9X0pXdFkZDiLtDu7T5XVbNGnR4QV3DD
qio/Jfd4k6GYmRlxD+IijcE0CTpc3oRzmZ1Rv49wXA6YVDFGtKX0mwEX7JvguaF0ovNl
2STnmJUreDgEV4BqkLg7XEXtWODiFcaVeeSoCh1eVIED7XKqNhoRmEmfZNOzZbHo17cy
oIMQyLHqaub6P9ITHRbj/qMQM8v67hGCjJuhTF60Dt/dRJVVUirszxrbEBy+AupXUxjs
ZfSQ==
X-Gm-Message-State: AOAM531FHXVZFZjdOhwpSJoUX7pBnwfVIPWXfWIyNzPYcZE3jtWdqF8j
n3pjpqPtxMXPheA6l9vjg17N40aGPTc=
X-Google-Smtp-Source: ABdhPJx6tGN96yVmDRLhQmE4Rxq1qybjHhAFIU/JyOxyEtpVT5+ImB/CsaqYYedNQYQGfTMuUj6PXg==
X-Received: by 2002:ac2:569a:: with SMTP id 26mr209027lfr.19.1625160764526;
Thu, 01 Jul 2021 10:32:44 -0700 (PDT)
From: "vzh (vzhbanov AT gmail DOT com) [via geda-user AT delorie DOT com]" <geda-user AT delorie DOT com>
X-Google-Original-From: vzh <vzh AT lepton>
Date: Thu, 1 Jul 2021 20:32:42 +0300
To: geda-user AT delorie DOT com
Subject: Re: [geda-user] how to find sch-sym depenencies for Makefile
Message-ID: <YN38OhSVu4qv1JVn@lepton>
Mail-Followup-To: geda-user AT delorie DOT com
References: <20210701152018 DOT F248283D521B AT turkos DOT aspodata DOT se>
MIME-Version: 1.0
In-Reply-To: <20210701152018.F248283D521B@turkos.aspodata.se>
Reply-To: geda-user AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: geda-user AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

--S/J/x+iM7rI6TJDU
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline

Hi Karl,

On Thu, Jul 01, 2021 at 05:20:18PM +0200, karl AT aspodata DOT se [via geda-user AT delorie DOT com] wrote:
>  I want to have a program that finds dependencies between
>  a .sch and the .sch and .sym files it depends on, suitable
>  for makefiles, to write lines like:
> a.sch:	<somewhere>/a.sym <there>/b.sch ...
> 
>  I can easily (with e.g. perl) extract "C ..." lines and their 
>  sym and source=*.sch parts. But I don't want to write a scheme
>  parser to find out (in various gafrc files) where to search for
>  the actual files, e.g. to get rid of a annoying error
>  messege, I did:
> (define (cl str) (if (access? str R_OK) (component-library str)))
> (cl "sym")
>  so a simple grep doesn't work.
> 
>  I tried with:
> $ lepton-cli shell -c '(define (source-library str) (display str))'  -s /home/karl/.config/lepton-eda/gafrc
> ** Message: 17:05:36.409: Loaded RC file [/usr/local/share/lepton-eda/system-gafrc]
> ** Message: 17:05:36.703: Loaded RC file [/home/karl/.config/lepton-eda/gafrc]
>  but didn't work, but at leas I got a list of gafrc files.
> 
>  I guess I could start out with lepton-eda/utils/archive, but
>  I'm not that good at scheme.

An attached first draft patch for makedepend backend does the job
for me.  Well, it does a bit more since it tries to create SPICE
file names as well, which is probably not what you want in this
case.  Anyway, it's just a draft.  If you would want to extend it
a bit more, please let me know, an example of input and output
would not harm.  Apply the patch to lepton sources and try.  You
can do this without installation of the new code, the command is
simply as follows (provided you're in the root directory of lepton
repo):

lepton-netlist -f utils/netlist/scheme/backend/gnet-makedepend.scm \
  -o output utils/netlist/tests/hierarchy.sch

HTH,

-- 
  Vladimir
--S/J/x+iM7rI6TJDU
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="0001-netlist-Modify-the-makedepend-backend-to-output-full.patch"

From 3b6bb8d446969ae097651ee6370a853e69310954 Mon Sep 17 00:00:00 2001
From: Vladimir Zhbanov <vzhbanov AT gmail DOT com>
Date: Thu, 1 Jul 2021 20:17:31 +0300
Subject: [PATCH] netlist: Modify the makedepend backend to output full symbol
 names as well.

---
 utils/netlist/scheme/backend/gnet-makedepend.scm | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/utils/netlist/scheme/backend/gnet-makedepend.scm b/utils/netlist/scheme/backend/gnet-makedepend.scm
index 3434e8c1a..aeea5fd1b 100644
--- a/utils/netlist/scheme/backend/gnet-makedepend.scm
+++ b/utils/netlist/scheme/backend/gnet-makedepend.scm
@@ -82,6 +82,7 @@
              (srfi srfi-1)
              (sxml transform)
              (sxml match)
+             (lepton object)
              (lepton page)
              (netlist schematic)
              (netlist schematic-component)
@@ -209,8 +210,15 @@
             ls))
 
 (define (makedepend output-filename)
-  (let ((dep-list (schematic-sxml->dependency-list
-                   (schematic-tree (toplevel-schematic)))))
+  (let ((dep-list
+         (append (schematic-sxml->dependency-list (schematic-tree (toplevel-schematic)))
+                 (delete-duplicates
+                  (map (lambda (p)
+                         (cons (basename (page-filename p))
+                               (list (map component-filename
+                                          (delete-duplicates (filter component?
+                                                                     (page-contents p)))))))
+                       (active-pages))))))
     (format-dependency-list dep-list)))
 
 ;; vim:shiftwidth=2
-- 
2.30.2


--S/J/x+iM7rI6TJDU--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019