-SUBDIRS= include src tools testsuite examples doc
-DISTCLEANFILES = *~
-
-ACLOCAL = aclocal-1.9 -I acmacro
-AUTOMAKE_OPTIONS = gnu
+# GRAMINE_CUT_BEGIN
+SG_SUBDIRS= tools testsuite examples doc
-EXTRA_DIST = bootstrap COPYING INSTALL NEWS README README.IEEE TODO AUTHORS ChangeLog \
+SG_EXTRA_DIST = bootstrap COPYING INSTALL NEWS README README.IEEE TODO AUTHORS ChangeLog \
acmacro/aci.m4 \
tools/graspe-slave.in \
tools/MSG_visualization \
tools/MSG_visualization/colorize.pl
+# GRAMINE_CUT_END
+
+SUBDIRS= include src $(SG_SUBDIRS)
+EXTRA_DIST=$(SG_EXTRA_DIST)
+
+DISTCLEANFILES = *~
+
+ACLOCAL = aclocal-1.9 -I acmacro
+AUTOMAKE_OPTIONS = gnu
SOURCE_FILES = $(shell find . -name "*.[ch]")
TAGS: $(SOURCE_FILES)
tags: TAGS
-
+gramine:
+ rm -rf gramine-@VERSION@
+ @echo "# Setup sources..."
+ for n in `find include src -name '*.[chl]'`; do \
+ mkdir -p gramine-@VERSION@/`dirname $$n`; \
+ cp $$n gramine-@VERSION@/`dirname $$n`; \
+ done
+ @echo "# Copy sources to be generated by configury"
+ cp src/ucontext_stack.h.in src/gras_config.h.in gramine-@VERSION@/src
+ @echo "# Remove sources being part of the testsuite"
+ rm gramine-@VERSION@/src/*_unit.c
+ @echo "# Adapt the configury mechanism to the gramine context"
+ mkdir gramine-@VERSION@/acmacro
+ for n in configure Makefile.in src/Makefile.in include/Makefile.in ; do \
+ sed -e '/^# GRAMINE_CUT_BEGIN/,/^# GRAMINE_CUT_END/d' \
+ -e 's/gramine_mode=no/gramine_mode=yes/' $$n > gramine-@VERSION@/$$n; \
+ done
+ chmod +x gramine-@VERSION@/configure
+
if MAINTAINER_MODE
##
## (must be placed after any compilation tests since our overprotective flags
## let some tests fail)
+# Check whether we are doing a regular build or a GRAMINE (minimal) one
+# Next line is modified by sed when building gramine source tree
+gramine_mode=no
+if test x$gramine_mode = xyes
+then
+ USE_MAINTAINER_MODE=no
+fi
+AM_CONDITIONAL(GRAMINE_MODE,test x$gramine_mode != xno)
+
+
AM_MAINTAINER_MODE
if test x$USE_MAINTAINER_MODE = xyes
then
WARNING="This file is generated, do not edit"
AC_SUBST(WARNING)
+
# Can we rebuild the parsers?
# We really want flex and refuse other lex. So, the parser is portable and
# does not induce extra lib dependency
src/ucontext_stack.h
])
+# GRAMINE_CUT_BEGIN
+
# Testsuite
AC_CONFIG_FILES([
# examples/gras/alnem/Makefile examples/gras/alnem/test_sg
+# GRAMINE_CUT_END
AC_OUTPUT
# using this trick is ready for a "stable" release (say, in Debian).
lib_LTLIBRARIES= libsimgrid.la libgras.la
-noinst_PROGRAMS=testall
COMMON_SRC=\
\
amok/Bandwidth/bandwidth.c amok/Bandwidth/saturate.c \
amok/PeerManagement/peermanagement.c
+if GRAMINE_MODE
+else
###
### Testing infrastructure
###
# Suites and tests run in the given order.
+noinst_PROGRAMS=testall
TEST_CFILES=xbt/cunit.c xbt/ex.c \
xbt/dynar.c xbt/dict.c xbt/set.c xbt/swag.c \
xbt/config.c
testall_LDADD=libgras.la
TESTS=testall
-EXTRA_DIST+=$(testall_SOURCES)
+EXTRA_DIST+=$t(estall_SOURCES)
if MAINTAINER_MODE
cunit_unit.c: xbt/cunit.c
@exit 1
endif
endif
+endif
###
### Declare the library content