mutter/clutter/Makefile.am
Robert Bragg 43efab46bc Intial Re-layout of the Cogl source code and introduction of a Cogl Winsys
As part of an incremental process to have Cogl be a standalone project we
want to re-consider how we organise the Cogl source code.

Currently this is the structure I'm aiming for:
cogl/
    cogl/
	<put common source here>
	winsys/
	   cogl-glx.c
	   cogl-wgl.c
	driver/
	    gl/
	    gles/
	os/ ?
    utils/
	cogl-fixed
	cogl-matrix-stack?
        cogl-journal?
        cogl-primitives?
    pango/

The new winsys component is a starting point for migrating window system
code (i.e.  x11,glx,wgl,osx,egl etc) from Clutter to Cogl.

The utils/ and pango/ directories aren't added by this commit, but they are
noted because I plan to add them soon.

Overview of the planned structure:

* The winsys/ API is the API that binds OpenGL to a specific window system,
  be that X11 or win32 etc.  Example are glx, wgl and egl. Much of the logic
  under clutter/{glx,osx,win32 etc} should migrate here.

* Note there is also the idea of a winsys-base that may represent a window
  system for which there are multiple winsys APIs.  An example of this is
  x11, since glx and egl may both be used with x11.  (currently only Clutter
  has the idea of a winsys-base)

* The driver/ represents a specific varient of OpenGL. Currently we have "gl"
  representing OpenGL 1.4-2.1 (mostly fixed function) and "gles" representing
  GLES 1.1 (fixed funciton) and 2.0 (fully shader based)

* Everything under cogl/ should fundamentally be supporting access to the
  GPU.  Essentially Cogl's most basic requirement is to provide a nice GPU
  Graphics API and drawing a line between this and the utility functionality
  we add to support Clutter should help keep this lean and maintainable.

* Code under utils/ as suggested builds on cogl/ adding more convenient
  APIs or mechanism to optimize special cases. Broadly speaking you can
  compare cogl/ to OpenGL and utils/ to GLU.

* clutter/pango will be moved to clutter/cogl/pango

How some of the internal configure.ac/pkg-config terminology has changed:
backendextra -> CLUTTER_WINSYS_BASE # e.g. "x11"
backendextralib -> CLUTTER_WINSYS_BASE_LIB # e.g. "x11/libclutter-x11.la"
clutterbackend -> {CLUTTER,COGL}_WINSYS # e.g. "glx"
CLUTTER_FLAVOUR -> {CLUTTER,COGL}_WINSYS
clutterbackendlib -> CLUTTER_WINSYS_LIB
CLUTTER_COGL -> COGL_DRIVER # e.g. "gl"

Note: The CLUTTER_FLAVOUR and CLUTTER_COGL defines are kept for apps

As the first thing to take advantage of the new winsys component in Cogl;
cogl_get_proc_address() has been moved from cogl/{gl,gles}/cogl.c into
cogl/common/cogl.c and this common implementation first trys
_cogl_winsys_get_proc_address() but if that fails then it falls back to
gmodule.
2009-10-16 18:58:50 +01:00

302 lines
9.8 KiB
Makefile

