1# Copyright (C) 2013 INRIA 2# 3# This file is part of CMH. 4# 5# CMH is free software; you can redistribute it and/or modify it under 6# the terms of the GNU General Public License as published by the 7# Free Software Foundation; either version 3 of the License, or (at your 8# option) any later version. 9# 10# CMH is distributed in the hope that it will be useful, but WITHOUT ANY 11# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 12# FOR A PARTICULAR PURPOSE. See the GNU General Public License for 13# more details. 14# 15# You should have received a copy of the GNU General Public License 16# along with this program. If not, see http://www.gnu.org/licenses/ . 17 18AM_CFLAGS = -std=c99 -Wall 19AM_CXXFLAGS = -Wall 20 21bin_PROGRAMS = cm2 22if MPI 23bin_PROGRAMS += cm2-mpi 24endif 25 26pkglib_LTLIBRARIES = libparsepari.la 27 28lib_LTLIBRARIES = libcmh.la 29 30cm2_base = macros.h params.h cm2.h cm2.c cputime.h cputime.c factor.h factor.c io.h io.c lprintf.h lprintf.c process_status.h process_status.c quadratic_field.h quadratic_field.c lll.h lll.cpp version.h version.c 31if WANT_CUSTOM_STACK_BACKTRACES 32cm2_common = backtrace-symbols.c $(cm2_base) 33else 34cm2_common = $(cm2_base) 35endif 36 37libcmh_la_SOURCES = borchardt.h borchardt.c naive.h naive.c jinvariants.h jinvariants.c misc.h misc.c newton.h newton.c 38 39libparsepari_la_SOURCES = parsepari.h parsepari.c 40 41cm2_SOURCES = $(cm2_common) 42cm2_LDADD = libparsepari.la libcmh.la 43 44 45if MPI 46# Presently we're extracting all flags from the mpi command lines, and 47# use them with $CC, as this functionality is offered by 48# config/m4/lx_find_mpi.m4 ; another approach could be to merely detect 49# MPICC, and override CC on a per-directory basis, see the example there: 50# 51# http://stackoverflow.com/questions/3968656/how-to-compile-mpi-and-non-mpi-version-of-the-same-program-with-automake 52# 53# Note though that for this alternative approach, the advantages of using 54# $MPICC would also come with downsides: compiler validity checks should 55# be performed with both, which presently we don't do... 56cm2_mpi_SOURCES = $(cm2_common) mpicm2.h mpicm2.c mpfrx-mpi.h mpfrx-mpi.c 57cm2_mpi_CFLAGS = $(AM_CFLAGS) $(MPI_CFLAGS) -DWITH_MPI 58cm2_mpi_CXXFLAGS = $(AM_CXXFLAGS) $(MPI_CXXFLAGS) -DWITH_MPI 59cm2_mpi_LDFLAGS = $(MPI_CXXLDFLAGS) 60cm2_mpi_LDADD = libcmh.la $(MPI_CXXLDFLAGS) 61endif 62 63include_HEADERS = cmh.h 64 65