OSDN Git Service

kbuild: fixdep: support concatenated dep files
authorStephen Warren <swarren@nvidia.com>
Wed, 6 Mar 2013 17:27:45 +0000 (10:27 -0700)
committerStephen Warren <swarren@nvidia.com>
Fri, 5 Apr 2013 18:22:58 +0000 (12:22 -0600)
commit2ab8a99661f4ce052bbad064237c441371df8751
tree2d64715534105bc803ad38971195a6e1f51a2951
parentc58299aa87544a590c62bda0bf52b69fa56cb8d5
kbuild: fixdep: support concatenated dep files

The current use-case for fixdep is: a source file is run through a single
processing step, which creates a single dependency file as a side-effect,
which fixdep transforms into the file used by the kernel build process.

In order to transparently run the C pre-processor on device-tree files,
we wish to run both gcc -E and dtc on a source file in a single rule.
This generates two dependency files, which must be transformed together
into the file used by the kernel build process. This change modifies
fixdep so it can process the concatenation of multiple separate input
dependency files, and produce a correct unified output.

The code changes have the slight benefit of transforming the loop in
parse_dep_file() into more of a lexer/tokenizer, with the loop body being
more of a parser. Previously, some of this logic was mixed together
before the loop. I also added some comments, which I hope are useful.

Benchmarking shows that on a cross-compiled ARM tegra_defconfig build,
there is less than 0.5 seconds speed decrease with this change, on top
of a build time of ~2m24s. This is probably within the noise.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Rob Herring <rob.herring@calxeda.com>
scripts/basic/fixdep.c