include $(top_srcdir)/build/autotools/Makefile.am.silent
NULL =
SUBDIRS = cogl pango $(CLUTTER_WINSYS_BASE) $(CLUTTER_WINSYS)
if LOCAL_JSON_GLIB
SUBDIRS += json
clutter_json_include = -I$(top_srcdir)/clutter/json
clutter_json_dep = json/libclutter-json.la
clutter_json_libadd = $(top_builddir)/clutter/json/libclutter-json.la
clutter_json_gir = ClutterJson-@CLUTTER_API_VERSION@.gir
endif
DIST_SUBDIRS = pango glx eglx eglnative cogl sdl json osx x11 win32 fruity
# common definitions
CLEANFILES =
DISTCLEANFILES =
EXTRA_DIST =
BUILT_SOURCES =
INCLUDES = \
-I$(top_srcdir) \
-I$(top_srcdir)/clutter/cogl \
-I$(top_srcdir)/clutter/pango \
-I$(top_srcdir)/clutter \
$(clutter_json_include) \
-I$(top_builddir)/clutter/cogl \
-I$(top_builddir)/clutter \
$(NULL)
AM_CPPFLAGS = \
-DCLUTTER_PREFIX=\""$(prefix)"\" \
-DCLUTTER_LIBDIR=\""$(libdir)"\" \
-DCLUTTER_DATADIR=\""$(datadir)"\" \
-DCLUTTER_COMPILATION=1 \
-DG_DISABLE_DEPRECATED \
-DG_DISABLE_SINGLE_INCLUDES \
-DG_LOG_DOMAIN=\"Clutter\" \
$(NULL)
AM_CFLAGS = $(CLUTTER_CFLAGS) $(CLUTTER_DEBUG_CFLAGS) $(MAINTAINER_CFLAGS)
LDADD = \
$(CLUTTER_LT_LDFLAGS) \
-export-dynamic \
-export-symbols-regex "^(clutter|cogl|json|pango).*" \
-rpath $(libdir) \
$(NULL)
# please, keep this sorted alphabetically
source_h = \
$(srcdir)/clutter-actor.h \
$(srcdir)/clutter-alpha.h \
$(srcdir)/clutter-animatable.h \
$(srcdir)/clutter-animation.h \
$(srcdir)/clutter-backend.h \
$(srcdir)/clutter-behaviour.h \
$(srcdir)/clutter-behaviour-depth.h \
$(srcdir)/clutter-behaviour-ellipse.h \
$(srcdir)/clutter-behaviour-opacity.h \
$(srcdir)/clutter-behaviour-path.h \
$(srcdir)/clutter-behaviour-rotate.h \
$(srcdir)/clutter-behaviour-scale.h \
$(srcdir)/clutter-binding-pool.h \
$(srcdir)/clutter-cairo-texture.h \
$(srcdir)/clutter-child-meta.h \
$(srcdir)/clutter-clone.h \
$(srcdir)/clutter-color.h \
$(srcdir)/clutter-container.h \
$(srcdir)/clutter-deprecated.h \
$(srcdir)/clutter-event.h \
$(srcdir)/clutter-feature.h \
$(srcdir)/clutter-fixed.h \
$(srcdir)/clutter-frame-source.h \
$(srcdir)/clutter-group.h \
$(srcdir)/clutter-interval.h \
$(srcdir)/clutter-keysyms.h \
$(srcdir)/clutter-list-model.h \
$(srcdir)/clutter-main.h \
$(srcdir)/clutter-media.h \
$(srcdir)/clutter-model.h \
$(srcdir)/clutter-path.h \
$(srcdir)/clutter-rectangle.h \
$(srcdir)/clutter-score.h \
$(srcdir)/clutter-script.h \
$(srcdir)/clutter-scriptable.h \
$(srcdir)/clutter-shader.h \
$(srcdir)/clutter-shader-types.h \
$(srcdir)/clutter-stage.h \
$(srcdir)/clutter-stage-manager.h \
$(srcdir)/clutter-stage-window.h \
$(srcdir)/clutter-texture.h \
$(srcdir)/clutter-text.h \
$(srcdir)/clutter-timeline.h \
$(srcdir)/clutter-timeout-pool.h \
$(srcdir)/clutter-types.h \
$(srcdir)/clutter-units.h \
$(srcdir)/clutter-util.h \
$(top_builddir)/clutter/clutter-version.h \
$(NULL)
# glib-genmarshal rules
glib_marshal_list = clutter-marshal.list
glib_marshal_prefix = clutter_marshal
include $(top_srcdir)/build/autotools/Makefile.am.marshal
# glib-mkenums rules
glib_enum_h = clutter-enum-types.h
glib_enum_c = clutter-enum-types.c
glib_enum_headers = $(source_h)
include $(top_srcdir)/build/autotools/Makefile.am.enums
# please, keep this sorted alphabetically
source_c = \
$(srcdir)/clutter-actor.c \
$(srcdir)/clutter-alpha.c \
$(srcdir)/clutter-animatable.c \
$(srcdir)/clutter-animation.c \
$(srcdir)/clutter-backend.c \
$(srcdir)/clutter-behaviour.c \
$(srcdir)/clutter-behaviour-depth.c \
$(srcdir)/clutter-behaviour-ellipse.c \
$(srcdir)/clutter-behaviour-opacity.c \
$(srcdir)/clutter-behaviour-path.c \
$(srcdir)/clutter-behaviour-rotate.c \
$(srcdir)/clutter-behaviour-scale.c \
$(srcdir)/clutter-bezier.c \
$(srcdir)/clutter-binding-pool.c \
$(srcdir)/clutter-cairo-texture.c \
$(srcdir)/clutter-child-meta.c \
$(srcdir)/clutter-clone.c \
$(srcdir)/clutter-color.c \
$(srcdir)/clutter-container.c \
clutter-enum-types.c \
$(srcdir)/clutter-event.c \
$(srcdir)/clutter-feature.c \
$(srcdir)/clutter-fixed.c \
$(srcdir)/clutter-frame-source.c \
$(srcdir)/clutter-group.c \
$(srcdir)/clutter-id-pool.c \
$(srcdir)/clutter-interval.c \
$(srcdir)/clutter-list-model.c \
$(srcdir)/clutter-main.c \
clutter-marshal.c \
$(srcdir)/clutter-master-clock.c \
$(srcdir)/clutter-media.c \
$(srcdir)/clutter-model.c \
$(srcdir)/clutter-path.c \
$(srcdir)/clutter-rectangle.c \
$(srcdir)/clutter-score.c \
$(srcdir)/clutter-script.c \
$(srcdir)/clutter-script-parser.c \
$(srcdir)/clutter-scriptable.c \
$(srcdir)/clutter-shader.c \
$(srcdir)/clutter-shader-types.c \
$(srcdir)/clutter-stage.c \
$(srcdir)/clutter-stage-manager.c \
$(srcdir)/clutter-stage-window.c \
$(srcdir)/clutter-texture.c \
$(srcdir)/clutter-text.c \
$(srcdir)/clutter-timeline.c \
$(srcdir)/clutter-timeout-interval.c \
$(srcdir)/clutter-timeout-pool.c \
$(srcdir)/clutter-units.c \
$(srcdir)/clutter-util.c \
$(NULL)
source_h_priv = \
$(srcdir)/clutter-bezier.h \
$(srcdir)/clutter-debug.h \
$(srcdir)/clutter-keysyms-table.h \
$(srcdir)/clutter-master-clock.h \
$(srcdir)/clutter-model-private.h \
$(srcdir)/clutter-private.h \
$(srcdir)/clutter-id-pool.h \
$(srcdir)/clutter-script-private.h \
$(srcdir)/clutter-timeout-interval.h \
$(NULL)
libclutter_@CLUTTER_WINSYS@_@CLUTTER_API_VERSION@_la_LIBADD = \
$(CLUTTER_LIBS) \
$(top_builddir)/clutter/cogl/cogl/libclutter-cogl.la \
$(top_builddir)/clutter/pango/libcoglpango.la \
$(top_builddir)/clutter/$(CLUTTER_WINSYS)/libclutter-$(CLUTTER_WINSYS).la \
$(clutter_json_libadd) \
$(CLUTTER_WINSYS_BASE_LIB)
libclutter_@CLUTTER_WINSYS@_@CLUTTER_API_VERSION@_la_DEPENDENCIES = \
$(top_builddir)/clutter/cogl/cogl/libclutter-cogl.la \
$(top_builddir)/clutter/pango/libcoglpango.la \
$(top_builddir)/clutter/$(CLUTTER_WINSYS)/libclutter-$(CLUTTER_WINSYS).la \
$(clutter_json_dep) \
$(CLUTTER_WINSYS_BASE_LIB)
libclutter_@CLUTTER_WINSYS@_@CLUTTER_API_VERSION@_la_SOURCES = \
$(source_c) \
$(source_h) \
$(source_h_priv)
libclutter_@CLUTTER_WINSYS@_@CLUTTER_API_VERSION@_la_LDFLAGS = $(LDADD)
lib_LTLIBRARIES = $(CLUTTER_WINSYS_LIB)
EXTRA_LTLIBRARIES = libclutter-@CLUTTER_WINSYS@-@CLUTTER_API_VERSION@.la
clutterdir = $(includedir)/clutter-$(CLUTTER_API_VERSION)/clutter
clutter_HEADERS = \
$(source_h) \
$(top_builddir)/clutter/clutter-json.h \
$(top_builddir)/clutter/clutter-enum-types.h \
$(top_srcdir)/clutter/clutter.h
DISTCLEANFILES += clutter-version.h
EXTRA_DIST += clutter-version.h.in
if HAVE_INTROSPECTION
BUILT_GIRSOURCES =
if LOCAL_JSON_GLIB
json_gir_include_path=--add-include-path=json
json_gir_include=--include=ClutterJson-@CLUTTER_API_VERSION@
else
json_gir_include=--include=Json-1.0
endif
# We can't reference the list of COGL header files, since they are in a
# subdir Makefile.am, so just extract them from cogl.h instead. The doc
# comments for COGL are in the headers, so we don't need the source files.
Clutter-@CLUTTER_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libclutter-@CLUTTER_WINSYS@-@CLUTTER_API_VERSION@.la
$(QUIET_GEN)$(INTROSPECTION_SCANNER) -v \
--namespace Clutter --nsversion=@CLUTTER_API_VERSION@ \
$(INCLUDES) \
--add-include-path=cogl/cogl \
$(json_gir_include_path) \
--c-include='clutter/clutter.h' \
--include=GL-1.0 \
--include=GObject-2.0 \
--include=Pango-1.0 \
--include=PangoCairo-1.0 \
--include=Cogl-@CLUTTER_API_VERSION@ \
$(json_gir_include) \
--library=libclutter-@CLUTTER_WINSYS@-@CLUTTER_API_VERSION@.la \
--libtool="$(top_builddir)/libtool" \
--pkg gobject-2.0 \
--pkg pango \
--pkg pangocairo \
--output $@ \
$(clutter_HEADERS) \
$(source_c)
BUILT_GIRSOURCES += Clutter-@CLUTTER_API_VERSION@.gir
# ClutterJson.gir and Cogl.gir are used included into Clutter.gir, so need
# to be built before the typelib is generated
Clutter-@CLUTTER_API_VERSION@.typelib: $(clutter_json_gir) Cogl-@CLUTTER_API_VERSION@.gir
# We build Cogl.gir in the cogl/ subdir, but it needs to reference the shared
# library that it's built into, so we delay compiling the gir into typelib
# until after we've built the shared library. To create the final Cogl.gir
# that we compile and install, we transfer the shared-library="" line from
# Clutter.gir to Cogl.gir
Cogl-@CLUTTER_API_VERSION@.gir: Clutter-@CLUTTER_API_VERSION@.gir cogl/Cogl-@CLUTTER_API_VERSION@.gir
$(QUIET_GEN) \
shlib=`sed -n 's/.*shared-library="\([^"]*\)".*/\1/p' < Clutter-@CLUTTER_API_VERSION@.gir` ; \
sed "s/shared-library=\"[^\"]*\"/shared-library=\"$$shlib\"/"< cogl/Cogl-@CLUTTER_API_VERSION@.gir > $@
BUILT_GIRSOURCES += Cogl-@CLUTTER_API_VERSION@.gir
if LOCAL_JSON_GLIB
# If we are building it, ClutterJson gets the same handling as described
# for Cogl above
ClutterJson-@CLUTTER_API_VERSION@.gir: Clutter-@CLUTTER_API_VERSION@.gir json/ClutterJson-@CLUTTER_API_VERSION@.gir
$(QUIET_GEN) \
shlib=`sed -n 's/.*shared-library="\([^"]*\)".*/\1/p' < Clutter-@CLUTTER_API_VERSION@.gir` ; \
sed "s/shared-library=\"[^\"]*\"/shared-library=\"$$shlib\"/"< json/ClutterJson-@CLUTTER_API_VERSION@.gir > $@
BUILT_GIRSOURCES += ClutterJson-@CLUTTER_API_VERSION@.gir
endif
# INTROSPECTION_GIRDIR/INTROSPECTION_TYPELIBDIR aren't the right place to
# install anything - we need to install inside our prefix.
girdir = $(datadir)/gir-1.0
gir_DATA = $(BUILT_GIRSOURCES)
typelibsdir = $(libdir)/girepository-1.0/
typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib)
%.typelib: %.gir $(INTROSPECTION_COMPILER)
$(QUIET_GEN) \
LD_LIBRARY_PATH=.libs$${LD_LIBRARY_PATH:+:$$LD_LIBRARY_PATH} \
$(INTROSPECTION_COMPILER) \
--includedir=$(srcdir) \
--includedir=. \
$(INTROSPECTION_COMPILER_OPTS) $< -o $(@F)
CLEANFILES += $(BUILT_GIRSOURCES) $(typelibs_DATA)
endif