/* makefileintegration.c generated by valac 0.22.1, the Vala compiler
 * generated from makefileintegration.vala, do not modify */

/*
 * This file is part of gedit-code-assistant.
 *
 * Copyright (C) 2011 - Jesse van den Kieboom
 *
 * gedit-code-assistant is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * gedit-code-assistant is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with gedit-code-assistant.  If not, see <http://www.gnu.org/licenses/>.
 */

#include <glib.h>
#include <glib-object.h>
#include <gee.h>
#include <gio/gio.h>
#include "backends/vala/libvalashared.h"
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <gobject/gvaluecollector.h>


#define TYPE_MAKEFILE_INTEGRATION (makefile_integration_get_type ())
#define MAKEFILE_INTEGRATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MAKEFILE_INTEGRATION, MakefileIntegration))
#define MAKEFILE_INTEGRATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MAKEFILE_INTEGRATION, MakefileIntegrationClass))
#define IS_MAKEFILE_INTEGRATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MAKEFILE_INTEGRATION))
#define IS_MAKEFILE_INTEGRATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MAKEFILE_INTEGRATION))
#define MAKEFILE_INTEGRATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MAKEFILE_INTEGRATION, MakefileIntegrationClass))

typedef struct _MakefileIntegration MakefileIntegration;
typedef struct _MakefileIntegrationClass MakefileIntegrationClass;
typedef struct _MakefileIntegrationPrivate MakefileIntegrationPrivate;

#define MAKEFILE_INTEGRATION_TYPE_MAKEFILE (makefile_integration_makefile_get_type ())
#define MAKEFILE_INTEGRATION_MAKEFILE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MAKEFILE_INTEGRATION_TYPE_MAKEFILE, MakefileIntegrationMakefile))
#define MAKEFILE_INTEGRATION_MAKEFILE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MAKEFILE_INTEGRATION_TYPE_MAKEFILE, MakefileIntegrationMakefileClass))
#define MAKEFILE_INTEGRATION_IS_MAKEFILE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MAKEFILE_INTEGRATION_TYPE_MAKEFILE))
#define MAKEFILE_INTEGRATION_IS_MAKEFILE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MAKEFILE_INTEGRATION_TYPE_MAKEFILE))
#define MAKEFILE_INTEGRATION_MAKEFILE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MAKEFILE_INTEGRATION_TYPE_MAKEFILE, MakefileIntegrationMakefileClass))

typedef struct _MakefileIntegrationMakefile MakefileIntegrationMakefile;
typedef struct _MakefileIntegrationMakefileClass MakefileIntegrationMakefileClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _makefile_integration_makefile_unref0(var) ((var == NULL) ? NULL : (var = (makefile_integration_makefile_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))
#define _g_match_info_unref0(var) ((var == NULL) ? NULL : (var = (g_match_info_unref (var), NULL)))
typedef struct _MakefileIntegrationMakefilePrivate MakefileIntegrationMakefilePrivate;

#define MAKEFILE_INTEGRATION_MAKEFILE_TYPE_SOURCE (makefile_integration_makefile_source_get_type ())
#define MAKEFILE_INTEGRATION_MAKEFILE_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MAKEFILE_INTEGRATION_MAKEFILE_TYPE_SOURCE, MakefileIntegrationMakefileSource))
#define MAKEFILE_INTEGRATION_MAKEFILE_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MAKEFILE_INTEGRATION_MAKEFILE_TYPE_SOURCE, MakefileIntegrationMakefileSourceClass))
#define MAKEFILE_INTEGRATION_MAKEFILE_IS_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MAKEFILE_INTEGRATION_MAKEFILE_TYPE_SOURCE))
#define MAKEFILE_INTEGRATION_MAKEFILE_IS_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MAKEFILE_INTEGRATION_MAKEFILE_TYPE_SOURCE))
#define MAKEFILE_INTEGRATION_MAKEFILE_SOURCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MAKEFILE_INTEGRATION_MAKEFILE_TYPE_SOURCE, MakefileIntegrationMakefileSourceClass))

typedef struct _MakefileIntegrationMakefileSource MakefileIntegrationMakefileSource;
typedef struct _MakefileIntegrationMakefileSourceClass MakefileIntegrationMakefileSourceClass;
typedef struct _MakefileIntegrationMakefileSourcePrivate MakefileIntegrationMakefileSourcePrivate;
#define _makefile_integration_makefile_source_unref0(var) ((var == NULL) ? NULL : (var = (makefile_integration_makefile_source_unref (var), NULL)))
typedef struct _MakefileIntegrationMakefileParamSpecSource MakefileIntegrationMakefileParamSpecSource;
typedef struct _MakefileIntegrationParamSpecMakefile MakefileIntegrationParamSpecMakefile;
typedef struct _ParamSpecMakefileIntegration ParamSpecMakefileIntegration;

struct _MakefileIntegration {
	GTypeInstance parent_instance;
	volatile int ref_count;
	MakefileIntegrationPrivate * priv;
};

struct _MakefileIntegrationClass {
	GTypeClass parent_class;
	void (*finalize) (MakefileIntegration *self);
};

struct _MakefileIntegrationPrivate {
	GeeHashMap* d_cache;
	GeeHashMap* d_file_to_makefile;
};

struct _MakefileIntegrationMakefile {
	GTypeInstance parent_instance;
	volatile int ref_count;
	MakefileIntegrationMakefilePrivate * priv;
};

struct _MakefileIntegrationMakefileClass {
	GTypeClass parent_class;
	void (*finalize) (MakefileIntegrationMakefile *self);
};

struct _MakefileIntegrationMakefilePrivate {
	GFile* d_file;
	GeeHashMap* d_sources;
	GTimeVal d_mtime;
	GFileMonitor* d_monitor;
};

struct _MakefileIntegrationMakefileSource {
	GTypeInstance parent_instance;
	volatile int ref_count;
	MakefileIntegrationMakefileSourcePrivate * priv;
	GTimeVal mtime;
	gchar** flags;
	gint flags_length1;
	gint _flags_size_;
};

struct _MakefileIntegrationMakefileSourceClass {
	GTypeClass parent_class;
	void (*finalize) (MakefileIntegrationMakefileSource *self);
};

struct _MakefileIntegrationMakefileParamSpecSource {
	GParamSpec parent_instance;
};

struct _MakefileIntegrationParamSpecMakefile {
	GParamSpec parent_instance;
};

struct _ParamSpecMakefileIntegration {
	GParamSpec parent_instance;
};


static gpointer makefile_integration_parent_class = NULL;
static gpointer makefile_integration_makefile_parent_class = NULL;
static gpointer makefile_integration_makefile_source_parent_class = NULL;

gpointer makefile_integration_ref (gpointer instance);
void makefile_integration_unref (gpointer instance);
GParamSpec* param_spec_makefile_integration (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_makefile_integration (GValue* value, gpointer v_object);
void value_take_makefile_integration (GValue* value, gpointer v_object);
gpointer value_get_makefile_integration (const GValue* value);
GType makefile_integration_get_type (void) G_GNUC_CONST;
static gpointer makefile_integration_makefile_ref (gpointer instance);
static void makefile_integration_makefile_unref (gpointer instance);
static GParamSpec* makefile_integration_param_spec_makefile (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) G_GNUC_UNUSED;
static void makefile_integration_value_set_makefile (GValue* value, gpointer v_object) G_GNUC_UNUSED;
static void makefile_integration_value_take_makefile (GValue* value, gpointer v_object) G_GNUC_UNUSED;
static gpointer makefile_integration_value_get_makefile (const GValue* value) G_GNUC_UNUSED;
static GType makefile_integration_makefile_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
#define MAKEFILE_INTEGRATION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_MAKEFILE_INTEGRATION, MakefileIntegrationPrivate))
enum  {
	MAKEFILE_INTEGRATION_DUMMY_PROPERTY
};
MakefileIntegration* makefile_integration_new (void);
MakefileIntegration* makefile_integration_construct (GType object_type);
static guint _hash_utils_file_hash_gee_hash_data_func (gconstpointer v, gpointer self);
static gboolean _hash_utils_file_equal_gee_equal_data_func (gconstpointer a, gconstpointer b, gpointer self);
gboolean makefile_integration_changed_for_file (MakefileIntegration* self, GFile* f);
static GFile* makefile_integration_makefile_for (MakefileIntegration* self, GFile* f, gboolean tryac);
static gboolean makefile_integration_makefile_up_to_date_for (MakefileIntegrationMakefile* self, GFile* source);
void makefile_integration_dispose (MakefileIntegration* self, GFile* f);
static gboolean makefile_integration_makefile_remove (MakefileIntegrationMakefile* self, GFile* source);
static GFile* makefile_integration_makefile_get_file (MakefileIntegrationMakefile* self);
gchar** makefile_integration_flags_for_file (MakefileIntegration* self, GFile* f, gchar** wd, int* result_length1);
static gchar** makefile_integration_makefile_flags_for_file (MakefileIntegrationMakefile* self, GFile* source, int* result_length1);
static gchar** makefile_integration_targets_from_make (MakefileIntegration* self, GFile* makefile, GFile* source, int* result_length1);
static gchar** makefile_integration_flags_from_targets (MakefileIntegration* self, GFile* makefile, GFile* source, gchar** targets, int targets_length1, int* result_length1);
static gchar** makefile_integration_update_cache (MakefileIntegration* self, GFile* makefile, GFile* f, gchar** flags, int flags_length1, int* result_length1);
static MakefileIntegrationMakefile* makefile_integration_makefile_new (GFile* file);
static MakefileIntegrationMakefile* makefile_integration_makefile_construct (GType object_type, GFile* file);
static void makefile_integration_makefile_add (MakefileIntegrationMakefile* self, GFile* source, gchar** flags, int flags_length1);
static gchar** _vala_array_dup5 (gchar** self, int length);
static GFile* makefile_integration_find_subdir_with_path (MakefileIntegration* self, GFile* parent, const gchar* relpath);
static GFile** _vala_array_dup6 (GFile** self, int length);
static void _vala_array_add3 (GFile*** array, int* length, int* size, GFile* value);
static GFile* makefile_integration_subdir_makefile_for (MakefileIntegration* self, GFile* parent, GFile* f);
static void _vala_array_add4 (gchar*** array, int* length, int* size, gchar* value);
static void _vala_array_add5 (gchar*** array, int* length, int* size, gchar* value);
static void _vala_array_add6 (gchar*** array, int* length, int* size, gchar* value);
static gchar** _vala_array_dup7 (gchar** self, int length);
static gint __lambda2_ (MakefileIntegration* self, const gchar* a, const gchar* b);
static gint ___lambda2__gcompare_data_func (gconstpointer a, gconstpointer b, gpointer self);
static void _vala_array_add7 (gchar*** array, int* length, int* size, gchar* value);
static void _vala_array_add8 (gchar*** array, int* length, int* size, gchar* value);
static gpointer makefile_integration_makefile_source_ref (gpointer instance);
static void makefile_integration_makefile_source_unref (gpointer instance);
static GParamSpec* makefile_integration_makefile_param_spec_source (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) G_GNUC_UNUSED;
static void makefile_integration_makefile_value_set_source (GValue* value, gpointer v_object) G_GNUC_UNUSED;
static void makefile_integration_makefile_value_take_source (GValue* value, gpointer v_object) G_GNUC_UNUSED;
static gpointer makefile_integration_makefile_value_get_source (const GValue* value) G_GNUC_UNUSED;
static GType makefile_integration_makefile_source_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
#define MAKEFILE_INTEGRATION_MAKEFILE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), MAKEFILE_INTEGRATION_TYPE_MAKEFILE, MakefileIntegrationMakefilePrivate))
enum  {
	MAKEFILE_INTEGRATION_MAKEFILE_DUMMY_PROPERTY
};
static void makefile_integration_makefile_update_mtime (MakefileIntegrationMakefile* self);
static void makefile_integration_makefile_on_changed (MakefileIntegrationMakefile* self);
static void _makefile_integration_makefile_on_changed_g_file_monitor_changed (GFileMonitor* _sender, GFile* file, GFile* other_file, GFileMonitorEvent event_type, gpointer self);
static void makefile_integration_makefile_file_mtime (MakefileIntegrationMakefile* self, GFile* f, GTimeVal* result);
static MakefileIntegrationMakefileSource* makefile_integration_makefile_make_source (MakefileIntegrationMakefile* self, gchar** flags, int flags_length1);
static MakefileIntegrationMakefileSource* makefile_integration_makefile_source_new (void);
static MakefileIntegrationMakefileSource* makefile_integration_makefile_source_construct (GType object_type);
static gchar** _vala_array_dup8 (gchar** self, int length);
static void makefile_integration_makefile_dispose (MakefileIntegrationMakefile* self);
static gboolean makefile_integration_makefile_newer (MakefileIntegrationMakefile* self, GTimeVal* t1, GTimeVal* t2);
static gchar** _vala_array_dup9 (gchar** self, int length);
enum  {
	MAKEFILE_INTEGRATION_MAKEFILE_SOURCE_DUMMY_PROPERTY
};
static void makefile_integration_makefile_source_finalize (MakefileIntegrationMakefileSource* obj);
static void makefile_integration_makefile_finalize (MakefileIntegrationMakefile* obj);
static void makefile_integration_finalize (MakefileIntegration* obj);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);


static guint _hash_utils_file_hash_gee_hash_data_func (gconstpointer v, gpointer self) {
	guint result;
	result = hash_utils_file_hash (v);
	return result;
}


static gboolean _hash_utils_file_equal_gee_equal_data_func (gconstpointer a, gconstpointer b, gpointer self) {
	gboolean result;
	result = hash_utils_file_equal (a, b);
	return result;
}


MakefileIntegration* makefile_integration_construct (GType object_type) {
	MakefileIntegration* self = NULL;
	GeeHashMap* _tmp0_ = NULL;
	GeeHashMap* _tmp1_ = NULL;
	self = (MakefileIntegration*) g_type_create_instance (object_type);
	_tmp0_ = gee_hash_map_new (G_TYPE_FILE, (GBoxedCopyFunc) g_object_ref, g_object_unref, MAKEFILE_INTEGRATION_TYPE_MAKEFILE, (GBoxedCopyFunc) makefile_integration_makefile_ref, makefile_integration_makefile_unref, _hash_utils_file_hash_gee_hash_data_func, NULL, NULL, _hash_utils_file_equal_gee_equal_data_func, NULL, NULL, NULL, NULL, NULL);
	_g_object_unref0 (self->priv->d_cache);
	self->priv->d_cache = _tmp0_;
	_tmp1_ = gee_hash_map_new (G_TYPE_FILE, (GBoxedCopyFunc) g_object_ref, g_object_unref, MAKEFILE_INTEGRATION_TYPE_MAKEFILE, (GBoxedCopyFunc) makefile_integration_makefile_ref, makefile_integration_makefile_unref, _hash_utils_file_hash_gee_hash_data_func, NULL, NULL, _hash_utils_file_equal_gee_equal_data_func, NULL, NULL, NULL, NULL, NULL);
	_g_object_unref0 (self->priv->d_file_to_makefile);
	self->priv->d_file_to_makefile = _tmp1_;
	return self;
}


MakefileIntegration* makefile_integration_new (void) {
	return makefile_integration_construct (TYPE_MAKEFILE_INTEGRATION);
}


gboolean makefile_integration_changed_for_file (MakefileIntegration* self, GFile* f) {
	gboolean result = FALSE;
	GFile* makefile = NULL;
	GFile* _tmp0_ = NULL;
	GFile* _tmp1_ = NULL;
	GFile* _tmp2_ = NULL;
	MakefileIntegrationMakefile* m = NULL;
	GeeHashMap* _tmp3_ = NULL;
	GFile* _tmp4_ = NULL;
	gpointer _tmp5_ = NULL;
	MakefileIntegrationMakefile* _tmp6_ = NULL;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (f != NULL, FALSE);
	_tmp0_ = f;
	_tmp1_ = makefile_integration_makefile_for (self, _tmp0_, TRUE);
	makefile = _tmp1_;
	_tmp2_ = makefile;
	if (_tmp2_ == NULL) {
		result = FALSE;
		_g_object_unref0 (makefile);
		return result;
	}
	_tmp3_ = self->priv->d_cache;
	_tmp4_ = makefile;
	_tmp5_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp3_, _tmp4_);
	m = (MakefileIntegrationMakefile*) _tmp5_;
	_tmp6_ = m;
	if (_tmp6_ != NULL) {
		MakefileIntegrationMakefile* _tmp7_ = NULL;
		GFile* _tmp8_ = NULL;
		gboolean _tmp9_ = FALSE;
		_tmp7_ = m;
		_tmp8_ = f;
		_tmp9_ = makefile_integration_makefile_up_to_date_for (_tmp7_, _tmp8_);
		result = _tmp9_;
		_makefile_integration_makefile_unref0 (m);
		_g_object_unref0 (makefile);
		return result;
	}
	result = TRUE;
	_makefile_integration_makefile_unref0 (m);
	_g_object_unref0 (makefile);
	return result;
}


