changeset 308:6cb3c072be3f

ui_icons.h and icons_inline.h depend on gdk-pixbuf-csource, so add a test for it in configure. Wrap generated headers files with #ifdef/#endif and add a comment related to their auto-generated nature. Make the generation itself quiet, but display a message on error. Make these targets depend on respective Makefile.in.
author zas_
date Fri, 11 Apr 2008 13:07:48 +0000
parents 667e49f52168
children 99139bf9f380
files configure.in src/Makefile.am src/icons/Makefile.am
diffstat 3 files changed, 13 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/configure.in	Fri Apr 11 12:31:32 2008 +0000
+++ b/configure.in	Fri Apr 11 13:07:48 2008 +0000
@@ -19,6 +19,7 @@
 fi
 
 AM_PATH_GTK_2_0(2.4.0,,AC_MSG_ERROR(GTK+ >= 2.4.0 not installed.))
+AC_PATH_PROGS(GDK_PIXBUF_CSOURCE, "gdk-pixbuf-csource")
 
 AC_DEFINE_UNQUOTED(GQ_HELPDIR, "$prefix/share/doc/geeqie-$VERSION", [Location of documentation files])
 AC_DEFINE_UNQUOTED(GQ_HTMLDIR, "$prefix/share/doc/geeqie-$VERSION/html", [Location of html documentation])
--- a/src/Makefile.am	Fri Apr 11 12:31:32 2008 +0000
+++ b/src/Makefile.am	Fri Apr 11 13:07:48 2008 +0000
@@ -36,8 +36,12 @@
 	icon_spinner		$(srcdir)/ui_spinner.png	\
 	icon_tabcomp		$(srcdir)/ui_tabcomp.png
 
-ui_icons.h: $(extra_ICONS)
-	gdk-pixbuf-csource --raw --extern --build-list $(ICON_PAIRS) > ui_icons.h
+ui_icons.h: $(extra_ICONS) Makefile.in
+	@(echo '/* Auto generated file, do not edit */'; echo; \
+	 echo '#ifndef UI_ICONS_H'; \
+	 echo '#define UI_ICONS_H'; echo; \
+	 $(GDK_PIXBUF_CSOURCE) --raw --extern --build-list $(ICON_PAIRS); \
+	 echo '#endif /* UI_ICONS_H */') > $@ || echo "!!! Failed to generate $@ !!!"
 
 ui_spinner.o: ui_icons.h
 
--- a/src/icons/Makefile.am	Fri Apr 11 12:31:32 2008 +0000
+++ b/src/icons/Makefile.am	Fri Apr 11 13:07:48 2008 +0000
@@ -35,8 +35,12 @@
 	icon_tools		$(srcdir)/icon_tools.png	\
 	icon_view		$(srcdir)/icon_view.png
 
-icons_inline.h: $(ICONS_INLINE)
-	gdk-pixbuf-csource --raw --extern --build-list $(ICONS_INLINE_PAIRS) > icons_inline.h
+icons_inline.h: $(ICONS_INLINE) Makefile.in
+	@(echo '/* Auto generated file, do not edit */'; echo; \
+	 echo '#ifndef ICONS_INLINE_H'; \
+	 echo '#define ICONS_INLINE_H'; echo; \
+	 $(GDK_PIXBUF_CSOURCE) --raw --extern --build-list $(ICONS_INLINE_PAIRS); \
+	 echo '#endif /* ICONS_INLINE_H */') > $@ || echo "!!! Failed to generate $@ !!!"
 
 noinst_DATA = icons_inline.h
 CLEANFILES = $(noinst_DATA)