Commit 86436d9d authored by Tiago Peixoto's avatar Tiago Peixoto

Clean up Makefile.am files

Add global variables to configure.ac, to avoid unnecessary multiple
definitions.
parent 93db6fa9
......@@ -22,6 +22,7 @@ AC_CONFIG_SRCDIR(src)
AM_INIT_AUTOMAKE
AM_PROG_CC_C_O
AM_CONFIG_HEADER(config.h)
AC_CONFIG_MACRO_DIR([m4])
AC_ISC_POSIX
AC_SUBST(CXXFLAGS,$CXXFLAGS)
......@@ -242,6 +243,28 @@ AC_DEFINE_UNQUOTED([COPYRIGHT],
AC_DEFINE([GIT_COMMIT], "esyscmd(git show | head -n 1 | sed 's/commit //' | grep -o -e '.\{8\}' | head -n 1 |tr -d '\n')", [git HEAD commit hash])
AC_DEFINE([GIT_COMMIT_DATE], "esyscmd(git log -1 | head -n 3 | grep 'Date:' | sed s/'Date: '// | tr -d '\n')", [git HEAD commit date])
# set some automake variables
# CPP flags for submodules
[MOD_CPPFLAGS="-I\$(srcdir) -I\$(srcdir)/.. -I\$(srcdir)/../boost-workaround \
-DHAVE_CONFIG_H"]
AC_SUBST(MOD_CPPFLAGS)
# default directory for submodules
[MOD_DIR="${pythondir}/graph_tool"]
AC_SUBST(MOD_DIR)
# default LIBADD flags for submodules
[MOD_LIBADD="${PYTHON_LDFLAGS} ${BOOST_LDFLAGS} ${OPENMP_LDFLAGS}\
-lboost_python -lboost_iostreams -lexpat"]
AC_SUBST(MOD_LIBADD)
# needed for typeinfo objects to work across DSO boundaries.
# see http://gcc.gnu.org/faq.html#dso
[MOD_LDFLAGS="-module -avoid-version -export-dynamic -no-undefined\
-Wl,-E"]
AC_SUBST(MOD_LDFLAGS)
AC_OUTPUT([
Makefile
src/Makefile
......
## Process this file with automake to produce Makefile.in
AM_CPPFLAGS =\
-I$(srcdir)/.. \
-I$(srcdir)/../../boost-workaround \
-DHAVE_CONFIG_H
AM_CPPFLAGS = $(MOD_CPPFLAGS)
AM_CFLAGS=$(AM_CXXFLAGS)
AM_CFLAGS = $(AM_CXXFLAGS)
libgraph_tool_clusteringdir = $(pythondir)/graph_tool/clustering
......@@ -13,6 +10,10 @@ libgraph_tool_clustering_LTLIBRARIES = libgraph_tool_clustering.la
libgraph_tool_clustering_la_includedir = $(pythondir)/graph_tool/include
libgraph_tool_clustering_la_LIBADD = $(MOD_LIBADD)
libgraph_tool_clustering_la_LDFLAGS = $(MOD_LDFLAGS)
libgraph_tool_clustering_la_SOURCES = \
graph_clustering.cc \
graph_extended_clustering.cc
......@@ -20,20 +21,3 @@ libgraph_tool_clustering_la_SOURCES = \
libgraph_tool_clustering_la_include_HEADERS = \
graph_clustering.hh \
graph_extended_clustering.hh
libgraph_tool_clustering_la_LIBADD = \
$(PYTHON_LDFLAGS) \
$(BOOST_LDFLAGS) \
$(OPENMP_LDFLAGS) \
-lboost_python \
-lboost_iostreams \
-lexpat
# needed for typeinfo objects to work across DSO boundaries.
# see http://gcc.gnu.org/faq.html#dso
libgraph_tool_clustering_la_LDFLAGS = \
-module \
-avoid-version \
-export-dynamic \
-no-undefined \
-Wl,-E
## Process this file with automake to produce Makefile.in
AM_CPPFLAGS =\
-I$(srcdir)/.. \
-I$(srcdir)/../../boost-workaround \
-DHAVE_CONFIG_H
AM_CFLAGS=$(AM_CXXFLAGS)
AM_CPPFLAGS = $(MOD_CPPFLAGS)
AM_CFLAGS = $(AM_CXXFLAGS)
libgraph_tool_correlationsdir = $(pythondir)/graph_tool/correlations
......@@ -13,6 +9,10 @@ libgraph_tool_correlations_LTLIBRARIES = libgraph_tool_correlations.la
libgraph_tool_correlations_la_includedir = $(pythondir)/graph_tool/include
libgraph_tool_correlations_la_LIBADD = $(MOD_LIBADD)
libgraph_tool_correlations_la_LDFLAGS = $(MOD_LDFLAGS)
libgraph_tool_correlations_la_SOURCES = \
graph_assortativity.cc \
graph_correlations.cc \
......@@ -26,20 +26,3 @@ libgraph_tool_correlations_la_SOURCES = \
libgraph_tool_correlations_la_include_HEADERS = \
graph_assortativity.hh \
graph_correlations.hh
libgraph_tool_correlations_la_LIBADD = \
$(PYTHON_LDFLAGS) \
$(BOOST_LDFLAGS) \
$(OPENMP_LDFLAGS) \
-lboost_python \
-lboost_iostreams \
-lexpat
# needed for typeinfo objects to work across DSO boundaries.
# see http://gcc.gnu.org/faq.html#dso
libgraph_tool_correlations_la_LDFLAGS = \
-module \
-avoid-version \
-export-dynamic \
-no-undefined \
-Wl,-E
## Process this file with automake to produce Makefile.in
AM_CPPFLAGS =\
-I$(srcdir)/.. \
-I$(srcdir)/../../boost-workaround \
-DHAVE_CONFIG_H
AM_CPPFLAGS = $(MOD_CPPFLAGS)
AM_CXXFLAGS =\
-Wall \
$(PYTHON_CPPFLAGS) \
$(BOOST_CPPFLAGS)
AM_CFLAGS=$(AM_CXXFLAGS)
AM_CXXFLAGS = $(CXXFLAGS)
libgraph_tool_generationdir = $(pythondir)/graph_tool/generation
......@@ -18,25 +10,12 @@ libgraph_tool_generation_LTLIBRARIES = libgraph_tool_generation.la
libgraph_tool_generation_la_includedir = $(pythondir)/graph_tool/include
libgraph_tool_generation_la_LIBADD = $(MOD_LIBADD)
libgraph_tool_generation_la_LDFLAGS = $(MOD_LDFLAGS)
libgraph_tool_generation_la_SOURCES = \
graph_generation.cc
libgraph_tool_generation_la_include_HEADERS = \
graph_generation.hh
libgraph_tool_generation_la_LIBADD = \
$(PYTHON_LDFLAGS) \
$(BOOST_LDFLAGS) \
$(OPENMP_LDFLAGS) \
-lboost_python \
-lboost_iostreams \
-lexpat
# needed for typeinfo objects to work across DSO boundaries.
# see http://gcc.gnu.org/faq.html#dso
libgraph_tool_generation_la_LDFLAGS = \
-module \
-avoid-version \
-export-dynamic \
-no-undefined \
-Wl,-E
## Process this file with automake to produce Makefile.in
AM_CPPFLAGS =\
-I$(srcdir) -I$(srcdir)/.. \
-I$(srcdir)/../boost-workaround \
-DHAVE_CONFIG_H
AM_CPPFLAGS = $(MOD_CPPFLAGS)
AM_CFLAGS=$(AM_CXXFLAGS)
libgraph_tool_miscdir = $(pythondir)/graph_tool/misc
libgraph_tool_miscdir = $(MOD_DIR)/misc
libgraph_tool_misc_LTLIBRARIES = libgraph_tool_misc.la
libgraph_tool_misc_la_includedir = $(pythondir)/graph_tool/include
libgraph_tool_misc_la_includedir = $(MOD_DIR)/include
libgraph_tool_misc_la_LIBADD = $(MOD_LIBADD)
libgraph_tool_misc_la_LDFLAGS = $(MOD_LDFLAGS)
libgraph_tool_misc_la_SOURCES = \
graph_rewiring.cc \
......@@ -19,20 +20,3 @@ libgraph_tool_misc_la_SOURCES = \
libgraph_tool_misc_la_include_HEADERS = \
graph_rewiring.hh
libgraph_tool_misc_la_LIBADD = \
$(PYTHON_LDFLAGS) \
$(BOOST_LDFLAGS) \
$(OPENMP_LDFLAGS) \
-lboost_python \
-lboost_iostreams \
-lexpat
# needed for typeinfo objects to work across DSO boundaries.
# see http://gcc.gnu.org/faq.html#dso
libgraph_tool_misc_la_LDFLAGS = \
-module \
-avoid-version \
-export-dynamic \
-no-undefined \
-Wl,-E
## Process this file with automake to produce Makefile.in
AM_CPPFLAGS =\
-I$(srcdir) -I$(srcdir)/.. \
-I$(srcdir)/../boost-workaround \
-DHAVE_CONFIG_H
AM_CPPFLAGS = $(MOD_CPPFLAGS)
AM_CFLAGS=$(AM_CXXFLAGS)
AM_CFLAGS = $(AM_CXXFLAGS)
libgraph_tool_utildir = $(pythondir)/graph_tool/util
......@@ -13,26 +10,13 @@ libgraph_tool_util_LTLIBRARIES = libgraph_tool_util.la
libgraph_tool_util_la_includedir = $(pythondir)/graph_tool/include
libgraph_tool_util_la_LIBADD = $(MOD_LIBADD)
libgraph_tool_util_la_LDFLAGS = $(MOD_LDFLAGS)
libgraph_tool_util_la_SOURCES = \
graph_search.cc \
graph_util_bind.cc
libgraph_tool_util_la_include_HEADERS = \
graph_search.hh
libgraph_tool_util_la_LIBADD = \
$(PYTHON_LDFLAGS) \
$(BOOST_LDFLAGS) \
$(OPENMP_LDFLAGS) \
-lboost_python \
-lboost_iostreams \
-lexpat
# needed for typeinfo objects to work across DSO boundaries.
# see http://gcc.gnu.org/faq.html#dso
libgraph_tool_util_la_LDFLAGS = \
-module \
-avoid-version \
-export-dynamic \
-no-undefined \
-Wl,-E
......@@ -7,44 +7,44 @@ graph_tool_PYTHON = \
io.py \
all.py
graph_tooldir = $(pythondir)/graph_tool
graph_tooldir = $(MOD_DIR)
graph_tool_run_action_PYTHON = \
run_action/__init__.py \
run_action/inline.py \
run_action/run_action_template.hh
graph_tool_run_actiondir = $(pythondir)/graph_tool/run_action
graph_tool_run_actiondir = $(MOD_DIR)/run_action
graph_tool_test_PYTHON = \
test/__init__.py \
test/basic.py \
test/properties.py
graph_tool_testdir = $(pythondir)/graph_tool/test
graph_tool_testdir = $(MOD_DIR)/test
graph_tool_generation_PYTHON = \
generation/__init__.py
graph_tool_generationdir = $(pythondir)/graph_tool/generation
graph_tool_generationdir = $(MOD_DIR)/generation
graph_tool_correlations_PYTHON = \
correlations/__init__.py
graph_tool_correlationsdir = $(pythondir)/graph_tool/correlations
graph_tool_correlationsdir = $(MOD_DIR)/correlations
graph_tool_stats_PYTHON = \
stats/__init__.py
graph_tool_statsdir = $(pythondir)/graph_tool/stats
graph_tool_statsdir = $(MOD_DIR)/stats
graph_tool_clustering_PYTHON = \
clustering/__init__.py
graph_tool_clusteringdir = $(pythondir)/graph_tool/clustering
graph_tool_clusteringdir = $(MOD_DIR)/clustering
graph_tool_draw_PYTHON = \
draw/__init__.py
graph_tool_drawdir = $(pythondir)/graph_tool/draw
graph_tool_drawdir = $(MOD_DIR)/draw
graph_tool_util_PYTHON = \
util/__init__.py
graph_tool_utildir = $(pythondir)/graph_tool/util
graph_tool_utildir = $(MOD_DIR)/util
graph_tool_misc_PYTHON = \
misc/__init__.py
graph_tool_miscdir = $(pythondir)/graph_tool/misc
graph_tool_miscdir = $(MOD_DIR)/misc
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