void makefile_integration_dispose (MakefileIntegration* self, GFile* f) {
	MakefileIntegrationMakefile* m = NULL;
	GeeHashMap* _tmp0_ = NULL;
	GFile* _tmp1_ = NULL;
	gpointer _tmp2_ = NULL;
	MakefileIntegrationMakefile* _tmp3_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (f != NULL);
	_tmp0_ = self->priv->d_file_to_makefile;
	_tmp1_ = f;
	_tmp2_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp0_, _tmp1_);
	m = (MakefileIntegrationMakefile*) _tmp2_;
	_tmp3_ = m;
	if (_tmp3_ != NULL) {
		MakefileIntegrationMakefile* _tmp4_ = NULL;
		GFile* _tmp5_ = NULL;
		gboolean _tmp6_ = FALSE;
		GeeHashMap* _tmp11_ = NULL;
		GFile* _tmp12_ = NULL;
		_tmp4_ = m;
		_tmp5_ = f;
		_tmp6_ = makefile_integration_makefile_remove (_tmp4_, _tmp5_);
		if (_tmp6_) {
			GeeHashMap* _tmp7_ = NULL;
			MakefileIntegrationMakefile* _tmp8_ = NULL;
			GFile* _tmp9_ = NULL;
			GFile* _tmp10_ = NULL;
			_tmp7_ = self->priv->d_cache;
			_tmp8_ = m;
			_tmp9_ = makefile_integration_makefile_get_file (_tmp8_);
			_tmp10_ = _tmp9_;
			gee_abstract_map_unset ((GeeAbstractMap*) _tmp7_, _tmp10_, NULL);
		}
		_tmp11_ = self->priv->d_file_to_makefile;
		_tmp12_ = f;
		gee_abstract_map_unset ((GeeAbstractMap*) _tmp11_, _tmp12_, NULL);
	}
	_makefile_integration_makefile_unref0 (m);
}


gchar** makefile_integration_flags_for_file (MakefileIntegration* self, GFile* f, gchar** wd, int* result_length1) {
	gchar* _vala_wd = NULL;
	gchar** result = NULL;
	GFile* makefile = NULL;
	GFile* _tmp0_ = NULL;
	GFile* _tmp1_ = NULL;
	GFile* _tmp2_ = NULL;
	GFile* _tmp4_ = NULL;
	GFile* _tmp5_ = NULL;
	GFile* _tmp6_ = NULL;
	gchar* _tmp7_ = NULL;
	MakefileIntegrationMakefile* m = NULL;
	GeeHashMap* _tmp8_ = NULL;
	GFile* _tmp9_ = NULL;
	gpointer _tmp10_ = NULL;
	MakefileIntegrationMakefile* _tmp11_ = NULL;
	gchar** targets = NULL;
	GFile* _tmp20_ = NULL;
	GFile* _tmp21_ = NULL;
	gint _tmp22_ = 0;
	gchar** _tmp23_ = NULL;
	gint targets_length1 = 0;
	gint _targets_size_ = 0;
	gchar** flags = NULL;
	GFile* _tmp24_ = NULL;
	GFile* _tmp25_ = NULL;
	gchar** _tmp26_ = NULL;
	gint _tmp26__length1 = 0;
	gint _tmp27_ = 0;
	gchar** _tmp28_ = NULL;
	gint flags_length1 = 0;
	gint _flags_size_ = 0;
	GFile* _tmp29_ = NULL;
	GFile* _tmp30_ = NULL;
	gchar** _tmp31_ = NULL;
	gint _tmp31__length1 = 0;
	gint _tmp32_ = 0;
	gchar** _tmp33_ = NULL;
	gchar** _tmp34_ = NULL;
	gint _tmp34__length1 = 0;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (f != NULL, NULL);
	_tmp0_ = f;
	_tmp1_ = makefile_integration_makefile_for (self, _tmp0_, TRUE);
	makefile = _tmp1_;
	_g_free0 (_vala_wd);
	_vala_wd = NULL;
	_tmp2_ = makefile;
	if (_tmp2_ == NULL) {
		gchar** _tmp3_ = NULL;
		gint _tmp3__length1 = 0;
		_tmp3_ = NULL;
		_tmp3__length1 = 0;
		if (result_length1) {
			*result_length1 = _tmp3__length1;
		}
		result = _tmp3_;
		_g_object_unref0 (makefile);
		if (wd) {
			*wd = _vala_wd;
		} else {
			_g_free0 (_vala_wd);
		}
		return result;
	}
	_tmp4_ = makefile;
	_tmp5_ = g_file_get_parent (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = g_file_get_path (_tmp6_);
	_g_free0 (_vala_wd);
	_vala_wd = _tmp7_;
	_g_object_unref0 (_tmp6_);
	_tmp8_ = self->priv->d_cache;
	_tmp9_ = makefile;
	_tmp10_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp8_, _tmp9_);
	m = (MakefileIntegrationMakefile*) _tmp10_;
	_tmp11_ = m;
	if (_tmp11_ != NULL) {
		MakefileIntegrationMakefile* _tmp12_ = NULL;
		GFile* _tmp13_ = NULL;
		gboolean _tmp14_ = FALSE;
		_tmp12_ = m;
		_tmp13_ = f;
		_tmp14_ = makefile_integration_makefile_up_to_date_for (_tmp12_, _tmp13_);
		if (_tmp14_) {
			MakefileIntegrationMakefile* _tmp15_ = NULL;
			GFile* _tmp16_ = NULL;
			gint _tmp17_ = 0;
			gchar** _tmp18_ = NULL;
			gchar** _tmp19_ = NULL;
			gint _tmp19__length1 = 0;
			_tmp15_ = m;
			_tmp16_ = f;
			_tmp18_ = makefile_integration_makefile_flags_for_file (_tmp15_, _tmp16_, &_tmp17_);
			_tmp19_ = _tmp18_;
			_tmp19__length1 = _tmp17_;
			if (result_length1) {
				*result_length1 = _tmp19__length1;
			}
			result = _tmp19_;
			_makefile_integration_makefile_unref0 (m);
			_g_object_unref0 (makefile);
			if (wd) {
				*wd = _vala_wd;
			} else {
				_g_free0 (_vala_wd);
			}
			return result;
		}
	}
	_tmp20_ = makefile;
	_tmp21_ = f;
	_tmp23_ = makefile_integration_targets_from_make (self, _tmp20_, _tmp21_, &_tmp22_);
	targets = _tmp23_;
	targets_length1 = _tmp22_;
	_targets_size_ = targets_length1;
	_tmp24_ = makefile;
	_tmp25_ = f;
	_tmp26_ = targets;
	_tmp26__length1 = targets_length1;
	_tmp28_ = makefile_integration_flags_from_targets (self, _tmp24_, _tmp25_, _tmp26_, _tmp26__length1, &_tmp27_);
	flags = _tmp28_;
	flags_length1 = _tmp27_;
	_flags_size_ = flags_length1;
	_tmp29_ = makefile;
	_tmp30_ = f;
	_tmp31_ = flags;
	_tmp31__length1 = flags_length1;
	_tmp33_ = makefile_integration_update_cache (self, _tmp29_, _tmp30_, _tmp31_, _tmp31__length1, &_tmp32_);
	_tmp34_ = _tmp33_;
	_tmp34__length1 = _tmp32_;
	if (result_length1) {
		*result_length1 = _tmp34__length1;
	}
	result = _tmp34_;
	flags = (_vala_array_free (flags, flags_length1, (GDestroyNotify) g_free), NULL);
	targets = (_vala_array_free (targets, targets_length1, (GDestroyNotify) g_free), NULL);
	_makefile_integration_makefile_unref0 (m);
	_g_object_unref0 (makefile);
	if (wd) {
		*wd = _vala_wd;
	} else {
		_g_free0 (_vala_wd);
	}
	return result;
}


static gchar** _vala_array_dup5 (gchar** self, int length) {
	gchar** result;
	int i;
	result = g_new0 (gchar*, length + 1);
	for (i = 0; i < length; i++) {
		gchar* _tmp0_ = NULL;
		_tmp0_ = g_strdup (self[i]);
		result[i] = _tmp0_;
	}
	return result;
}


static gchar** makefile_integration_update_cache (MakefileIntegration* self, GFile* makefile, GFile* f, gchar** flags, int flags_length1, int* result_length1) {
	gchar** result = NULL;
	MakefileIntegrationMakefile* m = NULL;
	GeeHashMap* _tmp0_ = NULL;
	GFile* _tmp1_ = NULL;
	gpointer _tmp2_ = NULL;
	MakefileIntegrationMakefile* _tmp3_ = NULL;
	MakefileIntegrationMakefile* _tmp9_ = NULL;
	GFile* _tmp10_ = NULL;
	gchar** _tmp11_ = NULL;
	gint _tmp11__length1 = 0;
	GeeHashMap* _tmp12_ = NULL;
	GFile* _tmp13_ = NULL;
	MakefileIntegrationMakefile* _tmp14_ = NULL;
	gchar** _tmp15_ = NULL;
	gint _tmp15__length1 = 0;
	gchar** _tmp16_ = NULL;
	gint _tmp16__length1 = 0;
	gchar** _tmp17_ = NULL;
	gint _tmp17__length1 = 0;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (makefile != NULL, NULL);
	g_return_val_if_fail (f != NULL, NULL);
	_tmp0_ = self->priv->d_cache;
	_tmp1_ = makefile;
	_tmp2_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp0_, _tmp1_);
	m = (MakefileIntegrationMakefile*) _tmp2_;
	_tmp3_ = m;
	if (_tmp3_ == NULL) {
		GFile* _tmp4_ = NULL;
		MakefileIntegrationMakefile* _tmp5_ = NULL;
		GeeHashMap* _tmp6_ = NULL;
		GFile* _tmp7_ = NULL;
		MakefileIntegrationMakefile* _tmp8_ = NULL;
		_tmp4_ = makefile;
		_tmp5_ = makefile_integration_makefile_new (_tmp4_);
		_makefile_integration_makefile_unref0 (m);
		m = _tmp5_;
		_tmp6_ = self->priv->d_cache;
		_tmp7_ = makefile;
		_tmp8_ = m;
		gee_abstract_map_set ((GeeAbstractMap*) _tmp6_, _tmp7_, _tmp8_);
	}
	_tmp9_ = m;
	_tmp10_ = f;
	_tmp11_ = flags;
	_tmp11__length1 = flags_length1;
	makefile_integration_makefile_add (_tmp9_, _tmp10_, _tmp11_, _tmp11__length1);
	_tmp12_ = self->priv->d_file_to_makefile;
	_tmp13_ = f;
	_tmp14_ = m;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp12_, _tmp13_, _tmp14_);
	_tmp15_ = flags;
	_tmp15__length1 = flags_length1;
	_tmp16_ = (_tmp15_ != NULL) ? _vala_array_dup5 (_tmp15_, _tmp15__length1) : ((gpointer) _tmp15_);
	_tmp16__length1 = _tmp15__length1;
	_tmp17_ = _tmp16_;
	_tmp17__length1 = _tmp16__length1;
	if (result_length1) {
		*result_length1 = _tmp17__length1;
	}
	result = _tmp17_;
	_makefile_integration_makefile_unref0 (m);
	return result;
}


