From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Fri, 29 Jul 2022 14:03:22 +0200 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1oHOiA-003YzZ-6f for lore@lore.pengutronix.de; Fri, 29 Jul 2022 14:03:22 +0200 Received: from localhost ([127.0.0.1] helo=metis.ext.pengutronix.de) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1oHOi9-0007HQ-8k; Fri, 29 Jul 2022 14:03:21 +0200 Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oHOhf-0007GR-6z; Fri, 29 Jul 2022 14:02:51 +0200 Received: from mol by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1oHOhe-00030Y-TN; Fri, 29 Jul 2022 14:02:50 +0200 Date: Fri, 29 Jul 2022 14:02:50 +0200 From: Michael Olbrich To: Andreas Helmcke Message-ID: <20220729120250.GE20240@pengutronix.de> Mail-Followup-To: Andreas Helmcke , ptxdist@pengutronix.de References: <418570e2-7fbd-f917-3cad-98e52247d275@ela-soft.com> <20220729104859.GC20240@pengutronix.de> <20220729105413.GD20240@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-Accept-Language: de,en X-Accept-Content-Type: text/plain User-Agent: Mutt/1.10.1 (2018-07-13) Subject: Re: [ptxdist] Problems with own get rule X-BeenThere: ptxdist@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Cc: ptxdist@pengutronix.de Sender: "ptxdist" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: ptxdist-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false On Fri, Jul 29, 2022 at 01:23:22PM +0200, Andreas Helmcke wrote: > Hello, > > Am 29.07.22 um 12:54 schrieb Michael Olbrich: > > On Fri, Jul 29, 2022 at 12:48:59PM +0200, Michael Olbrich wrote: > >> On Fri, Jul 29, 2022 at 12:37:50PM +0200, Andreas Helmcke wrote: > >>> Hello, > >>> > >>> i have defined my own get rule to fetch some sources from svn. I did not use the buildin svn support because: > >>> 1. there are different svn targets which must get checked out to specific directories > >>> 2. i want to use tags, not revision numbers > >>> > >>> This works pretty well, there is only one problem. > >>> > >>> After ptxdist menuconfig is called to change the version number, the compile step fails with missing directory because the get rule wont get called. It should, since the source directory does not exists (the directory name contains the version (tag) name). > >>> > >>> Any advice is appreciated. > >> > >> Which PTXdist version? I think with a current version, foo.get should be > >> called whenever the value of $(FOO) changes. > > ptxdist version: 2022.05.0 > > > It's only used indirectly via FOO_SOURCE. Try setting: > > > > FOO_SOURCE := $(FOO_SRC_DIR) > > this produces a circular dependency: > > make: Circular .../svn_src/foo-V2.00.01-B2 <- .../svn_src/foo-V2.00.01-B2 dependency dropped. Hmmm, so maybe you will need to find another way. In general ptxdist uses make here and it generates the dependencies and has default implemenations for certain targets. For the 'get' part, ptxdist works like this: If there is something to download, then it expects $(FOO_SOURCE) to refer to a single file that contains all the source. PTXdist will denn generate a make target that handles the download based on $(FOO_URL). The foo.get stage has a existence only dependency on $(FOO_SOURCE). This means that it is not triggered when the timestamp for $(FOO_SOURCE) changes. This stage will mostly check if the md5 matches. Now, you can overwrite foo.get with something else, but then you need to have your own dependencies that trigger foo.get. Maybe something like this: $(STATEDIR)/foo.$(FOO_VERSION): @$(call touch) $(STATEDIR)/foo.get: $(STATEDIR)/foo.$(FOO_VERSION) ... Michael > >>> The make file has this rules: > >>> > >>>> # > >>>> # We provide this package > >>>> # > >>>> PACKAGES-$(PTXCONF_FOO) += foo > >>>> > >>>> # > >>>> # Paths and names > >>>> # > >>>> FOO_VERSION := $(call ptx/config-version, PTXCONF_FOO) > >>>> FOO_MD5 := > >>>> FOO := foo-$(FOO_VERSION) > >>>> FOO_SRC_DIR := $(PTXDIST_WORKSPACE)/svn_src/$(FOO) > >>>> FOO_URL := lndir://$(FOO_SRC_DIR) > >>>> FOO_DIR := $(BUILDDIR)/$(FOO) > >>>> FOO_LICENSE := unknown > >>>> > >>>> FOO_SVN_BASE_URL := \ > >>>> https://subversion.company.com/entwicklung/foo_bar/foo/tags/$(FOO_VERSION) > >>>> > >>>> # ---------------------------------------------------------------------------- > >>>> # Get > >>>> # ---------------------------------------------------------------------------- > >>>> > >>>> $(STATEDIR)/foo.get: > >>>> @$(call targetinfo) > >>>> @$(call clean, $(FOO_SRC_DIR)) > >>>> @svn export \ > >>>> $(FOO_SVN_BASE_URL)/foo/phyCard-release $(FOO_SRC_DIR)/foo/phyCard-release > >>>> @svn export \ > >>>> $(FOO_SVN_BASE_URL)/foo/src $(FOO_SRC_DIR)/foo/src > >>>> @$(call touch) > >>>> > >>>> > >>>> # ---------------------------------------------------------------------------- > >>>> # Extract > >>>> # ---------------------------------------------------------------------------- > >>>> > >>>> $(STATEDIR)/foo.extract: > >>>> @$(call targetinfo) > >>>> @$(call clean, $(FOO_DIR)) > >>>> @$(call extract, FOO) > >>>> @$(call patchin, FOO) > >>>> @$(call touch) > >>> > >>> > >> > >> -- > >> Pengutronix e.K. | | > >> Steuerwalder Str. 21 | http://www.pengutronix.de/ | > >> 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | > >> Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | > >> > >> > > > > -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |