Quais são os arquivos 'some_name.o.cmd'?

7

Quais são os arquivos some_name.o.cmd que eu vejo no código do kernel do Linux? eles são gerados automaticamente?

    
por Tar 24.02.2015 / 15:01

1 resposta

3

De Configuração e construção de kernel no Linux 2.5 (a seção Estou citando lida com mudanças trazidas em kernels 2.5 / 2.6):

Compiling built-in objects and modules in a single pass, recognizing changed command line arguments [...]

The major performance issue for the kernel build are the invocations of make (most of the time is of course normally spent compiling / linking, but this cost is independent of the build system used). make has to read the local Make- file, the general rules and all the dependencies and figure out the work to be done from there. An obvious way to optimize the performance of the build system is thus to avoid unnecessary invocations. [...]

A more flexible scheme to handle changing command lines within GNU make was created. The actual use is pretty simple, instead of writing the command directly into the command part of the rule, it is instead assigned to the variable cmd_link_l_target and the build system takes care of executing the command as necessary, keeping track of changes to the command line itself. The implementation works as follows. After executing the command, the macro if_changed, records the command line into the file .<target>.cmd. As make is invoked again during a rebuild, it will include those .*.cmd files. As it tries to decide whether to rebuild L_TARGET, it will find FORCE in the prerequisites, which actually forces it to always rerun the command part of the rule.

Basicamente, isso é otimização de compilação do kernel. Esses arquivos são usados para impedir que make trabalhe demais quando desnecessário. Como você pode ler acima, um arquivo some_name.o.cmd estaria lá para acompanhar o que já foi feito / precisa ser feito quando se trata da compilação de some_name.o .

Para obter mais informações, consulte a seção 4.5 do documento que eu vinculei anteriormente ( O que há de novo no kbuild do Linux-2.5 / 2.6? ).

    
por 25.02.2015 / 16:36