EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  <2024 Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  <2024
<== Date ==> <== Thread ==>

Subject: Re: Build system issue
From: Jörn Dreyer via Tech-talk <tech-talk at aps.anl.gov>
To: "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>, Simon Rose <Simon.Rose at ess.eu>
Date: Wed, 07 Feb 2024 05:57:43 +0100
Hi Simon,

thanks for the detailed explanation. It works unfortunately only partially. The Perl script now gets called and the template file is generated and installed.
Great! But...
Now it complains that there is no rule for db.template.d to be created. So the dependency never gets created. As it bails out from O.linux.x86_64 I guess that there is a part missing in the rule:

> db.template$(DEP):
> 	@echo $(COMMON_DIR)/db.db: ../Makefile > $@

After some trial and error I found a solution that works:

db.template$(DEP):
	@echo $(COMMON_DIR)/db.template: $(COMMONDEP_TARGET)/Makefile > $@


For my approach only the first solution is relevant. I need a template file that contains variables that can be replaced during IOC startup.

Cheers,

Jörn

Am Dienstag, 6. Februar 2024, 14:48:28 CET schrieb Simon Rose:
> Hi Jörn -
> 
> There are two solutions you could try, depending on preference. You could instead define your rule to generate the .template file as
> 
> $(COMMON_DIR)/db.template:
> 	perl script.pl
> 
> db.template$(DEP):
> 	@echo $(COMMON_DIR)/db.db: ../Makefile > $@
> 
> This would generate the .template file as needed, within the O.Common directory, which would then be installed in as db/db.template. Note that you do need the second target as well, as EPICS base expects a file that describes the dependencies of generated files.
> 
> If, on the other hand, you want to simply create a .db file in the end, you could also do:
> 
> DB += db.db
> 
> db.template:
> 	perl script.pl
> 
> In this case, the regular EPICS build rules to convert a .template file to a .db file will take place, and you will get a .db file only installed.
> 
> In the end, it depends on whether  or not you case about having specifically a .template file or a .db file installed.
> 
> Cheers,
> 
> Simon
> 
> On 2024-02-06, 14:25, "Tech-talk on behalf of Jörn Dreyer via Tech-talk" <tech-talk-bounces at aps.anl.gov <mailto:tech-talk-bounces at aps.anl.gov> on behalf of tech-talk at aps.anl.gov <mailto:tech-talk at aps.anl.gov>> wrote:
> 
> 
> Hi,
> 
> 
> I'm working on a device which has around 20.000 channels which have mostly very similar names. Therefor I created a perl script that auto generates some template files to be used by the IOC. How can I define a rule in the Db/Makefile that calls this script?
> 
> 
> A simple
> 
> 
> DB += db.template
> 
> 
> db.template:
> perl script.pl
> 
> 
> does not work. It complains that there is no rule to create ../O.Common/db.template.
> 
> 
> Regards,
> 
> 
> Jörn
> 



References:
Build system issue Jörn Dreyer via Tech-talk
Re: Build system issue Simon Rose via Tech-talk

Navigate by Date:
Prev: Re: EPICS on FPGA Hill, Jeff via Tech-talk
Next: Re: EPICS on FPGA Kazuro FURUKAWA via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  <2024
Navigate by Thread:
Prev: Re: Build system issue Simon Rose via Tech-talk
Next: Seeking EPICS Database (.db) File Parser/Generator Aqeel Alshafei - STFC UKRI via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  <2024
ANJ, 07 Feb 2024 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·