static gpointer _g_object_ref0 (gpointer self) {
	return self ? g_object_ref (self) : NULL;
}


static GFile** _vala_array_dup6 (GFile** self, int length) {
	GFile** result;
	int i;
	result = g_new0 (GFile*, length + 1);
	for (i = 0; i < length; i++) {
		GFile* _tmp0_ = NULL;
		_tmp0_ = _g_object_ref0 (self[i]);
		result[i] = _tmp0_;
	}
	return result;
}


static void _vala_array_add3 (GFile*** array, int* length, int* size, GFile* value) {
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GFile*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}


static GFile* makefile_integration_find_subdir_with_path (MakefileIntegration* self, GFile* parent, const gchar* relpath) {
	GFile* result = NULL;
	GFile** dirs = NULL;
	GFile* _tmp0_ = NULL;
	GFile* _tmp1_ = NULL;
	GFile** _tmp2_ = NULL;
	gint dirs_length1 = 0;
	gint _dirs_size_ = 0;
	GError * _inner_error_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (parent != NULL, NULL);
	g_return_val_if_fail (relpath != NULL, NULL);
	_tmp0_ = parent;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_tmp2_ = g_new0 (GFile*, 1 + 1);
	_tmp2_[0] = _tmp1_;
	dirs = _tmp2_;
	dirs_length1 = 1;
	_dirs_size_ = dirs_length1;
	while (TRUE) {
		GFile** _tmp3_ = NULL;
		gint _tmp3__length1 = 0;
		GFile* d = NULL;
		GFile** _tmp4_ = NULL;
		gint _tmp4__length1 = 0;
		GFile* _tmp5_ = NULL;
		GFile* _tmp6_ = NULL;
		GFile** _tmp7_ = NULL;
		gint _tmp7__length1 = 0;
		GFile** _tmp8_ = NULL;
		gint _tmp8__length1 = 0;
		GFile** _tmp9_ = NULL;
		gint _tmp9__length1 = 0;
		GFileEnumerator* iter = NULL;
		GFileInfo* info = NULL;
		_tmp3_ = dirs;
		_tmp3__length1 = dirs_length1;
		if (!(_tmp3__length1 != 0)) {
			break;
		}
		_tmp4_ = dirs;
		_tmp4__length1 = dirs_length1;
		_tmp5_ = _tmp4_[0];
		_tmp6_ = _g_object_ref0 (_tmp5_);
		d = _tmp6_;
		_tmp7_ = dirs;
		_tmp7__length1 = dirs_length1;
		_tmp8_ = dirs;
		_tmp8__length1 = dirs_length1;
		_tmp9_ = ((_tmp7_ + 1) != NULL) ? _vala_array_dup6 (_tmp7_ + 1, _tmp8__length1 - 1) : ((gpointer) (_tmp7_ + 1));
		_tmp9__length1 = _tmp8__length1 - 1;
		dirs = (_vala_array_free (dirs, dirs_length1, (GDestroyNotify) g_object_unref), NULL);
		dirs = _tmp9_;
		dirs_length1 = _tmp9__length1;
		_dirs_size_ = dirs_length1;
		{
			gchar* attrs = NULL;
			gchar* _tmp10_ = NULL;
			GFileEnumerator* _tmp11_ = NULL;
			GFile* _tmp12_ = NULL;
			const gchar* _tmp13_ = NULL;
			GFileEnumerator* _tmp14_ = NULL;
			_tmp10_ = g_strdup (G_FILE_ATTRIBUTE_STANDARD_NAME "," G_FILE_ATTRIBUTE_STANDARD_TYPE);
			attrs = _tmp10_;
			_tmp12_ = d;
			_tmp13_ = attrs;
			_tmp14_ = g_file_enumerate_children (_tmp12_, _tmp13_, G_FILE_QUERY_INFO_NONE, NULL, &_inner_error_);
			_tmp11_ = _tmp14_;
			if (_inner_error_ != NULL) {
				_g_free0 (attrs);
				goto __catch17_g_error;
			}
			_g_object_unref0 (iter);
			iter = _tmp11_;
			_g_free0 (attrs);
		}
		goto __finally17;
		__catch17_g_error:
		{
			g_clear_error (&_inner_error_);
			_inner_error_ = NULL;
			_g_object_unref0 (iter);
			_g_object_unref0 (d);
			continue;
		}
		__finally17:
		if (_inner_error_ != NULL) {
			_g_object_unref0 (iter);
			_g_object_unref0 (d);
			dirs = (_vala_array_free (dirs, dirs_length1, (GDestroyNotify) g_object_unref), NULL);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return NULL;
		}
		{
			while (TRUE) {
				GFileInfo* _tmp15_ = NULL;
				GFileEnumerator* _tmp16_ = NULL;
				GFileInfo* _tmp17_ = NULL;
				GFileInfo* _tmp18_ = NULL;
				GFileInfo* _tmp19_ = NULL;
				GFileType _tmp20_ = 0;
				_tmp16_ = iter;
				_tmp17_ = g_file_enumerator_next_file (_tmp16_, NULL, &_inner_error_);
				_tmp15_ = _tmp17_;
				if (_inner_error_ != NULL) {
					goto __catch18_g_error;
				}
				_g_object_unref0 (info);
				info = _tmp15_;
				_tmp18_ = info;
				if (!(_tmp18_ != NULL)) {
					break;
				}
				_tmp19_ = info;
				_tmp20_ = g_file_info_get_file_type (_tmp19_);
				if (_tmp20_ == G_FILE_TYPE_DIRECTORY) {
					GFile* dir = NULL;
					GFileEnumerator* _tmp21_ = NULL;
					GFileInfo* _tmp22_ = NULL;
					GFile* _tmp23_ = NULL;
					GFile* child = NULL;
					GFile* _tmp24_ = NULL;
					const gchar* _tmp25_ = NULL;
					GFile* _tmp26_ = NULL;
					GFile* _tmp27_ = NULL;
					gboolean _tmp28_ = FALSE;
					GFile** _tmp32_ = NULL;
					gint _tmp32__length1 = 0;
					GFile* _tmp33_ = NULL;
					GFile* _tmp34_ = NULL;
					_tmp21_ = iter;
					_tmp22_ = info;
					_tmp23_ = g_file_enumerator_get_child (_tmp21_, _tmp22_);
					dir = _tmp23_;
					_tmp24_ = dir;
					_tmp25_ = relpath;
					_tmp26_ = g_file_get_child (_tmp24_, _tmp25_);
					child = _tmp26_;
					_tmp27_ = child;
					_tmp28_ = g_file_query_exists (_tmp27_, NULL);
					if (_tmp28_) {
						GFile* mf = NULL;
						GFile* _tmp29_ = NULL;
						GFile* _tmp30_ = NULL;
						GFile* _tmp31_ = NULL;
						_tmp29_ = child;
						_tmp30_ = makefile_integration_makefile_for (self, _tmp29_, FALSE);
						mf = _tmp30_;
						_tmp31_ = mf;
						if (_tmp31_ != NULL) {
							result = mf;
							_g_object_unref0 (child);
							_g_object_unref0 (dir);
							_g_object_unref0 (info);
							_g_object_unref0 (iter);
							_g_object_unref0 (d);
							dirs = (_vala_array_free (dirs, dirs_length1, (GDestroyNotify) g_object_unref), NULL);
							return result;
						}
						_g_object_unref0 (mf);
					}
					_tmp32_ = dirs;
					_tmp32__length1 = dirs_length1;
					_tmp33_ = dir;
					_tmp34_ = _g_object_ref0 (_tmp33_);
					_vala_array_add3 (&dirs, &dirs_length1, &_dirs_size_, _tmp34_);
					_g_object_unref0 (child);
					_g_object_unref0 (dir);
				}
			}
		}
		goto __finally18;
		__catch18_g_error:
		{
			g_clear_error (&_inner_error_);
			_inner_error_ = NULL;
			_g_object_unref0 (info);
			_g_object_unref0 (iter);
			_g_object_unref0 (d);
			continue;
		}
		__finally18:
		if (_inner_error_ != NULL) {
			_g_object_unref0 (info);
			_g_object_unref0 (iter);
			_g_object_unref0 (d);
			dirs = (_vala_array_free (dirs, dirs_length1, (GDestroyNotify) g_object_unref), NULL);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return NULL;
		}
		_g_object_unref0 (info);
		_g_object_unref0 (iter);
		_g_object_unref0 (d);
	}
	result = NULL;
	dirs = (_vala_array_free (dirs, dirs_length1, (GDestroyNotify) g_object_unref), NULL);
	return result;
}


