[Freeciv-Dev] Re: (PR#7390) python code generators and BUILT_SOURCES
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: |
undisclosed-recipients: ; |
Subject: |
[Freeciv-Dev] Re: (PR#7390) python code generators and BUILT_SOURCES |
From: |
"Jason Dorje Short" <jdorje@xxxxxxxxxxxxxxxxxxx> |
Date: |
Sat, 7 Feb 2004 10:02:24 -0800 |
Reply-to: |
rt@xxxxxxxxxxx |
<URL: http://rt.freeciv.org/Ticket/Display.html?id=7390 >
Raimar Falke wrote:
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=7390 >
>
> On Fri, Feb 06, 2004 at 06:20:49PM -0800, Jason Dorje Short wrote:
>
>><URL: http://rt.freeciv.org/Ticket/Display.html?id=7390 >
>>
>>Jason Dorje Short wrote:
>>
>>><URL: http://rt.freeciv.org/Ticket/Display.html?id=7390 >
>>>
>>>I ran across
>>>
>>>http://www.gnu.org/software/automake/manual/html_node/Sources.html#Sources
>>>
>>>where it explains dependency calculations and how they affect two-stage
>>>builds.
>>>
>>>It seems to me that a normal build (after a clean cvs checkout) succeeds
>>>only by chance; because the generator happens to be run first. To
>>>formalize this perhaps a BUILT_SOURCES directive should be added.
>>
>>Hmm.
>>
>>Obviously a build of a clean cvs checkout will work, since the built
>>sources are included in it already.
>>
>>What might fail is if you change packets.def and then recompile. If it
>>so happens that (for instance) packets.o is compiled before
>>packets_gen.h, then the compilation may not be correct. A second run of
>>"make" would be required to fix it.
>
>
> The extra dependency:
>
> packets_gen.h packets_gen.c: packets.def generate_packets.py
> ./generate_packets.py
>
> should take care of this. Or do I miss something here?
You do, but so do I.
The dependency that isn't already known is
packets.c : packets_gen.h
since these .c : .h dependencies are generated as a side effect of
compilation (in .deps). So I think if you get a clean checkout, change
packets.def, and then try to compile you _could_ come up with a wrong
compilation because packets.o is compiled before packets_gen.h. Most
likely the linking step will fail. This will be fixed by running "make"
a second time.
But the first time you compile, this dependency will be generated, and
you won't have any more problems.
So this is a very minor issue.
Now if packets_gen.[ch] were taken out of CVS it would become a bigger
issue. And it would be easy to fix:
BUILT_SOURCES = packets_gen.c packets_gen.h
jason
|
|