awesome/build-utils/layoutgen.sh

25 lines
614 B
Bash
Raw Normal View History

2008-01-16 09:02:25 +01:00
#!/bin/sh
top_srcdir="${1-.}"
echo "/* This file is autogenerated by" `basename $0` "*/"
2008-01-16 09:02:25 +01:00
echo
for file in ${top_srcdir}/layouts/*.h
do
shortname=`echo $file | cut -f2- -d/`
echo "#include \"${shortname}\""
done
echo
2008-01-16 09:02:25 +01:00
echo "const name_func_link_t LayoutList[] ="
echo "{"
for file in ${top_srcdir}/layouts/*.h
2008-01-16 09:02:25 +01:00
do
echo " /* $file */"
grep '^layout_t layout_' $file | cut -d' ' -f2 | cut -d\; -f1 | while read layout
2008-01-16 09:02:25 +01:00
do
shortname=`echo $layout | cut -d _ -f2-`
echo " {\"$shortname\", sizeof(\"$shortname\") - 1, $layout},"
2008-01-16 09:02:25 +01:00
done
done
echo " {NULL, 0, NULL}"
2008-01-16 09:02:25 +01:00
echo "};"