static GFile* makefile_integration_subdir_makefile_for (MakefileIntegration* self, GFile* parent, GFile* f) {
	GFile* result = NULL;
	gchar* relpath = NULL;
	GFile* _tmp0_ = NULL;
	GFile* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
	gchar* _tmp4_ = NULL;
	gchar* _tmp5_ = NULL;
	GFile* _tmp6_ = NULL;
	GFile* _tmp7_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (parent != NULL, NULL);
	g_return_val_if_fail (f != NULL, NULL);
	_tmp0_ = parent;
	_tmp1_ = f;
	_tmp2_ = g_file_get_relative_path (_tmp0_, _tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = g_path_get_dirname (_tmp3_);
	_tmp5_ = _tmp4_;
	_g_free0 (_tmp3_);
	relpath = _tmp5_;
	_tmp6_ = parent;
	_tmp7_ = makefile_integration_find_subdir_with_path (self, _tmp6_, relpath);
	result = _tmp7_;
	_g_free0 (relpath);
	return result;
}


static GFile* makefile_integration_makefile_for (MakefileIntegration* self, GFile* f, gboolean tryac) {
	GFile* result = NULL;
	MakefileIntegrationMakefile* fromcache = NULL;
	GeeHashMap* _tmp0_ = NULL;
	GFile* _tmp1_ = NULL;
	gpointer _tmp2_ = NULL;
	MakefileIntegrationMakefile* _tmp3_ = NULL;
	GFile* parent = NULL;
	GFile* _tmp8_ = NULL;
	GFile* _tmp9_ = NULL;
	gchar** tocheck = NULL;
	gchar* _tmp10_ = NULL;
	gchar* _tmp11_ = NULL;
	gchar* _tmp12_ = NULL;
	gchar** _tmp13_ = NULL;
	gint tocheck_length1 = 0;
	gint _tocheck_size_ = 0;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (f != NULL, NULL);
	_tmp0_ = self->priv->d_file_to_makefile;
	_tmp1_ = f;
	_tmp2_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp0_, _tmp1_);
	fromcache = (MakefileIntegrationMakefile*) _tmp2_;
	_tmp3_ = fromcache;
	if (_tmp3_ != NULL) {
		MakefileIntegrationMakefile* _tmp4_ = NULL;
		GFile* _tmp5_ = NULL;
		GFile* _tmp6_ = NULL;
		GFile* _tmp7_ = NULL;
		_tmp4_ = fromcache;
		_tmp5_ = makefile_integration_makefile_get_file (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp7_ = _g_object_ref0 (_tmp6_);
		result = _tmp7_;
		_makefile_integration_makefile_unref0 (fromcache);
		return result;
	}
	_tmp8_ = f;
	_tmp9_ = g_file_get_parent (_tmp8_);
	parent = _tmp9_;
	_tmp10_ = g_strdup ("configure.ac");
	_tmp11_ = g_strdup ("configure.in");
	_tmp12_ = g_strdup ("configure");
	_tmp13_ = g_new0 (gchar*, 3 + 1);
	_tmp13_[0] = _tmp10_;
	_tmp13_[1] = _tmp11_;
	_tmp13_[2] = _tmp12_;
	tocheck = _tmp13_;
	tocheck_length1 = 3;
	_tocheck_size_ = tocheck_length1;
	while (TRUE) {
		GFile* _tmp14_ = NULL;
		GFile* makefile = NULL;
		GFile* _tmp15_ = NULL;
		GFile* _tmp16_ = NULL;
		GFile* _tmp17_ = NULL;
		gboolean _tmp18_ = FALSE;
		gchar** _tmp19_ = NULL;
		gint _tmp19__length1 = 0;
		GFile* _tmp30_ = NULL;
		GFile* _tmp31_ = NULL;
		_tmp14_ = parent;
		if (!(_tmp14_ != NULL)) {
			break;
		}
		_tmp15_ = parent;
		_tmp16_ = g_file_get_child (_tmp15_, "Makefile");
		makefile = _tmp16_;
		_tmp17_ = makefile;
		_tmp18_ = g_file_query_exists (_tmp17_, NULL);
		if (_tmp18_) {
			result = makefile;
			tocheck = (_vala_array_free (tocheck, tocheck_length1, (GDestroyNotify) g_free), NULL);
			_g_object_unref0 (parent);
			_makefile_integration_makefile_unref0 (fromcache);
			return result;
		}
		_tmp19_ = tocheck;
		_tmp19__length1 = tocheck_length1;
		{
			gchar** c_collection = NULL;
			gint c_collection_length1 = 0;
			gint _c_collection_size_ = 0;
			gint c_it = 0;
			c_collection = _tmp19_;
			c_collection_length1 = _tmp19__length1;
			for (c_it = 0; c_it < _tmp19__length1; c_it = c_it + 1) {
				gchar* _tmp20_ = NULL;
				gchar* c = NULL;
				_tmp20_ = g_strdup (c_collection[c_it]);
				c = _tmp20_;
				{
					GFile* cc = NULL;
					GFile* _tmp21_ = NULL;
					const gchar* _tmp22_ = NULL;
					GFile* _tmp23_ = NULL;
					GFile* _tmp24_ = NULL;
					gboolean _tmp25_ = FALSE;
					_tmp21_ = parent;
					_tmp22_ = c;
					_tmp23_ = g_file_get_child (_tmp21_, _tmp22_);
					cc = _tmp23_;
					_tmp24_ = cc;
					_tmp25_ = g_file_query_exists (_tmp24_, NULL);
					if (_tmp25_) {
						GFile* ret = NULL;
						GFile* _tmp26_ = NULL;
						GFile* _tmp27_ = NULL;
						GFile* _tmp28_ = NULL;
						GFile* _tmp29_ = NULL;
						_tmp26_ = parent;
						_tmp27_ = f;
						_tmp28_ = makefile_integration_subdir_makefile_for (self, _tmp26_, _tmp27_);
						ret = _tmp28_;
						_tmp29_ = ret;
						if (_tmp29_ != NULL) {
							result = ret;
							_g_object_unref0 (cc);
							_g_free0 (c);
							_g_object_unref0 (makefile);
							tocheck = (_vala_array_free (tocheck, tocheck_length1, (GDestroyNotify) g_free), NULL);
							_g_object_unref0 (parent);
							_makefile_integration_makefile_unref0 (fromcache);
							return result;
						}
						_g_object_unref0 (ret);
						_g_object_unref0 (cc);
						_g_free0 (c);
						break;
					}
					_g_object_unref0 (cc);
					_g_free0 (c);
				}
			}
		}
		_tmp30_ = parent;
		_tmp31_ = g_file_get_parent (_tmp30_);
		_g_object_unref0 (parent);
		parent = _tmp31_;
		_g_object_unref0 (makefile);
	}
	result = NULL;
	tocheck = (_vala_array_free (tocheck, tocheck_length1, (GDestroyNotify) g_free), NULL);
	_g_object_unref0 (parent);
	_makefile_integration_makefile_unref0 (fromcache);
	return result;
}


static void _vala_array_add4 (gchar*** array, int* length, int* size, gchar* value) {
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}


static gchar string_get (const gchar* self, glong index) {
	gchar result = '\0';
	glong _tmp0_ = 0L;
	gchar _tmp1_ = '\0';
	g_return_val_if_fail (self != NULL, '\0');
	_tmp0_ = index;
	_tmp1_ = ((gchar*) self)[_tmp0_];
	result = _tmp1_;
	return result;
}


static void _vala_array_add5 (gchar*** array, int* length, int* size, gchar* value) {
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}


static void _vala_array_add6 (gchar*** array, int* length, int* size, gchar* value) {
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}


static gchar** _vala_array_dup7 (gchar** self, int length) {
	gchar** result;
	int i;
	result = g_new0 (gchar*, length + 1);
	for (i = 0; i < length; i++) {
		gchar* _tmp0_ = NULL;
		_tmp0_ = g_strdup (self[i]);
		result[i] = _tmp0_;
	}
	return result;
}


static gint __lambda2_ (MakefileIntegration* self, const gchar* a, const gchar* b) {
	gint result = 0;
	gboolean sa = FALSE;
	const gchar* _tmp0_ = NULL;
	gboolean _tmp1_ = FALSE;
	gboolean sb = FALSE;
	const gchar* _tmp2_ = NULL;
	gboolean _tmp3_ = FALSE;
	gboolean _tmp4_ = FALSE;
	gboolean _tmp5_ = FALSE;
	gint _tmp6_ = 0;
	gboolean _tmp7_ = FALSE;
	gint _tmp8_ = 0;
	g_return_val_if_fail (a != NULL, 0);
	g_return_val_if_fail (b != NULL, 0);
	_tmp0_ = a;
	_tmp1_ = g_str_has_suffix (_tmp0_, ".stamp");
	sa = _tmp1_;
	_tmp2_ = b;
	_tmp3_ = g_str_has_suffix (_tmp2_, ".stamp");
	sb = _tmp3_;
	_tmp4_ = sa;
	_tmp5_ = sb;
	if (_tmp4_ == _tmp5_) {
		result = 0;
		return result;
	}
	_tmp7_ = sa;
	if (_tmp7_) {
		_tmp6_ = -1;
	} else {
		_tmp6_ = 1;
	}
	_tmp8_ = _tmp6_;
	result = _tmp8_;
	return result;
}


static gint ___lambda2__gcompare_data_func (gconstpointer a, gconstpointer b, gpointer self) {
	gint result;
	result = __lambda2_ (self, a, b);
	return result;
}


static gchar** makefile_integration_targets_from_make (MakefileIntegration* self, GFile* makefile, GFile* source, int* result_length1) {
	gchar** result = NULL;
	GFile* wd = NULL;
	GFile* _tmp0_ = NULL;
	GFile* _tmp1_ = NULL;
	gchar* relpath = NULL;
	GFile* _tmp2_ = NULL;
	GFile* _tmp3_ = NULL;
	gchar* _tmp4_ = NULL;
	gchar** lookfor = NULL;
	GFile* _tmp5_ = NULL;
	GFile* _tmp6_ = NULL;
	gchar* _tmp7_ = NULL;
	gchar** _tmp8_ = NULL;
	gint lookfor_length1 = 0;
	gint _lookfor_size_ = 0;
	gchar* bname = NULL;
	GFile* _tmp9_ = NULL;
	gchar* _tmp10_ = NULL;
	const gchar* _tmp11_ = NULL;
	const gchar* _tmp12_ = NULL;
	gchar** args = NULL;
	gchar* _tmp16_ = NULL;
	gchar* _tmp17_ = NULL;
	gchar* _tmp18_ = NULL;
	gchar* _tmp19_ = NULL;
	gchar** _tmp20_ = NULL;
	gint args_length1 = 0;
	gint _args_size_ = 0;
	gchar* outstr = NULL;
	gchar** targets = NULL;
	gchar** _tmp28_ = NULL;
	gint targets_length1 = 0;
	gint _targets_size_ = 0;
	GeeHashSet* found = NULL;
	GeeHashSet* _tmp29_ = NULL;
	GeeArrayList* sorted = NULL;
	gchar** _tmp84_ = NULL;
	gint _tmp84__length1 = 0;
	gchar** _tmp85_ = NULL;
	gint _tmp85__length1 = 0;
	GeeArrayList* _tmp86_ = NULL;
	GeeArrayList* _tmp87_ = NULL;
	GeeArrayList* _tmp88_ = NULL;
	gint _tmp89_ = 0;
	gpointer* _tmp90_ = NULL;
	gchar** _tmp91_ = NULL;
	gint _tmp91__length1 = 0;
	GError * _inner_error_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (makefile != NULL, NULL);
	g_return_val_if_fail (source != NULL, NULL);
	_tmp0_ = makefile;
	_tmp1_ = g_file_get_parent (_tmp0_);
	wd = _tmp1_;
	_tmp2_ = wd;
	_tmp3_ = source;
	_tmp4_ = g_file_get_relative_path (_tmp2_, _tmp3_);
	relpath = _tmp4_;
	_tmp5_ = wd;
	_tmp6_ = source;
	_tmp7_ = g_file_get_relative_path (_tmp5_, _tmp6_);
	_tmp8_ = g_new0 (gchar*, 1 + 1);
	_tmp8_[0] = _tmp7_;
	lookfor = _tmp8_;
	lookfor_length1 = 1;
	_lookfor_size_ = lookfor_length1;
	_tmp9_ = source;
	_tmp10_ = g_file_get_basename (_tmp9_);
	bname = _tmp10_;
	_tmp11_ = bname;
	_tmp12_ = relpath;
	if (g_strcmp0 (_tmp11_, _tmp12_) != 0) {
		gchar** _tmp13_ = NULL;
		gint _tmp13__length1 = 0;
		const gchar* _tmp14_ = NULL;
		gchar* _tmp15_ = NULL;
		_tmp13_ = lookfor;
		_tmp13__length1 = lookfor_length1;
		_tmp14_ = bname;
		_tmp15_ = g_strdup (_tmp14_);
		_vala_array_add4 (&lookfor, &lookfor_length1, &_lookfor_size_, _tmp15_);
	}
	_tmp16_ = g_strdup ("make");
	_tmp17_ = g_strdup ("-p");
	_tmp18_ = g_strdup ("-n");
	_tmp19_ = g_strdup ("-s");
	_tmp20_ = g_new0 (gchar*, 5 + 1);
	_tmp20_[0] = _tmp16_;
	_tmp20_[1] = _tmp17_;
	_tmp20_[2] = _tmp18_;
	_tmp20_[3] = _tmp19_;
	_tmp20_[4] = NULL;
	args = _tmp20_;
	args_length1 = 5;
	_args_size_ = args_length1;
	{
		GFile* _tmp21_ = NULL;
		gchar* _tmp22_ = NULL;
		gchar* _tmp23_ = NULL;
		gchar** _tmp24_ = NULL;
		gint _tmp24__length1 = 0;
		gchar* _tmp25_ = NULL;
		_tmp21_ = wd;
		_tmp22_ = g_file_get_path (_tmp21_);
		_tmp23_ = _tmp22_;
		_tmp24_ = args;
		_tmp24__length1 = args_length1;
		g_spawn_sync (_tmp23_, _tmp24_, NULL, G_SPAWN_SEARCH_PATH | G_SPAWN_STDERR_TO_DEV_NULL, NULL, NULL, &_tmp25_, NULL, NULL, &_inner_error_);
		_g_free0 (outstr);
		outstr = _tmp25_;
		_g_free0 (_tmp23_);
		if (_inner_error_ != NULL) {
			if (_inner_error_->domain == G_SPAWN_ERROR) {
				goto __catch19_g_spawn_error;
			}
			_g_free0 (outstr);
			args = (_vala_array_free (args, args_length1, (GDestroyNotify) g_free), NULL);
			_g_free0 (bname);
			lookfor = (_vala_array_free (lookfor, lookfor_length1, (GDestroyNotify) g_free), NULL);
			_g_free0 (relpath);
			_g_object_unref0 (wd);
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return NULL;
		}
	}
	goto __finally19;
	__catch19_g_spawn_error:
	{
		GError* e = NULL;
		gchar** _tmp26_ = NULL;
		gchar** _tmp27_ = NULL;
		gint _tmp27__length1 = 0;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp26_ = g_new0 (gchar*, 0 + 1);
		_tmp27_ = _tmp26_;
		_tmp27__length1 = 0;
		if (result_length1) {
			*result_length1 = _tmp27__length1;
		}
		result = _tmp27_;
		_g_error_free0 (e);
		_g_free0 (outstr);
		args = (_vala_array_free (args, args_length1, (GDestroyNotify) g_free), NULL);
		_g_free0 (bname);
		lookfor = (_vala_array_free (lookfor, lookfor_length1, (GDestroyNotify) g_free), NULL);
		_g_free0 (relpath);
		_g_object_unref0 (wd);
		return result;
	}
	__finally19:
	if (_inner_error_ != NULL) {
		_g_free0 (outstr);
		args = (_vala_array_free (args, args_length1, (GDestroyNotify) g_free), NULL);
		_g_free0 (bname);
		lookfor = (_vala_array_free (lookfor, lookfor_length1, (GDestroyNotify) g_free), NULL);
		_g_free0 (relpath);
		_g_object_unref0 (wd);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return NULL;
	}
	_tmp28_ = g_new0 (gchar*, 0 + 1);
	targets = _tmp28_;
	targets_length1 = 0;
	_targets_size_ = targets_length1;
	_tmp29_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL, NULL, NULL, NULL);
	found = _tmp29_;
	while (TRUE) {
		gchar** _tmp30_ = NULL;
		gint _tmp30__length1 = 0;
		gchar* relookfor = NULL;
		gchar** _tmp43_ = NULL;
		gint _tmp43__length1 = 0;
		gchar* _tmp44_ = NULL;
		gchar** _tmp45_ = NULL;
		GRegex* reg = NULL;
		GMatchInfo* info = NULL;
		GRegex* _tmp55_ = NULL;
		const gchar* _tmp56_ = NULL;
		GMatchInfo* _tmp57_ = NULL;
		_tmp30_ = lookfor;
		_tmp30__length1 = lookfor_length1;
		if (!(_tmp30__length1 > 0)) {
			break;
		}
		{
			gint i = 0;
			i = 0;
			{
				gboolean _tmp31_ = FALSE;
				_tmp31_ = TRUE;
				while (TRUE) {
					gboolean _tmp32_ = FALSE;
					gint _tmp34_ = 0;
					gchar** _tmp35_ = NULL;
					gint _tmp35__length1 = 0;
					gchar** _tmp36_ = NULL;
					gint _tmp36__length1 = 0;
					gint _tmp37_ = 0;
					gchar** _tmp38_ = NULL;
					gint _tmp38__length1 = 0;
					gint _tmp39_ = 0;
					const gchar* _tmp40_ = NULL;
					gchar* _tmp41_ = NULL;
					gchar* _tmp42_ = NULL;
					_tmp32_ = _tmp31_;
					if (!_tmp32_) {
						gint _tmp33_ = 0;
						_tmp33_ = i;
						i = _tmp33_ + 1;
					}
					_tmp31_ = FALSE;
					_tmp34_ = i;
					_tmp35_ = lookfor;
					_tmp35__length1 = lookfor_length1;
					if (!(_tmp34_ < _tmp35__length1)) {
						break;
					}
					_tmp36_ = lookfor;
					_tmp36__length1 = lookfor_length1;
					_tmp37_ = i;
					_tmp38_ = lookfor;
					_tmp38__length1 = lookfor_length1;
					_tmp39_ = i;
					_tmp40_ = _tmp38_[_tmp39_];
					_tmp41_ = g_regex_escape_string (_tmp40_, -1);
					_g_free0 (_tmp36_[_tmp37_]);
					_tmp36_[_tmp37_] = _tmp41_;
					_tmp42_ = _tmp36_[_tmp37_];
				}
			}
		}
		_tmp43_ = lookfor;
		_tmp43__length1 = lookfor_length1;
		_tmp44_ = g_strjoinv ("|", _tmp43_);
		relookfor = _tmp44_;
		_tmp45_ = g_new0 (gchar*, 0 + 1);
		lookfor = (_vala_array_free (lookfor, lookfor_length1, (GDestroyNotify) g_free), NULL);
		lookfor = _tmp45_;
		lookfor_length1 = 0;
		_lookfor_size_ = lookfor_length1;
		{
			GRegex* _tmp46_ = NULL;
			const gchar* _tmp47_ = NULL;
			gchar* _tmp48_ = NULL;
			gchar* _tmp49_ = NULL;
			GRegex* _tmp50_ = NULL;
			GRegex* _tmp51_ = NULL;
			_tmp47_ = relookfor;
			_tmp48_ = g_strdup_printf ("^([^:\n ]+):.*\\b(%s)\\b", _tmp47_);
			_tmp49_ = _tmp48_;
			_tmp50_ = g_regex_new (_tmp49_, G_REGEX_MULTILINE, 0, &_inner_error_);
			_tmp51_ = _tmp50_;
			_g_free0 (_tmp49_);
			_tmp46_ = _tmp51_;
			if (_inner_error_ != NULL) {
				goto __catch20_g_error;
			}
			_g_regex_unref0 (reg);
			reg = _tmp46_;
		}
		goto __finally20;
		__catch20_g_error:
		{
			GError* e = NULL;
			FILE* _tmp52_ = NULL;
			GError* _tmp53_ = NULL;
			const gchar* _tmp54_ = NULL;
			e = _inner_error_;
			_inner_error_ = NULL;
			_tmp52_ = stderr;
			_tmp53_ = e;
			_tmp54_ = _tmp53_->message;
			fprintf (_tmp52_, "regex: %s\n", _tmp54_);
			_g_error_free0 (e);
			_g_regex_unref0 (reg);
			_g_free0 (relookfor);
			continue;
		}
		__finally20:
		if (_inner_error_ != NULL) {
			_g_regex_unref0 (reg);
			_g_free0 (relookfor);
			_g_object_unref0 (found);
			targets = (_vala_array_free (targets, targets_length1, (GDestroyNotify) g_free), NULL);
			_g_free0 (outstr);
			args = (_vala_array_free (args, args_length1, (GDestroyNotify) g_free), NULL);
			_g_free0 (bname);
			lookfor = (_vala_array_free (lookfor, lookfor_length1, (GDestroyNotify) g_free), NULL);
			_g_free0 (relpath);
			_g_object_unref0 (wd);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return NULL;
		}
		_tmp55_ = reg;
		_tmp56_ = outstr;
		g_regex_match (_tmp55_, _tmp56_, 0, &_tmp57_);
		_g_match_info_unref0 (info);
		info = _tmp57_;
		while (TRUE) {
			GMatchInfo* _tmp58_ = NULL;
			gboolean _tmp59_ = FALSE;
			gchar* target = NULL;
			GMatchInfo* _tmp60_ = NULL;
			gchar* _tmp61_ = NULL;
			gboolean _tmp63_ = FALSE;
			gboolean _tmp64_ = FALSE;
			const gchar* _tmp65_ = NULL;
			gchar _tmp66_ = '\0';
			gboolean _tmp69_ = FALSE;
			gboolean _tmp72_ = FALSE;
			GeeHashSet* _tmp73_ = NULL;
			const gchar* _tmp74_ = NULL;
			gboolean _tmp75_ = FALSE;
			gchar** _tmp76_ = NULL;
			gint _tmp76__length1 = 0;
			const gchar* _tmp77_ = NULL;
			gchar* _tmp78_ = NULL;
			GeeHashSet* _tmp79_ = NULL;
			const gchar* _tmp80_ = NULL;
			gchar** _tmp81_ = NULL;
			gint _tmp81__length1 = 0;
			const gchar* _tmp82_ = NULL;
			gchar* _tmp83_ = NULL;
			_tmp58_ = info;
			_tmp59_ = g_match_info_matches (_tmp58_);
			if (!_tmp59_) {
				break;
			}
			_tmp60_ = info;
			_tmp61_ = g_match_info_fetch (_tmp60_, 1);
			target = _tmp61_;
			{
				GMatchInfo* _tmp62_ = NULL;
				_tmp62_ = info;
				g_match_info_next (_tmp62_, &_inner_error_);
				if (_inner_error_ != NULL) {
					goto __catch21_g_error;
				}
			}
			goto __finally21;
			__catch21_g_error:
			{
				g_clear_error (&_inner_error_);
				_inner_error_ = NULL;
			}
			__finally21:
			if (_inner_error_ != NULL) {
				_g_free0 (target);
				_g_match_info_unref0 (info);
				_g_regex_unref0 (reg);
				_g_free0 (relookfor);
				_g_object_unref0 (found);
				targets = (_vala_array_free (targets, targets_length1, (GDestroyNotify) g_free), NULL);
				_g_free0 (outstr);
				args = (_vala_array_free (args, args_length1, (GDestroyNotify) g_free), NULL);
				_g_free0 (bname);
				lookfor = (_vala_array_free (lookfor, lookfor_length1, (GDestroyNotify) g_free), NULL);
				_g_free0 (relpath);
				_g_object_unref0 (wd);
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
				g_clear_error (&_inner_error_);
				return NULL;
			}
			_tmp65_ = target;
			_tmp66_ = string_get (_tmp65_, (glong) 0);
			if (_tmp66_ == '#') {
				_tmp64_ = TRUE;
			} else {
				const gchar* _tmp67_ = NULL;
				gchar _tmp68_ = '\0';
				_tmp67_ = target;
				_tmp68_ = string_get (_tmp67_, (glong) 0);
				_tmp64_ = _tmp68_ == '.';
			}
			_tmp69_ = _tmp64_;
			if (_tmp69_) {
				_tmp63_ = TRUE;
			} else {
				const gchar* _tmp70_ = NULL;
				gboolean _tmp71_ = FALSE;
				_tmp70_ = target;
				_tmp71_ = g_str_has_suffix (_tmp70_, "-am");
				_tmp63_ = _tmp71_;
			}
			_tmp72_ = _tmp63_;
			if (_tmp72_) {
				_g_free0 (target);
				continue;
			}
			_tmp73_ = found;
			_tmp74_ = target;
			_tmp75_ = gee_abstract_collection_contains ((GeeAbstractCollection*) _tmp73_, _tmp74_);
			if (_tmp75_) {
				_g_free0 (target);
				continue;
			}
			_tmp76_ = targets;
			_tmp76__length1 = targets_length1;
			_tmp77_ = target;
			_tmp78_ = g_strdup (_tmp77_);
			_vala_array_add5 (&targets, &targets_length1, &_targets_size_, _tmp78_);
			_tmp79_ = found;
			_tmp80_ = target;
			gee_abstract_collection_add ((GeeAbstractCollection*) _tmp79_, _tmp80_);
			_tmp81_ = lookfor;
			_tmp81__length1 = lookfor_length1;
			_tmp82_ = target;
			_tmp83_ = g_strdup (_tmp82_);
			_vala_array_add6 (&lookfor, &lookfor_length1, &_lookfor_size_, _tmp83_);
			_g_free0 (target);
		}
		_g_match_info_unref0 (info);
		_g_regex_unref0 (reg);
		_g_free0 (relookfor);
	}
	_tmp84_ = targets;
	_tmp84__length1 = targets_length1;
	_tmp85_ = (_tmp84_ != NULL) ? _vala_array_dup7 (_tmp84_, _tmp84__length1) : ((gpointer) _tmp84_);
	_tmp85__length1 = _tmp84__length1;
	_tmp86_ = gee_array_list_new_wrap (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, _tmp85_, _tmp85__length1, NULL, NULL, NULL);
	sorted = _tmp86_;
	_tmp87_ = sorted;
	gee_list_sort ((GeeList*) _tmp87_, ___lambda2__gcompare_data_func, makefile_integration_ref (self), makefile_integration_unref);
	_tmp88_ = sorted;
	_tmp90_ = gee_collection_to_array ((GeeCollection*) _tmp88_, &_tmp89_);
	_tmp91_ = _tmp90_;
	_tmp91__length1 = _tmp89_;
	if (result_length1) {
		*result_length1 = _tmp91__length1;
	}
	result = _tmp91_;
	_g_object_unref0 (sorted);
	_g_object_unref0 (found);
	targets = (_vala_array_free (targets, targets_length1, (GDestroyNotify) g_free), NULL);
	_g_free0 (outstr);
	args = (_vala_array_free (args, args_length1, (GDestroyNotify) g_free), NULL);
	_g_free0 (bname);
	lookfor = (_vala_array_free (lookfor, lookfor_length1, (GDestroyNotify) g_free), NULL);
	_g_free0 (relpath);
	_g_object_unref0 (wd);
	return result;
}


