numam-dpdk/buildtools/gen-pmdinfo-cfile.sh
Bruce Richardson 45775d7512 drivers: improve pmdinfo generation with meson
Since meson 0.44, changing any file inside a PMD directory (quite
correctly) triggers a full re-run of meson on build, rather than an
incremental build as with earlier versions. This rerun is needed because
we use "grep" in meson to search for files on which to run pmdinfogen, and
changing any of those files means that grep and, therefore meson, needs to
be rerun. [Previous versions of meson did not track this dependency on the
grep command, and so did incremental builds only.]

If, however, we take advantage of pmdinfogen's ability to use stdin and
stdout instead of files, we can instead use a shell script to process an
entire static archive and generate a single .c file from it. This
eliminates the need for grep, and means that changes to a PMD file only
need an incremental build - a significant time saving.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2018-01-30 21:59:00 +01:00

14 lines
248 B
Bash
Executable File

#! /bin/sh
# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2017 Intel Corporation
arfile=$1
output=$2
pmdinfogen=$3
echo > $output
for ofile in `ar t $arfile` ; do
ar p $arfile $ofile | $pmdinfogen - - >> $output 2> /dev/null
done
exit 0