#!/bin/bash # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * # * This source file is part of libspmt. * # * * # * See the file "LICENSE" for the copyright information and for * # * the terms and conditions for copying, distribution and * # * modification of this source file. * # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * source util.sh # $1 enum specification # output on stdout function generate_enums_c { echo "/* end generated prologue */" ls *.enum | while read enum do base=`echo ${enum} | sed 's/\.c//'` awk -f enum.c.awk < ${base} done echo "#endif /* !ENUMS_C */" } function create_private_enums { ls *.enum | while read enum do awk -f enum.h.awk < ${enum} >> private.enums done } function generate_private_h { rm -f private.enums create_private_enums cat private.h | strip_between_markers "${start} enums" "${end} enums" | insert_file_after_marker "${start} enums" private.enums rm -f private.enums } generate_file_and_update_if_different generate_enums_c enums.c generate_file_and_update_if_different generate_private_h private.h