1#! /bin/sh
2# SPDX-License-Identifier: BSD-3-Clause
3# Copyright(c) 2017 Intel Corporation
4
5arfile=$1
6output=$2
7pmdinfogen=$3
8
9# The generated file must not be empty if compiled in pedantic mode
10echo 'static __attribute__((unused)) const char *generator = "'$0'";' > $output
11for ofile in `ar t $arfile` ; do
12	ar p $arfile $ofile | $pmdinfogen - - >> $output 2> /dev/null
13done
14exit 0
15