static void _vala_array_add7 (gchar*** array, int* length, int* size, gchar* value) {
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}


static void _vala_array_add8 (gchar*** array, int* length, int* size, gchar* value) {
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}


static gint string_index_of (const gchar* self, const gchar* needle, gint start_index) {
	gint result = 0;
	gchar* _result_ = NULL;
	gint _tmp0_ = 0;
	const gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
	g_return_val_if_fail (self != NULL, 0);
	g_return_val_if_fail (needle != NULL, 0);
	_tmp0_ = start_index;
	_tmp1_ = needle;
	_tmp2_ = strstr (((gchar*) self) + _tmp0_, (gchar*) _tmp1_);
	_result_ = _tmp2_;
	_tmp3_ = _result_;
	if (_tmp3_ != NULL) {
		gchar* _tmp4_ = NULL;
		_tmp4_ = _result_;
		result = (gint) (_tmp4_ - ((gchar*) self));
		return result;
	} else {
		result = -1;
		return result;
	}
}


static gchar* string_slice (const gchar* self, glong start, glong end) {
	gchar* result = NULL;
	glong string_length = 0L;
	gint _tmp0_ = 0;
	gint _tmp1_ = 0;
	glong _tmp2_ = 0L;
	glong _tmp5_ = 0L;
	gboolean _tmp8_ = FALSE;
	glong _tmp9_ = 0L;
	gboolean _tmp12_ = FALSE;
	gboolean _tmp13_ = FALSE;
	glong _tmp14_ = 0L;
	gboolean _tmp17_ = FALSE;
	glong _tmp18_ = 0L;
	glong _tmp19_ = 0L;
	glong _tmp20_ = 0L;
	glong _tmp21_ = 0L;
	glong _tmp22_ = 0L;
	gchar* _tmp23_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = strlen (self);
	_tmp1_ = _tmp0_;
	string_length = (glong) _tmp1_;
	_tmp2_ = start;
	if (_tmp2_ < ((glong) 0)) {
		glong _tmp3_ = 0L;
		glong _tmp4_ = 0L;
		_tmp3_ = string_length;
		_tmp4_ = start;
		start = _tmp3_ + _tmp4_;
	}
	_tmp5_ = end;
	if (_tmp5_ < ((glong) 0)) {
		glong _tmp6_ = 0L;
		glong _tmp7_ = 0L;
		_tmp6_ = string_length;
		_tmp7_ = end;
		end = _tmp6_ + _tmp7_;
	}
	_tmp9_ = start;
	if (_tmp9_ >= ((glong) 0)) {
		glong _tmp10_ = 0L;
		glong _tmp11_ = 0L;
		_tmp10_ = start;
		_tmp11_ = string_length;
		_tmp8_ = _tmp10_ <= _tmp11_;
	} else {
		_tmp8_ = FALSE;
	}
	_tmp12_ = _tmp8_;
	g_return_val_if_fail (_tmp12_, NULL);
	_tmp14_ = end;
	if (_tmp14_ >= ((glong) 0)) {
		glong _tmp15_ = 0L;
		glong _tmp16_ = 0L;
		_tmp15_ = end;
		_tmp16_ = string_length;
		_tmp13_ = _tmp15_ <= _tmp16_;
	} else {
		_tmp13_ = FALSE;
	}
	_tmp17_ = _tmp13_;
	g_return_val_if_fail (_tmp17_, NULL);
	_tmp18_ = start;
	_tmp19_ = end;
	g_return_val_if_fail (_tmp18_ <= _tmp19_, NULL);
	_tmp20_ = start;
	_tmp21_ = end;
	_tmp22_ = start;
	_tmp23_ = g_strndup (((gchar*) self) + _tmp20_, (gsize) (_tmp21_ - _tmp22_));
	result = _tmp23_;
	return result;
}


