Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Implement GRAMINE
[simgrid.git] / Makefile.am
index fd58ba8..2f656ab 100644 (file)
@@ -1,14 +1,20 @@
-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)
@@ -16,7 +22,25 @@ 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
 ##