Makefile.am 5.87 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) $(FFTW_LIBS) -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
29
30
31
32
33
# Additional dependencies for shared libraries.
EXTRA_LIBS = $(HDF5_LIBS) $(PROFILER_LIBS) $(TCMALLOC_LIBS)

# MPI libraries.
MPI_LIBS = $(METIS_LIBS) $(MPI_THREAD_LIBS)
MPI_FLAGS = -DWITH_MPI $(METIS_INCS)

34
35
# Build the libswiftsim library
lib_LTLIBRARIES = libswiftsim.la
36
37
38
39
# Build a MPI-enabled version too?
if HAVEMPI
lib_LTLIBRARIES += libswiftsim_mpi.la
endif
Pedro Gonnet's avatar
Pedro Gonnet committed
40
41

# List required headers
Pedro Gonnet's avatar
Pedro Gonnet committed
42
include_HEADERS = space.h runner.h queue.h task.h lock.h cell.h part.h const.h \
43
    engine.h swift.h serial_io.h timers.h debug.h scheduler.h proxy.h parallel_io.h \
44
    common_io.h single_io.h multipole.h map.h tools.h partition.h clocks.h parser.h \
45
    physical_constants.h physical_constants_cgs.h potential.h version.h \
46
    hydro_properties.h riemann.h threadpool.h cooling.h cooling_struct.h sourceterms.h \
James Willis's avatar
James Willis committed
47
    sourceterms_struct.h statistics.h memswap.h cache.h runner_doiact_vec.h
48
49
50

# Common source files
AM_SOURCES = space.c runner.c queue.c task.c cell.c engine.c \
51
    serial_io.c timers.c debug.c scheduler.c proxy.c parallel_io.c \
52
    units.c common_io.c single_io.c multipole.c version.c map.c \
Matthieu Schaller's avatar
Matthieu Schaller committed
53
    kernel_hydro.c tools.c part.c partition.c clocks.c parser.c \
54
    physical_constants.c potential.c hydro_properties.c \
55
    runner_doiact_fft.c threadpool.c cooling.c sourceterms.c \
56
    statistics.c runner_doiact_vec.c
57
58

# Include files for distribution, not installation.
59
nobase_noinst_HEADERS = align.h approx_math.h atomic.h cycle.h error.h inline.h kernel_hydro.h kernel_gravity.h \
60
		 kernel_long_gravity.h vector.h cache.h runner_doiact.h runner_doiact_vec.h runner_doiact_grav.h runner_doiact_fft.h \
Matthieu Schaller's avatar
Matthieu Schaller committed
61
                 units.h intrinsics.h minmax.h kick.h timestep.h drift.h adiabatic_index.h io_properties.h \
62
		 dimension.h equation_of_state.h active.h \
63
		 gravity.h gravity_io.h \
64
		 gravity/Default/gravity.h gravity/Default/gravity_iact.h gravity/Default/gravity_io.h \
65
		 gravity/Default/gravity_debug.h gravity/Default/gravity_part.h  \
Tom Theuns's avatar
Tom Theuns committed
66
		 sourceterms.h \
67
	 	 hydro.h hydro_io.h \
68
		 hydro/Minimal/hydro.h hydro/Minimal/hydro_iact.h hydro/Minimal/hydro_io.h \
69
                 hydro/Minimal/hydro_debug.h hydro/Minimal/hydro_part.h \
70
71
72
		 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 \
73
                 hydro/Gadget2/hydro_debug.h hydro/Gadget2/hydro_part.h \
74
75
		 hydro/PressureEntropy/hydro.h hydro/PressureEntropy/hydro_iact.h hydro/PressureEntropy/hydro_io.h \
                 hydro/PressureEntropy/hydro_debug.h hydro/PressureEntropy/hydro_part.h \
76
		 hydro/Gizmo/hydro.h hydro/Gizmo/hydro_iact.h hydro/Gizmo/hydro_io.h \
77
                 hydro/Gizmo/hydro_debug.h hydro/Gizmo/hydro_part.h \
78
	         riemann/riemann_hllc.h riemann/riemann_trrs.h \
79
		 riemann/riemann_exact.h riemann/riemann_vacuum.h \
80
81
	         potential/none/potential.h potential/point_mass/potential.h \
                 potential/isothermal/potential.h potential/disc_patch/potential.h \
82
		 potential/softened_isothermal/potential.h \
83
		 cooling/none/cooling.h cooling/none/cooling_struct.h \
84
	         cooling/const_du/cooling.h cooling/const_du/cooling_struct.h \
85
                 cooling/const_lambda/cooling.h cooling/const_lambda/cooling_struct.h \
Peter W. Draper's avatar
Peter W. Draper committed
86
                 memswap.h
87

88

89
90
# Sources and flags for regular library
libswiftsim_la_SOURCES = $(AM_SOURCES)
91
92
libswiftsim_la_CFLAGS = $(AM_CFLAGS)
libswiftsim_la_LDFLAGS = $(AM_LDFLAGS) $(EXTRA_LIBS)
93
94
95

# Sources and flags for MPI library
libswiftsim_mpi_la_SOURCES = $(AM_SOURCES)
96
97
libswiftsim_mpi_la_CFLAGS = $(AM_CFLAGS) $(MPI_FLAGS)
libswiftsim_mpi_la_LDFLAGS = $(AM_LDFLAGS) $(MPI_LIBS) $(EXTRA_LIBS)
98
libswiftsim_mpi_la_SHORTNAME = mpi
Pedro Gonnet's avatar
Pedro Gonnet committed
99

100

Matthieu Schaller's avatar
Matthieu Schaller committed
101
# Versioning. If any sources change then update the version_string.h file with
102
# the current git revision and package version.
Matthieu Schaller's avatar
Matthieu Schaller committed
103
# May have a checkout without a version_string.h file and no git command (tar/zip
104
# download), allow that, but make sure we know it.
Matthieu Schaller's avatar
Matthieu Schaller committed
105
version_string.h: version_string.h.in $(AM_SOURCES) $(include_HEADERS) $(noinst_HEADERS)
106
	if test "X$(GIT_CMD)" != "X"; then \
107
	    GIT_REVISION=`$(GIT_CMD) describe --abbrev=8  --always --tags --dirty`; \
108
	    GIT_BRANCH=`$(GIT_CMD) branch | sed -n 's/^\* \(.*\)/\1/p'`; \
109
	    sed -e "s,@PACKAGE_VERSION\@,$(PACKAGE_VERSION)," \
110
	        -e "s,@GIT_REVISION\@,$${GIT_REVISION}," \
111
	        -e "s|@GIT_BRANCH\@|$${GIT_BRANCH}|" \
112
	        -e "s|@SWIFT_CFLAGS\@|$(CFLAGS)|" $< > version_string.h; \
113
	else \
Matthieu Schaller's avatar
Matthieu Schaller committed
114
	    if test ! -f version_string.h; then \
115
	        sed -e "s,@PACKAGE_VERSION\@,$(PACKAGE_VERSION)," \
116
	            -e "s,@GIT_REVISION\@,unknown," \
117
		    -e "s,@GIT_BRANCH\@,unknown," \
118
	            -e "s|@SWIFT_CFLAGS\@|$(CFLAGS)|" $< > version_string.h; \
119
	    fi; \
120
	fi
121

Matthieu Schaller's avatar
Matthieu Schaller committed
122
123
#  Make sure version_string.h is built first.
BUILT_SOURCES = version_string.h
124

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