Use standard GObject Introspection make rules

Instead of defining rules manually, use the included make support,
which means Makefiles are less prone to API changes, support
verbosity correctly (instead of inconsistently hardcoding --quiet),
are cleaner to read, and emit GISCAN/GICOMP instead of GEN (which
is nicer).

https://bugzilla.gnome.org/show_bug.cgi?id=643371
This commit is contained in:
Giovanni Campagna 2011-02-26 18:29:53 +01:00
parent 3bee2e4228
commit 6e3c15e2ab
4 changed files with 45 additions and 107 deletions

View File

@ -93,6 +93,8 @@ GJS_VERSION=`$PKG_CONFIG --modversion gjs-internals-1.0`
AC_DEFINE_UNQUOTED([GJS_VERSION], ["$GJS_VERSION"], [The version of GJS we're linking to]) AC_DEFINE_UNQUOTED([GJS_VERSION], ["$GJS_VERSION"], [The version of GJS we're linking to])
AC_SUBST([GJS_VERSION], ["$GJS_VERSION"]) AC_SUBST([GJS_VERSION], ["$GJS_VERSION"])
GOBJECT_INTROSPECTION_CHECK([$GOBJECT_INTROSPECTION_MIN_VERSION])
saved_CFLAGS=$CFLAGS saved_CFLAGS=$CFLAGS
saved_LIBS=$LIBS saved_LIBS=$LIBS
CFLAGS=$MUTTER_PLUGIN_CFLAGS CFLAGS=$MUTTER_PLUGIN_CFLAGS

View File

@ -30,8 +30,7 @@ libgvc_la_gir_sources = \
gvc/gvc-mixer-event-role.h \ gvc/gvc-mixer-event-role.h \
gvc/gvc-mixer-event-role.c \ gvc/gvc-mixer-event-role.c \
gvc/gvc-mixer-control.h \ gvc/gvc-mixer-control.h \
gvc/gvc-mixer-control.c \ gvc/gvc-mixer-control.c
gvc/gvc-pulseaudio-fake.h
libgvc_la_private_sources = \ libgvc_la_private_sources = \
gvc/gvc-mixer-stream-private.h \ gvc/gvc-mixer-stream-private.h \
@ -44,26 +43,9 @@ libgvc_la_SOURCES = \
$(libgvc_la_gir_sources) \ $(libgvc_la_gir_sources) \
$(libgvc_la_private_sources) $(libgvc_la_private_sources)
Gvc-1.0.gir: $(G_IR_SCANNER) libgvc.la Makefile Gvc-1.0.gir: libgvc.la
$(AM_V_GEN) $(G_IR_SCANNER) \ Gvc_1_0_gir_INCLUDES = GObject-2.0
--namespace=Gvc \ Gvc_1_0_gir_CFLAGS = $(INCLUDES) -I$(srcdir)/gvc -DWITH_INTROSPECTION
--nsversion=1.0 \ Gvc_1_0_gir_LIBS = libgvc.la
--warn-all \ Gvc_1_0_gir_FILES = $(addprefix $(srcdir)/,$(libgvc_la_gir_sources))
--quiet \ INTROSPECTION_GIRS += Gvc-1.0.gir
--libtool="$(LIBTOOL)" \
--add-include-path=$(builddir) \
--include=GObject-2.0 \
--library=libgvc.la \
--identifier-prefix=Gvc \
--symbol-prefix=gvc_ \
$(addprefix $(srcdir)/,$(libgvc_la_gir_sources)) \
$(INCLUDES) \
-I $(srcdir) \
-I $(srcdir)/gvc \
-DWITH_INTROSPECTION \
-o $@
CLEANFILES += Gvc-1.0.gir
Gvc-1.0.typelib: Gvc-1.0.gir
$(AM_V_GEN) $(G_IR_COMPILER) $< -o $@
CLEANFILES += Gvc-1.0.typelib

View File

