Hi Andrew
thanks for your answer.
On 11/03/2015 05:44 PM, Andrew Johnson wrote:
> On 11/03/2015 08:30 AM, Benjamin Franksen wrote:
>> There is one small problem in the build system (probably in all
>> 3.15 versions) and it concerns dependency generation when a
>> generated header file is included. This can cause error messages
>> from gcc when using parallel make, such as
>
>>> ../builtin.c:11:17: fatal error: snl.h: No such file or
>>> directory #include "snl.h"
>>>
>>> compilation terminated.
>
>> The solution is to add -MG to the compiler flags when generating
>> dependencies (see the attached patch). According to the gcc man
>> page, "-MG assumes missing header files are generated files and
>> adds them to the dependency list without raising an error."
>
> Your -MG solution assumes that we only use gcc to build Base, which is
> not true for some targets, and it doesn't always result in the correct
> dependency information being output.
Right, forgot about the other compilers. (Apparently they all support
-MM -MF, I wouldn't have expected that.)
> The correct solution is to make snl.h an explicit dependency of the
> builtin$(DEP) and any similar targets in your Makefile, for example:
>
> ...
> include $(TOP)/configure/RULES
>
> ifdef BASE_3_15
> builtin$(DEP): $(COMMON_DIR)/snl.h
> endif
Yes, more or less. I would rather avoid having to maintain these
dependencies manually, though. I mean, that's the reason we generate the
.d files in the first place.
Anyway, as it turns out, an order dependency suffices in my case, since
the generated snl.h itself never includes anything, so the *.d files
never need to be rebuilt when it changes. And since it's just an order
dependency, it doesn't hurt to declare it for _all_ *.d files:
$(HDEPENDS_FILES): | snl.h
If I haven't overlooked something subtle this should nicely solve the
problem.
> Are you trying to fix Peter Heesterman's sequencer build problem? The
> -MG flag wouldn't help him anyway since he's building on Windows, but
> the above $(DEP): fix should.
No, this is just something that bothered me for a while. The error
messages are harmless as I stated in another message, but still annoying.
Cheers
Ben
--
"Make it so they have to reboot after every typo." ― Scott Adams
Attachment:
signature.asc
Description: OpenPGP digital signature
- Replies:
- Re: EPICS Base R3.15.3-rc1 available Andrew Johnson
- References:
- EPICS Base R3.15.3-rc1 available Ralph Lange
- Re: EPICS Base R3.15.3-rc1 available Benjamin Franksen
- Re: EPICS Base R3.15.3-rc1 available Andrew Johnson
- Navigate by Date:
- Prev:
Re: EPICS Base R3.15.3-rc1 available Andrew Johnson
- Next:
Re: EPICS Base R3.15.3-rc1 available Andrew Johnson
- Index:
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: EPICS Base R3.15.3-rc1 available Andrew Johnson
- Next:
Re: EPICS Base R3.15.3-rc1 available Andrew Johnson
- Index:
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
<2015>
2016
2017
2018
2019
2020
2021
2022
2023
2024
|