Commit b6861c75 authored by Adrien Plazas's avatar Adrien Plazas

Port the build system to AutoMake

parent 3951b20b
Adrien Plazas <kekun.plazas@laposte.net>
This diff is collapsed.
NULL=
PREFIX=/usr
EXEC_PREFIX=$(PREFIX)
LIB_DIR = $(PREFIX)/lib64
INCLUDE_DIR = $(PREFIX)/include
SHARE=/usr/share
GIR_DIR = $(SHARE)/gir-1.0
PKG_DIR = $(SHARE)/pkgconfig
TYPELIB_DIR = $(LIB_DIR)/girepository-1.0
DEPS_DIR = $(SHARE)/vala/vapi
SRC_DIR = retro-gtk
OUT_DIR = out
VAPI_DIR = vapi
NAME=RetroGtk
DESC=Library for integrating Retro into GTK+
LIBNAME=retro-gtk
VERSION=1.0
PKGNAME=$(LIBNAME)-$(VERSION)
SO= lib$(LIBNAME).so
H= $(LIBNAME).h
VAPI= $(PKGNAME).vapi
DEPS= $(PKGNAME).deps
GIR= RetroGtk-$(VERSION).gir
TYPELIB= RetroGtk-$(VERSION).typelib
PKGCONF= $(PKGNAME).pc
FILES= \
audio/AudioDevice.vala \
audio/AudioPlayer.vala \
input/ControllerDevice.vala \
input/ControllerHandler.vala \
input/Gamepad.vala \
input/GamepadButtonType.vala \
input/GamepadConfiguration.vala \
input/GamepadConfigurationDialog.vala \
input/GamepadView.vala \
input/Keyboard.vala \
input/KeyboardState.vala \
input/Mouse.vala \
video/CairoDisplay.vala \
video/ClutterDisplay.vala \
video/Display.vala \
video/video-converter.c \
FileStreamLogger.vala \
Loop.vala \
MainLoop.vala \
Options.vala \
RetroGtk.vala \
ThreadedLoop.vala \
$(NULL)
PKG= \
gtk+-3.0 \
cairo \
clutter-gtk-1.0 \
libpulse \
retro-gobject-0.1 \
$(NULL)
SRC = $(FILES:%=$(SRC_DIR)/%)
OUT= \
$(OUT_DIR)/$(SO) \
$(OUT_DIR)/$(VAPI) \
$(OUT_DIR)/$(GIR) \
$(OUT_DIR)/$H \
$(NULL)
VALAC_OPTIONS= --save-temps --thread --target-glib 2.32
all: $(OUT) $(OUT_DIR)/$(DEPS) $(OUT_DIR)/$(TYPELIB) $(OUT_DIR)/$(PKGCONF)
$(OUT): %: $(SRC)
mkdir -p $(@D)
valac \
-b $(<D) -d $(@D) \
--library=$(LIBNAME) \
--vapi=$(VAPI) \
--gir=$(GIR) \
-H $(@D)/$H \
-o $(SO) $(SRC) \
$(PKG:%=--pkg=%) \
-X -fPIC -X -shared \
$(VALAC_OPTIONS) \
$(NULL)
@touch $@
$(OUT_DIR)/$(DEPS):
mkdir -p $(@D)
# Split deps into lines
echo $(PKG) | sed -e 's/\s\+/\n/g' > $@
$(OUT_DIR)/$(TYPELIB):
g-ir-compiler --shared-library $(LIBNAME) --output $@ $(@D)/$(GIR)
$(OUT_DIR)/$(PKGCONF):
echo "prefix="$(PREFIX) > $@
echo "exec_prefix="$(EXEC_PREFIX) >> $@
echo "libdir="$(LIB_DIR) >> $@
echo "includedir="$(INCLUDE_DIR) >> $@
echo >> $@
echo "Name: "$(NAME) >> $@
echo "Description: "$(DESC) >> $@
echo "Version: "$(VERSION) >> $@
echo "Requires: "$(PKG) >> $@
echo "Libs: -L$$""{libdir} -lretro-gtk" >> $@
echo "Cflags: -I$$""{includedir}" >> $@
install:
install $(OUT_DIR)/$(SO) $(LIB_DIR)
install $(OUT_DIR)/$H $(INCLUDE_DIR)
install $(OUT_DIR)/$(GIR) $(GIR_DIR)
install $(OUT_DIR)/$(TYPELIB) $(TYPELIB_DIR)
install $(OUT_DIR)/$(PKGCONF) $(PKG_DIR)
install $(OUT_DIR)/$(DEPS) $(DEPS_DIR)
install $(OUT_DIR)/$(VAPI) $(DEPS_DIR)
clean:
rm -Rf $(OUT_DIR)
.PHONY: all install clean
## Process this file with automake to produce Makefile.in
NULL =
SUBDIRS = retro-gtk po
dist_doc_DATA = \
README \
COPYING \
AUTHORS \
ChangeLog \
INSTALL \
NEWS \
$(NULL)
INTLTOOL_FILES = intltool-extract.in \
intltool-merge.in \
intltool-update.in \
$(NULL)
EXTRA_DIST = \
$(INTLTOOL_FILES) \
$(NULL)
DISTCLEANFILES = intltool-extract \
intltool-merge \
intltool-update \
po/.intltool-merge-cache \
$(NULL)
# Remove doc directory on uninstall
uninstall-local:
-rm -r $(docdir)
This diff is collapsed.
#!/bin/sh
# Run this to generate all the initial makefiles, etc.
srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.
DIE=0
if [ -n "$GNOME2_DIR" ]; then
ACLOCAL_FLAGS="-I $GNOME2_DIR/share/aclocal $ACLOCAL_FLAGS"
LD_LIBRARY_PATH="$GNOME2_DIR/lib:$LD_LIBRARY_PATH"
PATH="$GNOME2_DIR/bin:$PATH"
export PATH
export LD_LIBRARY_PATH
fi
(test -f $srcdir/configure.ac) || {
echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
echo " top-level package directory"
exit 1
}
(autoconf --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: You must have \`autoconf' installed."
echo "Download the appropriate package for your distribution,"
echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
DIE=1
}
(grep "^IT_PROG_INTLTOOL" $srcdir/configure.ac >/dev/null) && {
(intltoolize --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: You must have \`intltool' installed."
echo "You can get it from:"
echo " ftp://ftp.gnome.org/pub/GNOME/"
DIE=1
}
}
(grep "^AM_PROG_XML_I18N_TOOLS" $srcdir/configure.ac >/dev/null) && {
(xml-i18n-toolize --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: You must have \`xml-i18n-toolize' installed."
echo "You can get it from:"
echo " ftp://ftp.gnome.org/pub/GNOME/"
DIE=1
}
}
(grep "^LT_INIT" $srcdir/configure.ac >/dev/null) && {
(libtool --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: You must have \`libtool' installed."
echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/"
DIE=1
}
}
(grep "^AM_GLIB_GNU_GETTEXT" $srcdir/configure.ac >/dev/null) && {
(grep "sed.*POTFILES" $srcdir/configure.ac) > /dev/null || \
(glib-gettextize --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: You must have \`glib' installed."
echo "You can get it from: ftp://ftp.gtk.org/pub/gtk"
DIE=1
}
}
(automake --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: You must have \`automake' installed."
echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/"
DIE=1
NO_AUTOMAKE=yes
}
# if no automake, don't bother testing for aclocal
test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: Missing \`aclocal'. The version of \`automake'"
echo "installed doesn't appear recent enough."
echo "You can get automake from ftp://ftp.gnu.org/pub/gnu/"
DIE=1
}
if test "$DIE" -eq 1; then
exit 1
fi
if test -z "$*"; then
echo "**Warning**: I am going to run \`configure' with no arguments."
echo "If you wish to pass any to it, please specify them on the"
echo \`$0\'" command line."
echo
fi
case $CC in
xlc )
am_opt=--include-deps;;
esac
for coin in `find $srcdir -path $srcdir/CVS -prune -o -name configure.ac -print`
do
dr=`dirname $coin`
if test -f $dr/NO-AUTO-GEN; then
echo skipping $dr -- flagged as no auto-gen
else
echo processing $dr
( cd $dr
aclocalinclude="$ACLOCAL_FLAGS"
if grep "^AM_GLIB_GNU_GETTEXT" configure.ac >/dev/null; then
echo "Creating $dr/aclocal.m4 ..."
test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
echo "Running glib-gettextize... Ignore non-fatal messages."
echo "no" | glib-gettextize --force --copy
echo "Making $dr/aclocal.m4 writable ..."
test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
fi
if grep "^IT_PROG_INTLTOOL" configure.ac >/dev/null; then
echo "Running intltoolize..."
intltoolize --copy --force --automake
fi
if grep "^AM_PROG_XML_I18N_TOOLS" configure.ac >/dev/null; then
echo "Running xml-i18n-toolize..."
xml-i18n-toolize --copy --force --automake
fi
if grep "^LT_INIT" configure.ac >/dev/null; then
if test -z "$NO_LIBTOOLIZE" ; then
echo "Running libtoolize..."
libtoolize --force --copy
fi
fi
echo "Running aclocal $aclocalinclude ..."
aclocal $aclocalinclude
if grep "^A[CM]_CONFIG_HEADER" configure.ac >/dev/null; then
echo "Running autoheader..."
autoheader
fi
echo "Running automake --gnu $am_opt ..."
automake --add-missing --copy --gnu $am_opt
echo "Running autoconf ..."
autoconf
)
fi
done
if test x$NOCONFIGURE = x; then
echo Running $srcdir/configure "$@" ...
$srcdir/configure "$@" \
&& echo Now type \`make\' to compile. || exit 1
else
echo Skipping configure process.
fi
dnl Process this file with autoconf to produce a configure script.
AC_INIT(retro-gtk, 0.1)
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([1.11])
AM_SILENT_RULES([yes])
AC_PROG_CC
AM_PROG_AR
AM_PROG_VALAC
dnl ***************************************************************************
dnl Internationalization
dnl ***************************************************************************
IT_PROG_INTLTOOL([0.35.0])
GETTEXT_PACKAGE=retro-gtk
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [GETTEXT package name])
AM_GLIB_GNU_GETTEXT
AC_DISABLE_STATIC
LT_INIT
pkg_modules="gobject-2.0 glib-2.0 gtk+-3.0 cairo clutter-gtk-1.0 libpulse retro-gobject-0.1"
AC_SUBST(pkg_modules)
PKG_CHECK_MODULES(RETRO_GTK, [gobject-2.0 glib-2.0 gtk+-3.0 cairo clutter-gtk-1.0 libpulse retro-gobject-0.1])
AC_OUTPUT([
Makefile
retro-gtk/retro-gtk-0.1.pc
retro-gtk/Makefile
po/Makefile.in])
# please keep this list sorted alphabetically
#
# List of source files containing translatable strings.
## Process this file with automake to produce Makefile.in
NULL =
AM_CPPFLAGS = \
-DPACKAGE_LOCALE_DIR=\""$(localedir)"\" \
-DPACKAGE_SRC_DIR=\""$(srcdir)"\" \
-DPACKAGE_DATA_DIR=\""$(pkgdatadir)"\" \
$(RETRO_GTK_CFLAGS) \
$(NULL)
AM_CFLAGS =\
-Wall\
-g \
$(NULL)
lib_LTLIBRARIES = libretro-gtk.la
vapidir = $(datadir)/vala/vapi
dist_vapi_DATA = retro-gtk-0.1.vapi retro-gtk-0.1.deps
libretro_gtk_la_SOURCES = \
audio/AudioDevice.vala \
audio/AudioPlayer.vala \
input/ControllerDevice.vala \
input/ControllerHandler.vala \
input/Gamepad.vala \
input/GamepadButtonType.vala \
input/GamepadConfiguration.vala \
input/GamepadConfigurationDialog.vala \
input/GamepadView.vala \
input/Keyboard.vala \
input/KeyboardState.vala \
input/Mouse.vala \
video/CairoDisplay.vala \
video/ClutterDisplay.vala \
video/Display.vala \
video/video-converter.c \
FileStreamLogger.vala \
Loop.vala \
MainLoop.vala \
Options.vala \
RetroGtk.vala \
ThreadedLoop.vala \
$(NULL)
libretro_gtk_la_LDFLAGS =
libretro_gtk_la_VALAFLAGS = \
--pkg glib-2.0 \
--pkg gobject-2.0 \
--pkg gtk+-3.0 \
--pkg cairo \
--pkg clutter-gtk-1.0 \
--pkg libpulse \
--pkg retro-gobject-0.1 \
--thread \
--target-glib 2.32 \
--library retro-gtk-0.1 \
--vapi retro-gtk-0.1.vapi \
--gir RetroGtk-0.1.gir \
-H retro-gtk.h \
-X -fPIC -X -shared \
$(NULL)
libretro_gtk_la_LIBADD = $(RETRO_GTK_LIBS)
retro_gtkincludedir = $(includedir)/retro-gtk-0.1
retro_gtkinclude_HEADERS = \
retro-gtk.h \
$(NULL)
INTROSPECTION_GIRS = RetroGtk-0.1.gir
girdir = $(datadir)/gir-1.0
gir_DATA = $(INTROSPECTION_GIRS)
typelibsdir = $(libdir)/girepository-1.0
typelibs_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
RetroGtk-0.1.typelib:
g-ir-compiler --shared-library retro-gtk-0.1.so --output RetroGtk-0.1.typelib RetroGtk-0.1.gir
CLEANFILES = $(gir_DATA) $(typelibs_DATA)
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = retro-gtk-0.1.pc
EXTRA_DIST = \
retro-gtk-0.1.pc.in \
$(NULL)
gobject-2.0
glib-2.0
gtk+-3.0
cairo
clutter-gtk-1.0
libpulse
retro-gobject-0.1
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
datarootdir=@datarootdir@
datadir=@datadir@
includedir=@includedir@/retro-gtk-0.1
Name: RetroGtk
Description: Library for integrating Retro into GTK+
Version: @VERSION@
Requires: @pkg_modules@
Libs: -L${libdir} -lretro-gtk
Cflags: -I${includedir}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment