Eo: examples rule

SVN revision: 76538
This commit is contained in:
Vincent Torri 2012-09-12 16:02:31 +00:00
parent 86e07547f1
commit 0e0b265470
10 changed files with 37 additions and 194 deletions

View File

@ -35,12 +35,9 @@ COPYING \
README \
autogen.sh \
eo.pc.in \
m4/efl_benchmark.m4 \
m4/efl_doxygen.m4 \
m4/efl_examples.m4 \
m4/efl_tests.m4
m4/efl_doxygen.m4
.PHONY: doc benchmark
.PHONY: doc benchmark examples
# Documentation
@ -74,10 +71,17 @@ if EFL_ENABLE_COVERAGE
@$(MAKE) lcov-report
endif
# benchmark
benchmark:
@cd src && $(MAKE) benchmark
@mkdir result || true
@cd result && ../src/benchmarks/eo_bench `date +%F_%s`
@$(MAKE) -C src benchmark
@mkdir benchmark || true
@cd benchmark && ../src/benchmarks/eo_bench `date +%F_%s`
# examples
examples:
@$(MAKE) -C src examples
clean-local:
@rm -rf coverage benchmark

View File

@ -169,14 +169,9 @@ AC_SUBST([lt_enable_auto_import])
### Make the debug preprocessor configurable
### Unit tests, coverage and benchmarking
AC_SUBST([requirements_pc_eo])
### Build and install examples
EFL_CHECK_BUILD_EXAMPLES([enable_build_examples="yes"], [enable_build_examples="no"])
AC_CONFIG_FILES([
Makefile
eo.pc
@ -218,8 +213,8 @@ echo
echo " Documentation........: ${build_doc}"
echo " Unit Tests...........:"
echo " unit testing.......: ${_efl_enable_tests}"
echo " build..............: make check"
echo " coverage...........: ${_efl_enable_coverage}"
echo " build..............: make check"
echo " Examples.............: make examples"
echo " Benchmark............: make benchmark"
echo

View File

@ -1,33 +0,0 @@
dnl Copyright (C) 2008 Vincent Torri <vtorri at univ-evry dot fr>
dnl That code is public domain and can be freely used or copied.
dnl Macro that check if benchmark support is wanted.
dnl Usage: EFL_CHECK_BENCHMARK([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl Defines the automake conditionnal EFL_ENABLE_BENCHMARK
AC_DEFUN([EFL_CHECK_BENCHMARK],
[
dnl configure option
AC_ARG_ENABLE([benchmark],
[AC_HELP_STRING([--enable-benchmark], [enable benchmarking @<:@default=disabled@:>@])],
[
if test "x${enableval}" = "xyes" ; then
_efl_enable_benchmark="yes"
else
_efl_enable_benchmark="no"
fi
],
[_efl_enable_benchmark="no"])
AC_MSG_CHECKING([whether benchmark are built])
AC_MSG_RESULT([${_efl_enable_benchmark}])
AM_CONDITIONAL(EFL_ENABLE_BENCHMARK, test "x${_efl_enable_benchmark}" = "xyes")
AS_IF([test "x$_efl_enable_benchmark" = "xyes"], [$1], [$2])
])
dnl End of efl_benchmark.m4

View File

@ -1,63 +0,0 @@
dnl Copyright (C) 2008 Vincent Torri <vtorri at univ-evry dot fr>
dnl That code is public domain and can be freely used or copied.
dnl Macro that check if building examples is wanted.
dnl Usage: EFL_CHECK_BUILD_EXAMPLES([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl Defines the automake conditionnal EFL_ENABLE_BUILD_EXAMPLES
AC_DEFUN([EFL_CHECK_BUILD_EXAMPLES],
[
dnl configure option
AC_ARG_ENABLE([build-examples],
[AC_HELP_STRING([--enable-build-examples], [enable building examples @<:@default=disabled@:>@])],
[
if test "x${enableval}" = "xyes" ; then
_efl_enable_build_examples="yes"
else
_efl_enable_build_examples="no"
fi
],
[_efl_enable_build_examples="no"])
AC_MSG_CHECKING([whether examples are built])
AC_MSG_RESULT([${_efl_enable_build_examples}])
AM_CONDITIONAL(EFL_BUILD_EXAMPLES, test "x${_efl_enable_build_examples}" = "xyes")
AS_IF([test "x$_efl_enable_build_examples" = "xyes"], [$1], [$2])
])
dnl Macro that check if installing examples is wanted.
dnl Usage: EFL_CHECK_INSTALL_EXAMPLES([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl Defines the automake conditionnal EFL_ENABLE_INSTALL_EXAMPLES
AC_DEFUN([EFL_CHECK_INSTALL_EXAMPLES],
[
dnl configure option
AC_ARG_ENABLE([install-examples],
[AC_HELP_STRING([--enable-install-examples], [enable installing example source files @<:@default=disabled@:>@])],
[
if test "x${enableval}" = "xyes" ; then
_efl_enable_install_examples="yes"
else
_efl_enable_install_examples="no"
fi
],
[_efl_enable_install_examples="no"])
AC_MSG_CHECKING([whether examples are installed])
AC_MSG_RESULT([${_efl_enable_install_examples}])
AM_CONDITIONAL(EFL_INSTALL_EXAMPLES, test "x${_efl_enable_install_examples}" = "xyes")
AS_IF([test "x$_efl_enable_install_examples" = "xyes"], [$1], [$2])
])
dnl End of efl_examples.m4

View File

@ -1,66 +0,0 @@
dnl Copyright (C) 2008-2012 Vincent Torri <vtorri at univ-evry dot fr>
dnl That code is public domain and can be freely used or copied.
dnl Macro that check if tests programs are wanted and if yes, if
dnl the Check library is available.
dnl the lcov program is available.
dnl Usage: EFL_CHECK_TESTS(EFL[, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl Define the automake conditionnal EFL_ENABLE_TESTS
AC_DEFUN([EFL_CHECK_TESTS],
[
m4_pushdef([UPEFL], m4_translit([$1], [-a-z], [_A-Z]))dnl
dnl configure option
AC_ARG_ENABLE([tests],
[AC_HELP_STRING([--enable-tests], [enable tests @<:@default=disabled@:>@])],
[
if test "x${enableval}" = "xyes" ; then
_efl_enable_tests="yes"
else
_efl_enable_tests="no"
fi
],
[_efl_enable_tests="no"])
AC_MSG_CHECKING([whether tests are built])
AC_MSG_RESULT([${_efl_enable_tests}])
AC_REQUIRE([PKG_PROG_PKG_CONFIG])
if test "x${_efl_enable_tests}" = "xyes" ; then
PKG_CHECK_MODULES([CHECK],
[check >= 0.9.5],
[dummy="yes"],
[_efl_enable_tests="no"])
fi
_efl_enable_coverage="no"
if test "x${_efl_enable_tests}" = "xyes" ; then
AC_CHECK_PROG(have_lcov, [lcov], [yes], [no])
if test "x$have_lcov" = "xyes" ; then
m4_defn([UPEFL])[]_CFLAGS="${m4_defn([UPEFL])[]_CFLAGS} -fprofile-arcs -ftest-coverage"
m4_defn([UPEFL])[]_LIBS="${m4_defn([UPEFL])[]_LIBS} -lgcov"
# remove any optimisation flag and force debug symbols
if test "x${prefer_assert}" = "xno"; then
m4_defn([UPEFL])[]_CFLAGS="${m4_defn([UPEFL])[]_CFLAGS} -DNDEBUG"
else
m4_defn([UPEFL])[]_CFLAGS="${m4_defn([UPEFL])[]_CFLAGS} -g -O0 -DDEBUG"
fi
_efl_enable_coverage="yes"
else
AC_MSG_WARN([lcov is not found, disable profiling instrumentation])
fi
fi
AM_CONDITIONAL(EFL_ENABLE_TESTS, test "x${_efl_enable_tests}" = "xyes")
AM_CONDITIONAL(EFL_ENABLE_COVERAGE, test "x${_efl_enable_coverage}" = "xyes")
AS_IF([test "x$_efl_enable_tests" = "xyes"], [$2], [$3])
m4_popdef([UPEFL])
])
dnl End of efl_tests.m4

View File

@ -3,7 +3,12 @@ MAINTAINERCLEANFILES = Makefile.in
SUBDIRS = lib benchmarks examples tests
.PHONY: benchmark
.PHONY: benchmark examples
benchmark:
@cd benchmarks && $(MAKE) benchmark
@make -C lib
@$(MAKE) -C benchmarks benchmark
examples:
@make -C lib
@$(MAKE) -C examples examples

View File

@ -2,3 +2,8 @@
MAINTAINERCLEANFILES = Makefile.in
SUBDIRS = eo_isa evas simple
examples:
@$(MAKE) -C eo_isa examples
@$(MAKE) -C evas examples
@$(MAKE) -C simple examples

View File

@ -8,11 +8,9 @@ AM_CPPFLAGS = \
@EFL_EO_BUILD@ \
@EO_CFLAGS@
noinst_PROGRAMS =
EXTRA_PROGRAMS = eo_isa
if EFL_BUILD_EXAMPLES
noinst_PROGRAMS += eo_isa
examples: eo_isa
eo_isa_SOURCES = \
complex.c \
@ -26,5 +24,3 @@ simple.c \
simple.h
eo_isa_LDADD = $(top_builddir)/src/lib/libeo.la @EO_LIBS@
endif

View File

@ -9,12 +9,13 @@ AM_CPPFLAGS = \
@EO_CFLAGS@ \
@ELM_CFLAGS@
noinst_PROGRAMS =
EXTRA_PROGRAMS =
if EFL_BUILD_EXAMPLES
if EO_BUILD_EXAMPLE_EVAS
noinst_PROGRAMS += evas
EXTRA_PROGRAMS += evas
examples: evas
evas_SOURCES = \
elw_box.c \
@ -31,5 +32,8 @@ test.c
evas_LDADD = $(top_builddir)/src/lib/libeo.la @ELM_LIBS@ @EO_LIBS@
endif
else
examples:
endif

View File

@ -8,11 +8,9 @@ AM_CPPFLAGS = \
@EFL_EO_BUILD@ \
@EO_CFLAGS@
noinst_PROGRAMS =
EXTRA_PROGRAMS = simple
if EFL_BUILD_EXAMPLES
noinst_PROGRAMS += simple
examples: simple
simple_SOURCES = \
interface.c \
@ -24,5 +22,3 @@ simple.c \
simple.h
simple_LDADD = $(top_builddir)/src/lib/libeo.la @EO_LIBS@
endif