Makefile.am 4.49 KB
Newer Older
1
# This file is part of SWIFT.
2
# Copyright (c) 2012 Pedro Gonnet (pedro.gonnet@durham.ac.uk),
3
#                    Matthieu Schaller (matthieu.schaller@durham.ac.uk).
4
#
Pedro Gonnet's avatar
Pedro Gonnet committed
5
6
7
8
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
9
#
Pedro Gonnet's avatar
Pedro Gonnet committed
10
11
12
13
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
14
#
Pedro Gonnet's avatar
Pedro Gonnet committed
15
16
17
18
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

# Add the debug flag to the whole thing
19
AM_CFLAGS = -DTIMER $(HDF5_CPPFLAGS)
Pedro Gonnet's avatar
Pedro Gonnet committed
20
21

# Assign a "safe" version number
22
AM_LDFLAGS = $(HDF5_LDFLAGS) -version-info 0:0:0
Pedro Gonnet's avatar
Pedro Gonnet committed
23

24
25
26
# The git command, if available.
GIT_CMD = @GIT_CMD@

27
28
# Build the libswiftsim library
lib_LTLIBRARIES = libswiftsim.la
29
30
31
32
# Build a MPI-enabled version too?
if HAVEMPI
lib_LTLIBRARIES += libswiftsim_mpi.la
endif
Pedro Gonnet's avatar
Pedro Gonnet committed
33
34

# List required headers
Pedro Gonnet's avatar
Pedro Gonnet committed
35
include_HEADERS = space.h runner.h queue.h task.h lock.h cell.h part.h const.h \
36
    engine.h swift.h serial_io.h timers.h debug.h scheduler.h proxy.h parallel_io.h \
37
    common_io.h single_io.h multipole.h map.h tools.h partition.h clocks.h parser.h \
Pedro Gonnet's avatar
Pedro Gonnet committed
38
39
    physical_constants.h physical_constants_cgs.h potentials.h version.h \
    hydro_properties.h threadpool.h
40
41
42

# Common source files
AM_SOURCES = space.c runner.c queue.c task.c cell.c engine.c \
43
    serial_io.c timers.c debug.c scheduler.c proxy.c parallel_io.c \
44
    units.c common_io.c single_io.c multipole.c version.c map.c \
Peter W. Draper's avatar
Peter W. Draper committed
45
    kernel_hydro.c kernel_gravity.c tools.c part.c partition.c clocks.c parser.c \
Pedro Gonnet's avatar
Pedro Gonnet committed
46
    physical_constants.c potentials.c hydro_properties.c threadpool.c
47
48

# Include files for distribution, not installation.
49
nobase_noinst_HEADERS = approx_math.h atomic.h cycle.h error.h inline.h kernel_hydro.h kernel_gravity.h \
50
		 vector.h runner_doiact.h runner_doiact_grav.h units.h intrinsics.h minmax.h kick.h \
51
		 timestep.h drift.h \
52
		 gravity.h gravity_io.h \
53
		 gravity/Default/gravity.h gravity/Default/gravity_iact.h gravity/Default/gravity_io.h \
54
		 gravity/Default/gravity_debug.h gravity/Default/gravity_part.h  \
55
	 	 hydro.h hydro_io.h \
56
		 hydro/Minimal/hydro.h hydro/Minimal/hydro_iact.h hydro/Minimal/hydro_io.h \
57
                 hydro/Minimal/hydro_debug.h hydro/Minimal/hydro_part.h \
58
59
60
		 hydro/Default/hydro.h hydro/Default/hydro_iact.h hydro/Default/hydro_io.h \
                 hydro/Default/hydro_debug.h hydro/Default/hydro_part.h \
		 hydro/Gadget2/hydro.h hydro/Gadget2/hydro_iact.h hydro/Gadget2/hydro_io.h \
61
62
                 hydro/Gadget2/hydro_debug.h hydro/Gadget2/hydro_part.h \
		 hydro/Gizmo/hydro.h hydro/Gizmo/hydro_iact.h hydro/Gizmo/hydro_io.h \
63
64
65
                 hydro/Gizmo/hydro_debug.h hydro/Gizmo/hydro_part.h \
	         riemann.h \
		 riemann/riemann_hllc.h riemann/riemann_trrs.h riemann/riemann_exact.h
66

67
68
69
70
71
# Sources and flags for regular library
libswiftsim_la_SOURCES = $(AM_SOURCES)

# Sources and flags for MPI library
libswiftsim_mpi_la_SOURCES = $(AM_SOURCES)
72
libswiftsim_mpi_la_CFLAGS = $(AM_CFLAGS) -DWITH_MPI $(METIS_INCS)
73
libswiftsim_mpi_la_LDFLAGS = $(AM_LDFLAGS) -DWITH_MPI $(METIS_LIBS)
74
libswiftsim_mpi_la_SHORTNAME = mpi
Pedro Gonnet's avatar
Pedro Gonnet committed
75

76

Matthieu Schaller's avatar
Matthieu Schaller committed
77
# Versioning. If any sources change then update the version_string.h file with
78
# the current git revision and package version.
Matthieu Schaller's avatar
Matthieu Schaller committed
79
# May have a checkout without a version_string.h file and no git command (tar/zip
80
# download), allow that, but make sure we know it.
Matthieu Schaller's avatar
Matthieu Schaller committed
81
version_string.h: version_string.h.in $(AM_SOURCES) $(include_HEADERS) $(noinst_HEADERS)
82
	if test "X$(GIT_CMD)" != "X"; then \
83
	    GIT_REVISION=`$(GIT_CMD) describe --abbrev=8  --always --tags --dirty`; \
84
	    GIT_BRANCH=`$(GIT_CMD) branch | sed -n 's/^\* \(.*\)/\1/p'`; \
85
	    sed -e "s,@PACKAGE_VERSION\@,$(PACKAGE_VERSION)," \
86
	        -e "s,@GIT_REVISION\@,$${GIT_REVISION}," \
Matthieu Schaller's avatar
Matthieu Schaller committed
87
	        -e "s|@GIT_BRANCH\@|$${GIT_BRANCH}|" version_string.h.in > version_string.h; \
88
	else \
Matthieu Schaller's avatar
Matthieu Schaller committed
89
	    if test ! -f version_string.h; then \
90
	        sed -e "s,@PACKAGE_VERSION\@,$(PACKAGE_VERSION)," \
91
	            -e "s,@GIT_REVISION\@,unknown," \
Matthieu Schaller's avatar
Matthieu Schaller committed
92
		    -e "s,@GIT_BRANCH\@,unknown," version_string.h.in > version_string.h; \
93
	    fi; \
94
	fi
95

Matthieu Schaller's avatar
Matthieu Schaller committed
96
97
#  Make sure version_string.h is built first.
BUILT_SOURCES = version_string.h
98

99
#  And distribute the built files.
Matthieu Schaller's avatar
Matthieu Schaller committed
100
EXTRA_DIST = version_string.h version_string.h.in