static gchar** makefile_integration_flags_from_targets (MakefileIntegration* self, GFile* makefile, GFile* source, gchar** targets, int targets_length1, int* result_length1) {
	gchar** result = NULL;
	gchar** _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	gchar* fakevalac = NULL;
	gchar* _tmp3_ = NULL;
	GFile* wd = NULL;
	GFile* _tmp4_ = NULL;
	GFile* _tmp5_ = NULL;
	gchar* relsource = NULL;
	GFile* _tmp6_ = NULL;
	GFile* _tmp7_ = NULL;
	gchar* _tmp8_ = NULL;
	gchar** args = NULL;
	gchar* _tmp9_ = NULL;
	gchar* _tmp10_ = NULL;
	gchar* _tmp11_ = NULL;
	gchar* _tmp12_ = NULL;
	gchar* _tmp13_ = NULL;
	const gchar* _tmp14_ = NULL;
	gchar* _tmp15_ = NULL;
	gchar* _tmp16_ = NULL;
	const gchar* _tmp17_ = NULL;
	gchar* _tmp18_ = NULL;
	gchar** _tmp19_ = NULL;
	gint args_length1 = 0;
	gint _args_size_ = 0;
	gchar** _tmp20_ = NULL;
	gint _tmp20__length1 = 0;
	gchar** _tmp25_ = NULL;
	gint _tmp25__length1 = 0;
	gchar* outstr = NULL;
	gint pos = 0;
	const gchar* _tmp33_ = NULL;
	const gchar* _tmp34_ = NULL;
	gint _tmp35_ = 0;
	gint _tmp36_ = 0;
	gint epos = 0;
	const gchar* _tmp39_ = NULL;
	gint _tmp40_ = 0;
	gint _tmp41_ = 0;
	gint _tmp42_ = 0;
	gchar** retargs = NULL;
	gint retargs_length1 = 0;
	gint _retargs_size_ = 0;
	gchar* sargs = NULL;
	const gchar* _tmp46_ = NULL;
	gint _tmp47_ = 0;
	gint _tmp48_ = 0;
	gchar* _tmp49_ = NULL;
	const gchar* _tmp55_ = NULL;
	gchar** _tmp56_ = NULL;
	gint _tmp56__length1 = 0;
	gchar* _tmp57_ = NULL;
	gchar* _tmp58_ = NULL;
	gchar** _tmp59_ = NULL;
	gint _tmp59__length1 = 0;
	GError * _inner_error_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (makefile != NULL, NULL);
	g_return_val_if_fail (source != NULL, NULL);
	_tmp0_ = targets;
	_tmp0__length1 = targets_length1;
	if (_tmp0__length1 == 0) {
		gchar** _tmp1_ = NULL;
		gchar** _tmp2_ = NULL;
		gint _tmp2__length1 = 0;
		_tmp1_ = g_new0 (gchar*, 0 + 1);
		_tmp2_ = _tmp1_;
		_tmp2__length1 = 0;
		if (result_length1) {
			*result_length1 = _tmp2__length1;
		}
		result = _tmp2_;
		return result;
	}
	_tmp3_ = g_strdup ("__GCA_VALA_COMPILE_ARGS__");
	fakevalac = _tmp3_;
	_tmp4_ = makefile;
	_tmp5_ = g_file_get_parent (_tmp4_);
	wd = _tmp5_;
	_tmp6_ = wd;
	_tmp7_ = source;
	_tmp8_ = g_file_get_relative_path (_tmp6_, _tmp7_);
	relsource = _tmp8_;
	_tmp9_ = g_strdup ("make");
	_tmp10_ = g_strdup ("-s");
	_tmp11_ = g_strdup ("-i");
	_tmp12_ = g_strdup ("-n");
	_tmp13_ = g_strdup ("-W");
	_tmp14_ = relsource;
	_tmp15_ = g_strdup (_tmp14_);
	_tmp16_ = g_strdup ("V=1");
	_tmp17_ = fakevalac;
	_tmp18_ = g_strconcat ("VALAC=", _tmp17_, NULL);
	_tmp19_ = g_new0 (gchar*, 8 + 1);
	_tmp19_[0] = _tmp9_;
	_tmp19_[1] = _tmp10_;
	_tmp19_[2] = _tmp11_;
	_tmp19_[3] = _tmp12_;
	_tmp19_[4] = _tmp13_;
	_tmp19_[5] = _tmp15_;
	_tmp19_[6] = _tmp16_;
	_tmp19_[7] = _tmp18_;
	args = _tmp19_;
	args_length1 = 8;
	_args_size_ = args_length1;
	_tmp20_ = targets;
	_tmp20__length1 = targets_length1;
	{
		gchar** target_collection = NULL;
		gint target_collection_length1 = 0;
		gint _target_collection_size_ = 0;
		gint target_it = 0;
		target_collection = _tmp20_;
		target_collection_length1 = _tmp20__length1;
		for (target_it = 0; target_it < _tmp20__length1; target_it = target_it + 1) {
			gchar* _tmp21_ = NULL;
			gchar* target = NULL;
			_tmp21_ = g_strdup (target_collection[target_it]);
			target = _tmp21_;
			{
				gchar** _tmp22_ = NULL;
				gint _tmp22__length1 = 0;
				const gchar* _tmp23_ = NULL;
				gchar* _tmp24_ = NULL;
				_tmp22_ = args;
				_tmp22__length1 = args_length1;
				_tmp23_ = target;
				_tmp24_ = g_strdup (_tmp23_);
				_vala_array_add7 (&args, &args_length1, &_args_size_, _tmp24_);
				_g_free0 (target);
			}
		}
	}
	_tmp25_ = args;
	_tmp25__length1 = args_length1;
	_vala_array_add8 (&args, &args_length1, &_args_size_, NULL);
	{
		GFile* _tmp26_ = NULL;
		gchar* _tmp27_ = NULL;
		gchar* _tmp28_ = NULL;
		gchar** _tmp29_ = NULL;
		gint _tmp29__length1 = 0;
		gchar* _tmp30_ = NULL;
		_tmp26_ = wd;
		_tmp27_ = g_file_get_path (_tmp26_);
		_tmp28_ = _tmp27_;
		_tmp29_ = args;
		_tmp29__length1 = args_length1;
		g_spawn_sync (_tmp28_, _tmp29_, NULL, G_SPAWN_SEARCH_PATH | G_SPAWN_STDERR_TO_DEV_NULL, NULL, NULL, &_tmp30_, NULL, NULL, &_inner_error_);
		_g_free0 (outstr);
		outstr = _tmp30_;
		_g_free0 (_tmp28_);
		if (_inner_error_ != NULL) {
			if (_inner_error_->domain == G_SPAWN_ERROR) {
				goto __catch22_g_spawn_error;
			}
			_g_free0 (outstr);
			args = (_vala_array_free (args, args_length1, (GDestroyNotify) g_free), NULL);
			_g_free0 (relsource);
			_g_object_unref0 (wd);
			_g_free0 (fakevalac);
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return NULL;
		}
	}
	goto __finally22;
	__catch22_g_spawn_error:
	{
		GError* e = NULL;
		gchar** _tmp31_ = NULL;
		gchar** _tmp32_ = NULL;
		gint _tmp32__length1 = 0;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp31_ = g_new0 (gchar*, 0 + 1);
		_tmp32_ = _tmp31_;
		_tmp32__length1 = 0;
		if (result_length1) {
			*result_length1 = _tmp32__length1;
		}
		result = _tmp32_;
		_g_error_free0 (e);
		_g_free0 (outstr);
		args = (_vala_array_free (args, args_length1, (GDestroyNotify) g_free), NULL);
		_g_free0 (relsource);
		_g_object_unref0 (wd);
		_g_free0 (fakevalac);
		return result;
	}
	__finally22:
	if (_inner_error_ != NULL) {
		_g_free0 (outstr);
		args = (_vala_array_free (args, args_length1, (GDestroyNotify) g_free), NULL);
		_g_free0 (relsource);
		_g_object_unref0 (wd);
		_g_free0 (fakevalac);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return NULL;
	}
	_tmp33_ = outstr;
	_tmp34_ = fakevalac;
	_tmp35_ = string_index_of (_tmp33_, _tmp34_, 0);
	pos = _tmp35_;
	_tmp36_ = pos;
	if (_tmp36_ < 0) {
		gchar** _tmp37_ = NULL;
		gchar** _tmp38_ = NULL;
		gint _tmp38__length1 = 0;
		_tmp37_ = g_new0 (gchar*, 0 + 1);
		_tmp38_ = _tmp37_;
		_tmp38__length1 = 0;
		if (result_length1) {
			*result_length1 = _tmp38__length1;
		}
		result = _tmp38_;
		_g_free0 (outstr);
		args = (_vala_array_free (args, args_length1, (GDestroyNotify) g_free), NULL);
		_g_free0 (relsource);
		_g_object_unref0 (wd);
		_g_free0 (fakevalac);
		return result;
	}
	_tmp39_ = outstr;
	_tmp40_ = pos;
	_tmp41_ = string_index_of (_tmp39_, "\n", _tmp40_);
	epos = _tmp41_;
	_tmp42_ = epos;
	if (_tmp42_ < 0) {
		const gchar* _tmp43_ = NULL;
		gint _tmp44_ = 0;
		gint _tmp45_ = 0;
		_tmp43_ = outstr;
		_tmp44_ = strlen (_tmp43_);
		_tmp45_ = _tmp44_;
		epos = _tmp45_;
	}
	_tmp46_ = outstr;
	_tmp47_ = pos;
	_tmp48_ = epos;
	_tmp49_ = string_slice (_tmp46_, (glong) _tmp47_, (glong) _tmp48_);
	sargs = _tmp49_;
	{
		const gchar* _tmp50_ = NULL;
		gchar** _tmp51_ = NULL;
		gint _tmp52_ = 0;
		_tmp50_ = sargs;
		g_shell_parse_argv (_tmp50_, &_tmp52_, &_tmp51_, &_inner_error_);
		retargs = (_vala_array_free (retargs, retargs_length1, (GDestroyNotify) g_free), NULL);
		retargs = _tmp51_;
		retargs_length1 = _tmp52_;
		_retargs_size_ = retargs_length1;
		if (_inner_error_ != NULL) {
			if (_inner_error_->domain == G_SHELL_ERROR) {
				goto __catch23_g_shell_error;
			}
			_g_free0 (sargs);
			retargs = (_vala_array_free (retargs, retargs_length1, (GDestroyNotify) g_free), NULL);
			_g_free0 (outstr);
			args = (_vala_array_free (args, args_length1, (GDestroyNotify) g_free), NULL);
			_g_free0 (relsource);
			_g_object_unref0 (wd);
			_g_free0 (fakevalac);
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return NULL;
		}
	}
	goto __finally23;
	__catch23_g_shell_error:
	{
		GError* e = NULL;
		gchar** _tmp53_ = NULL;
		gchar** _tmp54_ = NULL;
		gint _tmp54__length1 = 0;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp53_ = g_new0 (gchar*, 0 + 1);
		_tmp54_ = _tmp53_;
		_tmp54__length1 = 0;
		if (result_length1) {
			*result_length1 = _tmp54__length1;
		}
		result = _tmp54_;
		_g_error_free0 (e);
		_g_free0 (sargs);
		retargs = (_vala_array_free (retargs, retargs_length1, (GDestroyNotify) g_free), NULL);
		_g_free0 (outstr);
		args = (_vala_array_free (args, args_length1, (GDestroyNotify) g_free), NULL);
		_g_free0 (relsource);
		_g_object_unref0 (wd);
		_g_free0 (fakevalac);
		return result;
	}
	__finally23:
	if (_inner_error_ != NULL) {
		_g_free0 (sargs);
		retargs = (_vala_array_free (retargs, retargs_length1, (GDestroyNotify) g_free), NULL);
		_g_free0 (outstr);
		args = (_vala_array_free (args, args_length1, (GDestroyNotify) g_free), NULL);
		_g_free0 (relsource);
		_g_object_unref0 (wd);
		_g_free0 (fakevalac);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return NULL;
	}
	_tmp55_ = sargs;
	_tmp56_ = retargs;
	_tmp56__length1 = retargs_length1;
	_tmp57_ = g_strjoinv ("', '", _tmp56_);
	_tmp58_ = _tmp57_;
	g_log ("GcaVala", G_LOG_LEVEL_DEBUG, "makefileintegration.vala:531: Parsed command: %s => '%s'\n", _tmp55_, _tmp58_);
	_g_free0 (_tmp58_);
	_tmp59_ = retargs;
	_tmp59__length1 = retargs_length1;
	if (result_length1) {
		*result_length1 = _tmp59__length1;
	}
	result = _tmp59_;
	_g_free0 (sargs);
	_g_free0 (outstr);
	args = (_vala_array_free (args, args_length1, (GDestroyNotify) g_free), NULL);
	_g_free0 (relsource);
	_g_object_unref0 (wd);
	_g_free0 (fakevalac);
	return result;
}


static void _makefile_integration_makefile_on_changed_g_file_monitor_changed (GFileMonitor* _sender, GFile* file, GFile* other_file, GFileMonitorEvent event_type, gpointer self) {
	makefile_integration_makefile_on_changed (self);
}


