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  <20232024  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  <20232024 
<== Date ==> <== Thread ==>

Subject: Re: makefile question about HDEPENDS
From: Andrew Johnson via Tech-talk <tech-talk at aps.anl.gov>
To: Simon Rose <Simon.Rose at ess.eu>, timesir <mrlong336 at gmail.com>, "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date: Thu, 25 May 2023 10:25:42 -0500
On 5/25/23 9:20 AM, Simon Rose via Tech-talk wrote:

Hi timesir –

 

This is how the build system generates the .d (dependency) files for each of the source files. See https://github.com/epics-base/epics-base/blob/7.0/configure/CONFIG_COMMON#L135 for the definition.

 

The HDEPENDS.c is the mechanism to generate these files; these are also in the same file, see https://github.com/epics-base/epics-base/blob/7.0/configure/CONFIG_COMMON#L378. For example, if HDEPENDS_METHOD = COMP then it uses the C/C++ compiler to generate these files; otherwise it uses mkmf (included in tools)

 

For certain architectures (e.g. gnu ones), these are used to compile source files, see here: https://github.com/epics-base/epics-base/blob/7.0/configure/RULES_BUILD#L117 – this will attempt to include all of these .d file and if (as above) HDEPENDS_METHOD = COMP then it will try to generate those .d files by running  $(HDEPENDS.c) (a.k.a. the actual compiler), which will generate both the dependency file and the resulting object file at the same time.

Actually we moved away from creating the .d files at the same time as compiling the .c/.cc/.cpp files in Base 3.15, now there we have separate build rules for the .d files — see lines 238-248 vs 257-267 of RULES_BUILD. Make works better if you have only one output file generated by each rule, and there are situations where the build avoids recreating the .d files unnecessarily.

- Andrew


From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of timesir via Tech-talk <tech-talk at aps.anl.gov>
Reply to: timesir <mrlong336 at gmail.com>
Date: Thursday, 25 May 2023 at 16:00
To: "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Subject: makefile question about HDEPENDS

 

Dear community:

%$(DEP):%.c
        @$(RM) $@
        $(HDEPENDS.c) $<

How to understand these makefile statement from epics-base/configure/RULES_BUILD file? Especially what's the meaning of HDEPENDS?



-- 
Complexity is free, it's Simplicity that takes work.

References:
makefile question about HDEPENDS timesir via Tech-talk
Re: makefile question about HDEPENDS Simon Rose via Tech-talk

Navigate by Date:
Prev: Re: makefile question about HDEPENDS Simon Rose via Tech-talk
Next: opc ua Sinclair, John 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  <20232024 
Navigate by Thread:
Prev: Re: makefile question about HDEPENDS Simon Rose via Tech-talk
Next: Re: makefile question about HDEPENDS Andrew Johnson 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  <20232024 
ANJ, 26 May 2023 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·