build: replace meson OS detection with variable
[dpdk.git] / buildtools / gen-pmdinfo-cfile.sh
index 565e089..43059cf 100755 (executable)
@@ -6,7 +6,9 @@ arfile=$1
 output=$2
 pmdinfogen=$3
 
-tmp_o=${output%.c.pmd.c}.tmp.o
-
-ar p $arfile > $tmp_o && \
-               $pmdinfogen $tmp_o $output
+# The generated file must not be empty if compiled in pedantic mode
+echo 'static __attribute__((unused)) const char *generator = "'$0'";' > $output
+for ofile in `ar t $arfile` ; do
+       ar p $arfile $ofile | $pmdinfogen - - >> $output 2> /dev/null
+done
+exit 0