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  2025  <2026 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  2025  <2026
<== Date ==> <== Thread ==>

Subject: Nested MSI and Makefile dependencies
From: Michael Davidsaver via Tech-talk <tech-talk at aps.anl.gov>
To: EPICS Tech-Talk <tech-talk at aps.anl.gov>
Date: Mon, 16 Feb 2026 11:32:14 -0800

I have occasionally had situations where I wanted to include the output of one MSI substitutions file when expanding another.  To get the effect of a nested loop, or when I want one repeated section to be included in two final .db files.

In trying to make this work, I have continually struggled to get complete dependency lists for Make.  Below is the outcome of my most recent iteration, which is hopefully closer to correct.

To make up an example, suppose I have three files:

  • top.substitutions (includes 'middle.db')
  • middle.substitutions (includes 'leaf.template')
  • leaf.template

I want to install only 'top.db'.  My Makefile would now look like:

TOP=../..
include $(TOP)/configure/CONFIG

DB += top.db

DBDDEPENDS_FILES += middle.db$(DEP)

include $(TOP)/configure/RULES

top.db$(DEP): $(COMMON_DIR)/middle.db

The two special lines, in order of effect:

top.db$(DEP): $(COMMON_DIR)/middle.db

This establishes the initial dependency.  The '.db$(DEP)' target is needed as the MSI dependency creation rule requires 'middle.db' to exist.

I do not find it necessary to have an explicit dependency "$(COMMON_DIR)/top.db: $(COMMON_DIR)/middle.db" for a clean build to succeed, but I am not certain why.  Is "$(DEP)" file creation somehow ordered first?  Or have I just been lucky so far?

Of course this dependency will appear in 'top.db$(DEP)' when it is created.  So no problem for incremental rebuild.

DBDDEPENDS_FILES += middle.db$(DEP)

For correct incremental rebuild, this assignment is necessary to include the '.db$(DEP)'.  Otherwise it is created, but not used.

This can be verified by "make -C O.$(T_A) PRINT.DBDDEPENDS_FILES" to see that both '.db$(DEP)' are listed.  And by patient inspection of the output of: "remake -C O.$(T_A) -p".


Navigate by Date:
Prev: Re: Does every DB record need to produce a PV? Sukhanov, Andrei via Tech-talk
Next: Re: Does every DB record need to produce a PV? Michael Davidsaver 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  2025  <2026
Navigate by Thread:
Prev: Re: EPICS CA and PVA across subnets James Smedinghoff via Tech-talk
Next: first time with EPICS: st.cmd doesn't work Luis Alberto De Sousa Moreira 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  2025  <2026
ANJ, 19 Mar 2026 · Home · News · About · Talk · Base · Modules · Extensions ·
· Distributions · Download · Documents · Links · Licensing ·