[Asterisk-Dev] Asterisk make clean and make looping??
(Possible solution)
Robert Webb
asterisk at ropeguru.com
Wed Nov 2 19:15:02 MST 2005
On Wed, 02 Nov 2005 19:30:38 -0600
"Kevin P. Fleming" <kpfleming at digium.com> wrote:
> asterisk at ropeguru.com wrote:
>
>> ifneq ($(wildcard .depend),)
>> include .depend
>> Endif
>>
>> If I comment out the above section, everything seems to
>>run as it
>> should. I can make install, break out of it before it is
>>finished, then
>> make clean and all other make commands seem to work. If
>>I let make
>> install complete, asterisk starts and runs normally.
>>
>> Can someone take a look at the Makefile and try to help
>>me understand
>> the purpose of the above code that I commented out??
>
> That snippet includes a series of rules into the
>Makefile that tell it what files (header files, mostly)
>each source file is dependent on, so that it can properly
>determine what needs to be rebuilt when source files are
>changed. The reason it is included in this fashion is
>because when it does not exist it must be skipped or an
>error will be generated.
Ok, so I understand that section of the Makefile needs to
be there.
So here is an explanation I received from someone on the
Make list and it kind of makes sense to me.
For some reason if the make is interrupted at the point,
and maybe other points, where it is checking for
dependencies such as gcc, etc., when you then run any
other make aftwards, make is setting .depend as an
implicit dependency. Next, the .depend section is executed
which has include/asterisk/version.h: as a dependency. So
the include/asterisk/version.h: section executes and
updates version.h which causes .depend to be out of date
and thus .depend gets updated.
Since in the beginning .depend was made an implicit
dependency, make sees that .depend has been updated and
rescans the makefile causing it to start over again and
keep looping.
Does this make any sense at all??
Robert
More information about the asterisk-dev
mailing list