awesome/build-utils/widgetgen.sh
Hans Ulrich Niedermann e719d6d0b6 fix header generators for out-of-source builds
The header generator scripts now work when srcdir!=builddir.

Signed-off-by: Julien Danjou <julien@danjou.info>
2008-01-25 12:10:32 +01:00

20 lines
574 B
Bash
Executable file

#!/bin/sh
top_srcdir="${1-.}"
echo "/* This file is autogenerated by" $(basename $0) "*/"
echo
echo "const name_func_link_t WidgetList[] ="
echo "{"
for file in ${top_srcdir}/widget.h
do
echo " /* $file */"
grep '^WidgetConstructor ' "$file" | cut -d' ' -f2 | cut -d\; -f1 | while read widget
do
shortname=$(echo $widget | cut -d_ -f1)
echo " {\"$shortname\", $widget},"
grep -q "^$shortname" ${top_srcdir}/awesomerc.1.txt || \
echo " WARNING: $uicb NOT documented" >&2
done
done
echo " {NULL, NULL}"
echo "};"