static MakefileIntegrationMakefile* makefile_integration_makefile_construct (GType object_type, GFile* file) {
	MakefileIntegrationMakefile* self = NULL;
	GFile* _tmp0_ = NULL;
	GFile* _tmp1_ = NULL;
	GeeHashMap* _tmp2_ = NULL;
	GFileMonitor* _tmp6_ = NULL;
	GError * _inner_error_ = NULL;
	g_return_val_if_fail (file != NULL, NULL);
	self = (MakefileIntegrationMakefile*) g_type_create_instance (object_type);
	_tmp0_ = file;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->priv->d_file);
	self->priv->d_file = _tmp1_;
	_tmp2_ = gee_hash_map_new (G_TYPE_FILE, (GBoxedCopyFunc) g_object_ref, g_object_unref, MAKEFILE_INTEGRATION_MAKEFILE_TYPE_SOURCE, (GBoxedCopyFunc) makefile_integration_makefile_source_ref, makefile_integration_makefile_source_unref, _hash_utils_file_hash_gee_hash_data_func, NULL, NULL, _hash_utils_file_equal_gee_equal_data_func, NULL, NULL, NULL, NULL, NULL);
	_g_object_unref0 (self->priv->d_sources);
	self->priv->d_sources = _tmp2_;
	makefile_integration_makefile_update_mtime (self);
	{
		GFileMonitor* _tmp3_ = NULL;
		GFile* _tmp4_ = NULL;
		GFileMonitor* _tmp5_ = NULL;
		_tmp4_ = file;
		_tmp5_ = g_file_monitor (_tmp4_, G_FILE_MONITOR_NONE, NULL, &_inner_error_);
		_tmp3_ = _tmp5_;
		if (_inner_error_ != NULL) {
			goto __catch24_g_error;
		}
		_g_object_unref0 (self->priv->d_monitor);
		self->priv->d_monitor = _tmp3_;
	}
	goto __finally24;
	__catch24_g_error:
	{
		GError* _error_ = NULL;
		_error_ = _inner_error_;
		_inner_error_ = NULL;
		_g_error_free0 (_error_);
		return self;
	}
	__finally24:
	if (_inner_error_ != NULL) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return NULL;
	}
	_tmp6_ = self->priv->d_monitor;
	g_signal_connect (_tmp6_, "changed", (GCallback) _makefile_integration_makefile_on_changed_g_file_monitor_changed, self);
	return self;
}


static MakefileIntegrationMakefile* makefile_integration_makefile_new (GFile* file) {
	return makefile_integration_makefile_construct (MAKEFILE_INTEGRATION_TYPE_MAKEFILE, file);
}


static void makefile_integration_makefile_file_mtime (MakefileIntegrationMakefile* self, GFile* f, GTimeVal* result) {
	GTimeVal _tmp3_ = {0};
	GError * _inner_error_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (f != NULL);
	{
		GFileInfo* info = NULL;
		GFile* _tmp0_ = NULL;
		GFileInfo* _tmp1_ = NULL;
		GTimeVal _tmp2_ = {0};
		_tmp0_ = f;
		_tmp1_ = g_file_query_info (_tmp0_, G_FILE_ATTRIBUTE_TIME_MODIFIED, G_FILE_QUERY_INFO_NONE, NULL, &_inner_error_);
		info = _tmp1_;
		if (_inner_error_ != NULL) {
			goto __catch25_g_error;
		}
		g_file_info_get_modification_time (info, &_tmp2_);
		*result = _tmp2_;
		_g_object_unref0 (info);
		return;
	}
	goto __finally25;
	__catch25_g_error:
	{
		g_clear_error (&_inner_error_);
		_inner_error_ = NULL;
	}
	__finally25:
	if (_inner_error_ != NULL) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return;
	}
	g_get_current_time (&_tmp3_);
	_tmp3_.tv_sec = (glong) 0;
	_tmp3_.tv_usec = (glong) 0;
	*result = _tmp3_;
	return;
}


static void makefile_integration_makefile_update_mtime (MakefileIntegrationMakefile* self) {
	GFile* _tmp0_ = NULL;
	GTimeVal _tmp1_ = {0};
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->d_file;
	makefile_integration_makefile_file_mtime (self, _tmp0_, &_tmp1_);
	self->priv->d_mtime = _tmp1_;
}


static void makefile_integration_makefile_on_changed (MakefileIntegrationMakefile* self) {
	g_return_if_fail (self != NULL);
	makefile_integration_makefile_update_mtime (self);
}


static gchar** _vala_array_dup8 (gchar** self, int length) {
	gchar** result;
	int i;
	result = g_new0 (gchar*, length + 1);
	for (i = 0; i < length; i++) {
		gchar* _tmp0_ = NULL;
		_tmp0_ = g_strdup (self[i]);
		result[i] = _tmp0_;
	}
	return result;
}


static MakefileIntegrationMakefileSource* makefile_integration_makefile_make_source (MakefileIntegrationMakefile* self, gchar** flags, int flags_length1) {
	MakefileIntegrationMakefileSource* result = NULL;
	MakefileIntegrationMakefileSource* ret = NULL;
	MakefileIntegrationMakefileSource* _tmp0_ = NULL;
	gchar** _tmp1_ = NULL;
	gint _tmp1__length1 = 0;
	gchar** _tmp2_ = NULL;
	gint _tmp2__length1 = 0;
	GTimeVal _tmp3_ = {0};
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = makefile_integration_makefile_source_new ();
	ret = _tmp0_;
	_tmp1_ = flags;
	_tmp1__length1 = flags_length1;
	_tmp2_ = (_tmp1_ != NULL) ? _vala_array_dup8 (_tmp1_, _tmp1__length1) : ((gpointer) _tmp1_);
	_tmp2__length1 = _tmp1__length1;
	ret->flags = (_vala_array_free (ret->flags, ret->flags_length1, (GDestroyNotify) g_free), NULL);
	ret->flags = _tmp2_;
	ret->flags_length1 = _tmp2__length1;
	ret->_flags_size_ = ret->flags_length1;
	_tmp3_ = self->priv->d_mtime;
	ret->mtime = _tmp3_;
	result = ret;
	return result;
}


static void makefile_integration_makefile_dispose (MakefileIntegrationMakefile* self) {
	GFileMonitor* _tmp0_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->d_monitor;
	if (_tmp0_ != NULL) {
		GFileMonitor* _tmp1_ = NULL;
		_tmp1_ = self->priv->d_monitor;
		g_file_monitor_cancel (_tmp1_);
		_g_object_unref0 (self->priv->d_monitor);
		self->priv->d_monitor = NULL;
	}
}


static void makefile_integration_makefile_add (MakefileIntegrationMakefile* self, GFile* source, gchar** flags, int flags_length1) {
	GeeHashMap* _tmp0_ = NULL;
	GFile* _tmp1_ = NULL;
	GFile* _tmp2_ = NULL;
	gchar** _tmp3_ = NULL;
	gint _tmp3__length1 = 0;
	MakefileIntegrationMakefileSource* _tmp4_ = NULL;
	MakefileIntegrationMakefileSource* _tmp5_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (source != NULL);
	_tmp0_ = self->priv->d_sources;
	_tmp1_ = makefile_integration_makefile_get_file (self);
	_tmp2_ = _tmp1_;
	_tmp3_ = flags;
	_tmp3__length1 = flags_length1;
	_tmp4_ = makefile_integration_makefile_make_source (self, _tmp3_, _tmp3__length1);
	_tmp5_ = _tmp4_;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp0_, _tmp2_, _tmp5_);
	_makefile_integration_makefile_source_unref0 (_tmp5_);
}


static gboolean makefile_integration_makefile_remove (MakefileIntegrationMakefile* self, GFile* source) {
	gboolean result = FALSE;
	gboolean _tmp0_ = FALSE;
	GeeHashMap* _tmp1_ = NULL;
	GFile* _tmp2_ = NULL;
	gboolean _tmp3_ = FALSE;
	gboolean _tmp7_ = FALSE;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (source != NULL, FALSE);
	_tmp1_ = self->priv->d_sources;
	_tmp2_ = source;
	_tmp3_ = gee_abstract_map_unset ((GeeAbstractMap*) _tmp1_, _tmp2_, NULL);
	if (_tmp3_) {
		GeeHashMap* _tmp4_ = NULL;
		gint _tmp5_ = 0;
		gint _tmp6_ = 0;
		_tmp4_ = self->priv->d_sources;
		_tmp5_ = gee_abstract_map_get_size ((GeeMap*) _tmp4_);
		_tmp6_ = _tmp5_;
		_tmp0_ = _tmp6_ == 0;
	} else {
		_tmp0_ = FALSE;
	}
	_tmp7_ = _tmp0_;
	if (_tmp7_) {
		makefile_integration_makefile_dispose (self);
		result = TRUE;
		return result;
	}
	result = FALSE;
	return result;
}


static gboolean makefile_integration_makefile_newer (MakefileIntegrationMakefile* self, GTimeVal* t1, GTimeVal* t2) {
	gboolean result = FALSE;
	GTimeVal _tmp0_ = {0};
	glong _tmp1_ = 0L;
	GTimeVal _tmp2_ = {0};
	glong _tmp3_ = 0L;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (t1 != NULL, FALSE);
	g_return_val_if_fail (t2 != NULL, FALSE);
	_tmp0_ = *t1;
	_tmp1_ = _tmp0_.tv_sec;
	_tmp2_ = *t2;
	_tmp3_ = _tmp2_.tv_sec;
	if (_tmp1_ == _tmp3_) {
		GTimeVal _tmp4_ = {0};
		glong _tmp5_ = 0L;
		GTimeVal _tmp6_ = {0};
		glong _tmp7_ = 0L;
		_tmp4_ = *t1;
		_tmp5_ = _tmp4_.tv_usec;
		_tmp6_ = *t2;
		_tmp7_ = _tmp6_.tv_usec;
		result = _tmp5_ > _tmp7_;
		return result;
	} else {
		GTimeVal _tmp8_ = {0};
		glong _tmp9_ = 0L;
		GTimeVal _tmp10_ = {0};
		glong _tmp11_ = 0L;
		_tmp8_ = *t1;
		_tmp9_ = _tmp8_.tv_sec;
		_tmp10_ = *t2;
		_tmp11_ = _tmp10_.tv_sec;
		result = _tmp9_ > _tmp11_;
		return result;
	}
}


static gboolean makefile_integration_makefile_up_to_date_for (MakefileIntegrationMakefile* self, GFile* source) {
	gboolean result = FALSE;
	MakefileIntegrationMakefileSource* s = NULL;
	GeeHashMap* _tmp0_ = NULL;
	GFile* _tmp1_ = NULL;
	gpointer _tmp2_ = NULL;
	MakefileIntegrationMakefileSource* _tmp3_ = NULL;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (source != NULL, FALSE);
	_tmp0_ = self->priv->d_sources;
	_tmp1_ = source;
	_tmp2_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp0_, _tmp1_);
	s = (MakefileIntegrationMakefileSource*) _tmp2_;
	_tmp3_ = s;
	if (_tmp3_ != NULL) {
		GTimeVal _tmp4_ = {0};
		MakefileIntegrationMakefileSource* _tmp5_ = NULL;
		GTimeVal _tmp6_ = {0};
		gboolean _tmp7_ = FALSE;
		_tmp4_ = self->priv->d_mtime;
		_tmp5_ = s;
		_tmp6_ = _tmp5_->mtime;
		_tmp7_ = makefile_integration_makefile_newer (self, &_tmp4_, &_tmp6_);
		result = !_tmp7_;
		_makefile_integration_makefile_source_unref0 (s);
		return result;
	} else {
		result = FALSE;
		_makefile_integration_makefile_source_unref0 (s);
		return result;
	}
	_makefile_integration_makefile_source_unref0 (s);
}


static gchar** _vala_array_dup9 (gchar** self, int length) {
	gchar** result;
	int i;
	result = g_new0 (gchar*, length + 1);
	for (i = 0; i < length; i++) {
		gchar* _tmp0_ = NULL;
		_tmp0_ = g_strdup (self[i]);
		result[i] = _tmp0_;
	}
	return result;
}


static gchar** makefile_integration_makefile_flags_for_file (MakefileIntegrationMakefile* self, GFile* source, int* result_length1) {
	gchar** result = NULL;
	MakefileIntegrationMakefileSource* s = NULL;
	GeeHashMap* _tmp0_ = NULL;
	GFile* _tmp1_ = NULL;
	gpointer _tmp2_ = NULL;
	MakefileIntegrationMakefileSource* _tmp3_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (source != NULL, NULL);
	_tmp0_ = self->priv->d_sources;
	_tmp1_ = source;
	_tmp2_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp0_, _tmp1_);
	s = (MakefileIntegrationMakefileSource*) _tmp2_;
	_tmp3_ = s;
	if (_tmp3_ != NULL) {
		MakefileIntegrationMakefileSource* _tmp4_ = NULL;
		gchar** _tmp5_ = NULL;
		gint _tmp5__length1 = 0;
		gchar** _tmp6_ = NULL;
		gint _tmp6__length1 = 0;
		gchar** _tmp7_ = NULL;
		gint _tmp7__length1 = 0;
		_tmp4_ = s;
		_tmp5_ = _tmp4_->flags;
		_tmp5__length1 = _tmp4_->flags_length1;
		_tmp6_ = (_tmp5_ != NULL) ? _vala_array_dup9 (_tmp5_, _tmp5__length1) : ((gpointer) _tmp5_);
		_tmp6__length1 = _tmp5__length1;
		_tmp7_ = _tmp6_;
		_tmp7__length1 = _tmp6__length1;
		if (result_length1) {
			*result_length1 = _tmp7__length1;
		}
		result = _tmp7_;
		_makefile_integration_makefile_source_unref0 (s);
		return result;
	} else {
		gchar** _tmp8_ = NULL;
		gint _tmp8__length1 = 0;
		_tmp8_ = NULL;
		_tmp8__length1 = 0;
		if (result_length1) {
			*result_length1 = _tmp8__length1;
		}
		result = _tmp8_;
		_makefile_integration_makefile_source_unref0 (s);
		return result;
	}
	_makefile_integration_makefile_source_unref0 (s);
}


static GFile* makefile_integration_makefile_get_file (MakefileIntegrationMakefile* self) {
	GFile* result;
	GFile* _tmp0_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->d_file;
	result = _tmp0_;
	return result;
}