@ -7,7 +7,15 @@ libexec_PROGRAMS =
noinst_LTLIBRARIES = noinst_LTLIBRARIES =
noinst_PROGRAMS = noinst_PROGRAMS =
.AUTOPARALLEL: -include $(INTROSPECTION_MAKEFILE)
INTROSPECTION_GIRS =
INTROSPECTION_SCANNER_ARGS = --warn-all --warn-error --add-include-path=$(srcdir)
INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir) --includedir=$(MUTTER_LIB_DIR)/mutter/
typelibdir = $(pkglibdir)
typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
CLEANFILES += $(gir_DATA) $(typelib_DATA)
generated_bin_scripts = gnome-shell-installed gnome-shell-jhbuild gnome-shell-extension-tool generated_bin_scripts = gnome-shell-installed gnome-shell-jhbuild gnome-shell-extension-tool
bin_SCRIPTS += gnome-shell $(generated_bin_scripts) bin_SCRIPTS += gnome-shell $(generated_bin_scripts)
@ -238,83 +246,29 @@ libgnome_shell_la_LIBADD = \
libgnome_shell_la_CPPFLAGS = $(gnome_shell_cflags) $(LIBECAL_CFLAGS) libgnome_shell_la_CPPFLAGS = $(gnome_shell_cflags) $(LIBECAL_CFLAGS)
typelibdir = $(pkglibdir) Shell-0.1.gir: libgnome-shell.la St-1.0.gir
typelib_DATA = Shell-0.1.typelib St-1.0.typelib Gdm-1.0.typelib Gvc-1.0.typelib Shell_0_1_gir_INCLUDES = Clutter-1.0 ClutterX11-1.0 Meta-2.91 TelepathyGLib-0.12
Shell_0_1_gir_CFLAGS = $(libgnome_shell_la_CPPFLAGS) -I $(srcdir)
Shell-0.1.gir: $(mutter) $(G_IR_SCANNER) St-1.0.gir libgnome-shell.la Makefile Shell_0_1_gir_LIBS = libgnome-shell.la
$(AM_V_GEN) $(G_IR_SCANNER) \ Shell_0_1_gir_FILES = $(addprefix $(srcdir)/,$(libgnome_shell_la_gir_sources))
--namespace=Shell \ Shell_0_1_gir_SCANNERFLAGS = --include-uninstalled=$(builddir)/St-1.0.gir \
--nsversion=0.1 \
--warn-all \
--warn-error \
--add-include-path=$(MUTTER_LIB_DIR)/mutter/ \ --add-include-path=$(MUTTER_LIB_DIR)/mutter/ \
--include=Clutter-1.0 \
--include=ClutterX11-1.0 \
--include=Meta-2.91 \
--include=TelepathyGLib-0.12 \
--libtool="$(LIBTOOL)" \
--add-include-path=$(builddir) \
--include=St-1.0 \
--program=mutter \ --program=mutter \
--program-arg=--mutter-plugins=$$(pwd)/libgnome-shell.la \ --program-arg=--mutter-plugins=`pwd`/libgnome-shell.la
$(addprefix $(srcdir)/,$(libgnome_shell_la_gir_sources)) \ INTROSPECTION_GIRS += Shell-0.1.gir
$(libgnome_shell_la_CPPFLAGS) \
-I $(srcdir) \
-o $@
CLEANFILES += Shell-0.1.gir
# The dependency on libgnome-shell.la here is because g-ir-compiler opens it St-1.0.gir: libst-1.0.la
# (not the fake library, since we've already done the rewriting) St_1_0_gir_INCLUDES = Clutter-1.0 Gtk-3.0
Shell-0.1.typelib: libgnome-shell.la Shell-0.1.gir St_1_0_gir_CFLAGS = $(st_cflags) -DST_COMPILATION
$(AM_V_GEN) \ St_1_0_gir_LIBS = libst-1.0.la
$(G_IR_COMPILER) \ St_1_0_gir_FILES = $(filter-out %-private.h $(st_non_gir_sources), $(addprefix $(srcdir)/,$(st_source_h))) \
--includedir=. \ $(addprefix $(srcdir)/,$(st_source_c))
--includedir=$(MUTTER_LIB_DIR)/mutter/ \ INTROSPECTION_GIRS += St-1.0.gir
Shell-0.1.gir -o $@
CLEANFILES += Shell-0.1.typelib
St-1.0.gir: $(mutter) $(G_IR_SCANNER) libst-1.0.la Makefile
$(AM_V_GEN) $(G_IR_SCANNER) \
--namespace=St \
--nsversion=1.0 \
--warn-all \
--warn-error \
--include=Clutter-1.0 \
--include=Gtk-3.0 \
--add-include-path=$(builddir) \
--libtool="$(LIBTOOL)" \
--library=libst-1.0.la \
-DST_COMPILATION \
$(filter-out %-private.h $(st_non_gir_sources), $(addprefix $(srcdir)/,$(st_source_h))) \
$(addprefix $(srcdir)/,$(st_source_c)) \
$(srcdir)/st-enum-types.h \
$(st_cflags) \
-o $@
CLEANFILES += St-1.0.gir
St-1.0.typelib: St-1.0.gir
$(AM_V_GEN) $(G_IR_COMPILER) \
$< -o $@
CLEANFILES += St-1.0.typelib
Gdm-1.0.gir: $(mutter) $(G_IR_SCANNER) libgdmuser-1.0.la Makefile
$(AM_V_GEN) $(G_IR_SCANNER) \
--namespace=Gdm \
--nsversion=1.0 \
--warn-all \
--warn-error \
--include=GObject-2.0 \
--include=GdkPixbuf-2.0 \
--libtool="$(LIBTOOL)" \
--library=libgdmuser-1.0.la \
$(filter-out %-private.h, $(addprefix $(srcdir)/,$(gdmuser_source_h))) \
$(addprefix $(srcdir)/,$(gdmuser_source_c)) \
$(gdmuser_cflags) \
-o $@
CLEANFILES += Gdm-1.0.gir
Gdm-1.0.typelib: Gdm-1.0.gir
$(AM_V_GEN) $(G_IR_COMPILER) Gdm-1.0.gir -o $@
CLEANFILES += Gdm-1.0.typelib
Gdm-1.0.gir: libgdmuser-1.0.la
Gdm_1_0_gir_INCLUDES = GObject-2.0 GdkPixbuf-2.0
Gdm_1_0_gir_CFLAGS = $(gdmuser_cflags)
Gdm_1_0_gir_LIBS = libgdmuser-1.0.la
Gdm_1_0_gir_FILES = $(filter-out %-private.h, $(addprefix $(srcdir)/,$(gdmuser_source_h))) \
$(addprefix $(srcdir)/,$(gdmuser_source_c))
INTROSPECTION_GIRS += Gdm-1.0.gir

View File

@ -24,9 +24,9 @@
#ifdef WITH_INTROSPECTION #ifdef WITH_INTROSPECTION
#ifndef PA_API_VERSION #ifndef PA_API_VERSION
typedef int pa_channel_position_t; #define pa_channel_position_t int
typedef guint32 pa_volume_t; #define pa_volume_t guint32
typedef gpointer pa_context; #define pa_context gpointer
#endif /* PA_API_VERSION */ #endif /* PA_API_VERSION */
#endif /* WITH_INTROSPECTION */ #endif /* WITH_INTROSPECTION */