ui_icons.h and icons_inline.h depend on gdk-pixbuf-csource,
authorLaurent Monin <geeqie@norz.org>
Fri, 11 Apr 2008 13:07:48 +0000 (13:07 +0000)
committerLaurent Monin <geeqie@norz.org>
Fri, 11 Apr 2008 13:07:48 +0000 (13:07 +0000)
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.

configure.in
src/Makefile.am
src/icons/Makefile.am

index 700d7e5..cd8b090 100644 (file)
@@ -19,6 +19,7 @@ else
 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])
index 17836ea..ba3d4d7 100644 (file)
@@ -36,8 +36,12 @@ ICON_PAIRS = \
        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
 
index fbced98..ada6b91 100644 (file)
@@ -35,8 +35,12 @@ ICONS_INLINE_PAIRS = \
        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)