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>
This commit is contained in:
Hans Ulrich Niedermann 2008-01-25 11:49:14 +01:00 committed by Julien Danjou
parent ad28e78d13
commit e719d6d0b6
4 changed files with 12 additions and 9 deletions

View File

@ -66,21 +66,21 @@ BUILT_SOURCES += uicbgen.h
EXTRA_DIST += build-utils/uicbgen.sh EXTRA_DIST += build-utils/uicbgen.sh
uicbgen.h: $(awesome_SOURCES) uicbgen.h: $(awesome_SOURCES)
@echo "generating uicbgen.h from headers file" @echo "generating uicbgen.h from headers file"
$(top_srcdir)/build-utils/uicbgen.sh > uicbgen.h $(top_srcdir)/build-utils/uicbgen.sh "$(top_srcdir)" > uicbgen.h
CLEANFILES += layoutgen.h CLEANFILES += layoutgen.h
BUILT_SOURCES += layoutgen.h BUILT_SOURCES += layoutgen.h
EXTRA_DIST += build-utils/layoutgen.sh EXTRA_DIST += build-utils/layoutgen.sh
layoutgen.h: $(awesome_SOURCES) layoutgen.h: $(awesome_SOURCES)
@echo "generating layoutgen.h from layouts headers file" @echo "generating layoutgen.h from layouts headers file"
$(top_srcdir)/build-utils/layoutgen.sh > layoutgen.h $(top_srcdir)/build-utils/layoutgen.sh "$(top_srcdir)" > layoutgen.h
CLEANFILES += widgetgen.h CLEANFILES += widgetgen.h
BUILT_SOURCES += widgetgen.h BUILT_SOURCES += widgetgen.h
EXTRA_DIST += build-utils/widgetgen.sh EXTRA_DIST += build-utils/widgetgen.sh
widgetgen.h: widget.h widgetgen.h: widget.h
@echo "generating widgetgen.h from widget.h" @echo "generating widgetgen.h from widget.h"
$(top_srcdir)/build-utils/widgetgen.sh > widgetgen.h $(top_srcdir)/build-utils/widgetgen.sh "$(top_srcdir)" > widgetgen.h
if USING_GCC if USING_GCC
# If you are using gcc, and want to deactivate this default set of # If you are using gcc, and want to deactivate this default set of

View File

@ -1,9 +1,10 @@
#!/bin/sh #!/bin/sh
top_srcdir="${1-.}"
echo "/* This file is autogenerated by" $(basename $0) "*/" echo "/* This file is autogenerated by" $(basename $0) "*/"
echo echo
echo "const name_func_link_t LayoutList[] =" echo "const name_func_link_t LayoutList[] ="
echo "{" echo "{"
for file in layouts/*.h for file in ${top_srcdir}/layouts/*.h
do do
echo " /* $file */" echo " /* $file */"
grep '^LayoutArrange layout_' $file | cut -d' ' -f2 | cut -d\; -f1 | while read layout grep '^LayoutArrange layout_' $file | cut -d' ' -f2 | cut -d\; -f1 | while read layout

View File

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

View File

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