static MakefileIntegrationMakefileSource* makefile_integration_makefile_source_construct (GType object_type) {
	MakefileIntegrationMakefileSource* self = NULL;
	self = (MakefileIntegrationMakefileSource*) g_type_create_instance (object_type);
	return self;
}


static MakefileIntegrationMakefileSource* makefile_integration_makefile_source_new (void) {
	return makefile_integration_makefile_source_construct (MAKEFILE_INTEGRATION_MAKEFILE_TYPE_SOURCE);
}


static void makefile_integration_makefile_value_source_init (GValue* value) {
	value->data[0].v_pointer = NULL;
}


static void makefile_integration_makefile_value_source_free_value (GValue* value) {
	if (value->data[0].v_pointer) {
		makefile_integration_makefile_source_unref (value->data[0].v_pointer);
	}
}


static void makefile_integration_makefile_value_source_copy_value (const GValue* src_value, GValue* dest_value) {
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = makefile_integration_makefile_source_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}


static gpointer makefile_integration_makefile_value_source_peek_pointer (const GValue* value) {
	return value->data[0].v_pointer;
}


static gchar* makefile_integration_makefile_value_source_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	if (collect_values[0].v_pointer) {
		MakefileIntegrationMakefileSource* object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = makefile_integration_makefile_source_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}


static gchar* makefile_integration_makefile_value_source_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	MakefileIntegrationMakefileSource** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = makefile_integration_makefile_source_ref (value->data[0].v_pointer);
	}
	return NULL;
}


static GParamSpec* makefile_integration_makefile_param_spec_source (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
	MakefileIntegrationMakefileParamSpecSource* spec;
	g_return_val_if_fail (g_type_is_a (object_type, MAKEFILE_INTEGRATION_MAKEFILE_TYPE_SOURCE), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}


static gpointer makefile_integration_makefile_value_get_source (const GValue* value) {
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, MAKEFILE_INTEGRATION_MAKEFILE_TYPE_SOURCE), NULL);
	return value->data[0].v_pointer;
}


static void makefile_integration_makefile_value_set_source (GValue* value, gpointer v_object) {
	MakefileIntegrationMakefileSource* old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, MAKEFILE_INTEGRATION_MAKEFILE_TYPE_SOURCE));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, MAKEFILE_INTEGRATION_MAKEFILE_TYPE_SOURCE));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		makefile_integration_makefile_source_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		makefile_integration_makefile_source_unref (old);
	}
}


static void makefile_integration_makefile_value_take_source (GValue* value, gpointer v_object) {
	MakefileIntegrationMakefileSource* old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, MAKEFILE_INTEGRATION_MAKEFILE_TYPE_SOURCE));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, MAKEFILE_INTEGRATION_MAKEFILE_TYPE_SOURCE));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		makefile_integration_makefile_source_unref (old);
	}
}


static void makefile_integration_makefile_source_class_init (MakefileIntegrationMakefileSourceClass * klass) {
	makefile_integration_makefile_source_parent_class = g_type_class_peek_parent (klass);
	MAKEFILE_INTEGRATION_MAKEFILE_SOURCE_CLASS (klass)->finalize = makefile_integration_makefile_source_finalize;
}


static void makefile_integration_makefile_source_instance_init (MakefileIntegrationMakefileSource * self) {
	self->ref_count = 1;
}


static void makefile_integration_makefile_source_finalize (MakefileIntegrationMakefileSource* obj) {
	MakefileIntegrationMakefileSource * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, MAKEFILE_INTEGRATION_MAKEFILE_TYPE_SOURCE, MakefileIntegrationMakefileSource);
	self->flags = (_vala_array_free (self->flags, self->flags_length1, (GDestroyNotify) g_free), NULL);
}


static GType makefile_integration_makefile_source_get_type (void) {
	static volatile gsize makefile_integration_makefile_source_type_id__volatile = 0;
	if (g_once_init_enter (&makefile_integration_makefile_source_type_id__volatile)) {
		static const GTypeValueTable g_define_type_value_table = { makefile_integration_makefile_value_source_init, makefile_integration_makefile_value_source_free_value, makefile_integration_makefile_value_source_copy_value, makefile_integration_makefile_value_source_peek_pointer, "p", makefile_integration_makefile_value_source_collect_value, "p", makefile_integration_makefile_value_source_lcopy_value };
		static const GTypeInfo g_define_type_info = { sizeof (MakefileIntegrationMakefileSourceClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) makefile_integration_makefile_source_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (MakefileIntegrationMakefileSource), 0, (GInstanceInitFunc) makefile_integration_makefile_source_instance_init, &g_define_type_value_table };
		static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
		GType makefile_integration_makefile_source_type_id;
		makefile_integration_makefile_source_type_id = g_type_register_fundamental (g_type_fundamental_next (), "MakefileIntegrationMakefileSource", &g_define_type_info, &g_define_type_fundamental_info, 0);
		g_once_init_leave (&makefile_integration_makefile_source_type_id__volatile, makefile_integration_makefile_source_type_id);
	}
	return makefile_integration_makefile_source_type_id__volatile;
}


static gpointer makefile_integration_makefile_source_ref (gpointer instance) {
	MakefileIntegrationMakefileSource* self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}


static void makefile_integration_makefile_source_unref (gpointer instance) {
	MakefileIntegrationMakefileSource* self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		MAKEFILE_INTEGRATION_MAKEFILE_SOURCE_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}


static void makefile_integration_value_makefile_init (GValue* value) {
	value->data[0].v_pointer = NULL;
}


static void makefile_integration_value_makefile_free_value (GValue* value) {
	if (value->data[0].v_pointer) {
		makefile_integration_makefile_unref (value->data[0].v_pointer);
	}
}


static void makefile_integration_value_makefile_copy_value (const GValue* src_value, GValue* dest_value) {
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = makefile_integration_makefile_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}


static gpointer makefile_integration_value_makefile_peek_pointer (const GValue* value) {
	return value->data[0].v_pointer;
}


static gchar* makefile_integration_value_makefile_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	if (collect_values[0].v_pointer) {
		MakefileIntegrationMakefile* object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = makefile_integration_makefile_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}


static gchar* makefile_integration_value_makefile_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	MakefileIntegrationMakefile** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = makefile_integration_makefile_ref (value->data[0].v_pointer);
	}
	return NULL;
}


static GParamSpec* makefile_integration_param_spec_makefile (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
	MakefileIntegrationParamSpecMakefile* spec;
	g_return_val_if_fail (g_type_is_a (object_type, MAKEFILE_INTEGRATION_TYPE_MAKEFILE), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}


static gpointer makefile_integration_value_get_makefile (const GValue* value) {
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, MAKEFILE_INTEGRATION_TYPE_MAKEFILE), NULL);
	return value->data[0].v_pointer;
}


static void makefile_integration_value_set_makefile (GValue* value, gpointer v_object) {
	MakefileIntegrationMakefile* old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, MAKEFILE_INTEGRATION_TYPE_MAKEFILE));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, MAKEFILE_INTEGRATION_TYPE_MAKEFILE));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		makefile_integration_makefile_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		makefile_integration_makefile_unref (old);
	}
}


static void makefile_integration_value_take_makefile (GValue* value, gpointer v_object) {
	MakefileIntegrationMakefile* old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, MAKEFILE_INTEGRATION_TYPE_MAKEFILE));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, MAKEFILE_INTEGRATION_TYPE_MAKEFILE));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		makefile_integration_makefile_unref (old);
	}
}


static void makefile_integration_makefile_class_init (MakefileIntegrationMakefileClass * klass) {
	makefile_integration_makefile_parent_class = g_type_class_peek_parent (klass);
	MAKEFILE_INTEGRATION_MAKEFILE_CLASS (klass)->finalize = makefile_integration_makefile_finalize;
	g_type_class_add_private (klass, sizeof (MakefileIntegrationMakefilePrivate));
}


static void makefile_integration_makefile_instance_init (MakefileIntegrationMakefile * self) {
	self->priv = MAKEFILE_INTEGRATION_MAKEFILE_GET_PRIVATE (self);
	self->ref_count = 1;
}


static void makefile_integration_makefile_finalize (MakefileIntegrationMakefile* obj) {
	MakefileIntegrationMakefile * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, MAKEFILE_INTEGRATION_TYPE_MAKEFILE, MakefileIntegrationMakefile);
	_g_object_unref0 (self->priv->d_file);
	_g_object_unref0 (self->priv->d_sources);
	_g_object_unref0 (self->priv->d_monitor);
}


static GType makefile_integration_makefile_get_type (void) {
	static volatile gsize makefile_integration_makefile_type_id__volatile = 0;
	if (g_once_init_enter (&makefile_integration_makefile_type_id__volatile)) {
		static const GTypeValueTable g_define_type_value_table = { makefile_integration_value_makefile_init, makefile_integration_value_makefile_free_value, makefile_integration_value_makefile_copy_value, makefile_integration_value_makefile_peek_pointer, "p", makefile_integration_value_makefile_collect_value, "p", makefile_integration_value_makefile_lcopy_value };
		static const GTypeInfo g_define_type_info = { sizeof (MakefileIntegrationMakefileClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) makefile_integration_makefile_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (MakefileIntegrationMakefile), 0, (GInstanceInitFunc) makefile_integration_makefile_instance_init, &g_define_type_value_table };
		static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
		GType makefile_integration_makefile_type_id;
		makefile_integration_makefile_type_id = g_type_register_fundamental (g_type_fundamental_next (), "MakefileIntegrationMakefile", &g_define_type_info, &g_define_type_fundamental_info, 0);
		g_once_init_leave (&makefile_integration_makefile_type_id__volatile, makefile_integration_makefile_type_id);
	}
	return makefile_integration_makefile_type_id__volatile;
}


static gpointer makefile_integration_makefile_ref (gpointer instance) {
	MakefileIntegrationMakefile* self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}


static void makefile_integration_makefile_unref (gpointer instance) {
	MakefileIntegrationMakefile* self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		MAKEFILE_INTEGRATION_MAKEFILE_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}


static void value_makefile_integration_init (GValue* value) {
	value->data[0].v_pointer = NULL;
}


static void value_makefile_integration_free_value (GValue* value) {
	if (value->data[0].v_pointer) {
		makefile_integration_unref (value->data[0].v_pointer);
	}
}


static void value_makefile_integration_copy_value (const GValue* src_value, GValue* dest_value) {
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = makefile_integration_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}


static gpointer value_makefile_integration_peek_pointer (const GValue* value) {
	return value->data[0].v_pointer;
}


static gchar* value_makefile_integration_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	if (collect_values[0].v_pointer) {
		MakefileIntegration* object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = makefile_integration_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}


static gchar* value_makefile_integration_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	MakefileIntegration** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = makefile_integration_ref (value->data[0].v_pointer);
	}
	return NULL;
}


GParamSpec* param_spec_makefile_integration (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
	ParamSpecMakefileIntegration* spec;
	g_return_val_if_fail (g_type_is_a (object_type, TYPE_MAKEFILE_INTEGRATION), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}


gpointer value_get_makefile_integration (const GValue* value) {
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_MAKEFILE_INTEGRATION), NULL);
	return value->data[0].v_pointer;
}


void value_set_makefile_integration (GValue* value, gpointer v_object) {
	MakefileIntegration* old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_MAKEFILE_INTEGRATION));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_MAKEFILE_INTEGRATION));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		makefile_integration_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		makefile_integration_unref (old);
	}
}


void value_take_makefile_integration (GValue* value, gpointer v_object) {
	MakefileIntegration* old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_MAKEFILE_INTEGRATION));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_MAKEFILE_INTEGRATION));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		makefile_integration_unref (old);
	}
}


static void makefile_integration_class_init (MakefileIntegrationClass * klass) {
	makefile_integration_parent_class = g_type_class_peek_parent (klass);
	MAKEFILE_INTEGRATION_CLASS (klass)->finalize = makefile_integration_finalize;
	g_type_class_add_private (klass, sizeof (MakefileIntegrationPrivate));
}


static void makefile_integration_instance_init (MakefileIntegration * self) {
	self->priv = MAKEFILE_INTEGRATION_GET_PRIVATE (self);
	self->ref_count = 1;
}


static void makefile_integration_finalize (MakefileIntegration* obj) {
	MakefileIntegration * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_MAKEFILE_INTEGRATION, MakefileIntegration);
	_g_object_unref0 (self->priv->d_cache);
	_g_object_unref0 (self->priv->d_file_to_makefile);
}


GType makefile_integration_get_type (void) {
	static volatile gsize makefile_integration_type_id__volatile = 0;
	if (g_once_init_enter (&makefile_integration_type_id__volatile)) {
		static const GTypeValueTable g_define_type_value_table = { value_makefile_integration_init, value_makefile_integration_free_value, value_makefile_integration_copy_value, value_makefile_integration_peek_pointer, "p", value_makefile_integration_collect_value, "p", value_makefile_integration_lcopy_value };
		static const GTypeInfo g_define_type_info = { sizeof (MakefileIntegrationClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) makefile_integration_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (MakefileIntegration), 0, (GInstanceInitFunc) makefile_integration_instance_init, &g_define_type_value_table };
		static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
		GType makefile_integration_type_id;
		makefile_integration_type_id = g_type_register_fundamental (g_type_fundamental_next (), "MakefileIntegration", &g_define_type_info, &g_define_type_fundamental_info, 0);
		g_once_init_leave (&makefile_integration_type_id__volatile, makefile_integration_type_id);
	}
	return makefile_integration_type_id__volatile;
}


gpointer makefile_integration_ref (gpointer instance) {
	MakefileIntegration* self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}


void makefile_integration_unref (gpointer instance) {
	MakefileIntegration* self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		MAKEFILE_INTEGRATION_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}


static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	if ((array != NULL) && (destroy_func != NULL)) {
		int i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}


static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}



