#!/bin/bash

# Author: guan-gm lin <guan-gm.lin@mediatek.com>

salt_file=$1
salt_name=$2
header=$3

if [ ! -f $header ]
then
echo "/*" >> $header
echo " * This file is auto-generated by gen_salt" >> $header
echo " * please do not modify this file manually" >> $header
echo " */" >> $header
fi

echo "#ifndef "$salt_name"_H" >> $header
echo "#define "$salt_name"_H" >> $header
echo "#define $salt_name { \\" >> $header
echo -ne '\t' >> $header
cat $salt_file | hexdump -ve '/1 "0x%02x, "' >> $header
echo "\\" >> $header
echo "}" >> $header
echo "#endif" >> $header
echo -ne '\n' >> $header
