Open Source Software Is Green

A few days ago I read post about FOSS being green or not. Since open source is about reusing/improving stuff made by others you could surely say, yes, FOSS is green indeed.

Then I found this, what a better prove !!!

[sourcecode language=”cpp”] gnome_bluetooth_headers_to_scan_for_enums = bluetooth-enums.h

Generate the enums source code, with glib-mkenums:

This is based on the same stuff in pango:

gnome_bluetooth_built_headers = gnome-bluetooth-enum-types.h gnome_bluetooth_built_cfiles = gnome-bluetooth-enum-types.c

gnome-bluetooth-enum-types.h: $(gnome_bluetooth_headers_to_scan_for_enums) Makefile

$(AM_V_GEN) (cd $(srcdir) && glib-mkenums \
        --fhead "#ifndef __GNOME_BLUETOOTH_ENUM_TYPES_H__\n#define __GNOME_BLUETOOTH_ENUM_TYPES_H__\n\n#include \n\nG_BEGIN_DECLS\n" \
        --fprod "/* enumerations from \"@filename@\" */\n" \
        --vhead "GType @enum_name@_get_type (void);\n#define BLUETOOTH_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n"     \
        --ftail "G_END_DECLS\n\n#endif /* __GNOME_BLUETOOTH_ENUM_TYPES_H__ */" \
    $(gnome_bluetooth_headers_to_scan_for_enums)) > $@

gnome-bluetooth-enum-types.c: $(gnome_bluetooth_headers_to_scan_for_enums) Makefile gnome-bluetooth-enum-types.h

$(AM_V_GEN) (cd $(srcdir) && glib-mkenums \
        --fhead "#include \n" \
        --fhead "#include \"gnome-bluetooth-enum-types.h\"\n" \
        --fhead "#include " \
            --fprod "\n/* enumerations from \"@filename@\" */" \
        --vhead "GType\n@enum_name@_get_type (void)\n{\n  static GType etype = 0;\n  if (etype == 0) {\n    static const G@Type@Value values[] = {"     \
        --vprod "      { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
        --vtail "      { 0, NULL, NULL }\n    };\n    etype = g_@type@_register_static (\"@EnumName@\", values);\n  }\n  return etype;\n}\n" \
    $(gnome_bluetooth_headers_to_scan_for_enums)) > $@


I found myself using this, so my comments after this goes:

This is based on the same stuff gnome-bluetooth, which is based on the same stuff in pango