Makefile.am 19.6 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
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

18
# Add the non-standard paths to the included library headers
19
AM_CFLAGS = $(HDF5_CPPFLAGS) $(GSL_INCS) $(FFTW_INCS) $(NUMA_INCS) $(GRACKLE_INCS) $(OPENMP_CFLAGS)
Pedro Gonnet's avatar
Pedro Gonnet committed
20
21

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

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

27
# Additional dependencies for shared libraries.
28
EXTRA_LIBS = $(HDF5_LIBS) $(FFTW_LIBS) $(NUMA_LIBS) $(PROFILER_LIBS) $(TCMALLOC_LIBS) $(JEMALLOC_LIBS) $(TBBMALLOC_LIBS) $(GRACKLE_LIBS) $(GSL_LIBS)
29
30

# MPI libraries.
31
32
MPI_LIBS = $(PARMETIS_LIBS) $(METIS_LIBS) $(MPI_THREAD_LIBS)
MPI_FLAGS = -DWITH_MPI $(PARMETIS_INCS) $(METIS_INCS)
33

34
# Build the libswiftsim library and a convenience library just for the gravity tasks
35
lib_LTLIBRARIES = libswiftsim.la
36
noinst_LTLIBRARIES = libgrav.la 
37
38
39
# Build a MPI-enabled version too?
if HAVEMPI
lib_LTLIBRARIES += libswiftsim_mpi.la
40
noinst_LTLIBRARIES += libgrav_mpi.la
41
endif
Pedro Gonnet's avatar
Pedro Gonnet committed
42
43

# List required headers
Pedro Gonnet's avatar
Pedro Gonnet committed
44
include_HEADERS = space.h runner.h queue.h task.h lock.h cell.h part.h const.h \
45
    engine.h swift.h serial_io.h timers.h debug.h scheduler.h proxy.h parallel_io.h \
46
    common_io.h single_io.h distributed_io.h map.h tools.h  partition_fixed_costs.h \
47
    partition.h clocks.h parser.h physical_constants.h physical_constants_cgs.h potential.h version.h \
48
    hydro_properties.h riemann.h threadpool.h cooling_io.h cooling.h cooling_struct.h \
49
    statistics.h memswap.h cache.h runner_doiact_hydro_vec.h profiler.h entropy_floor.h \
50
    dump.h logger.h active.h timeline.h xmf.h gravity_properties.h gravity_derivatives.h \
lhausamm's avatar
lhausamm committed
51
    gravity_softened_derivatives.h vector_power.h collectgroup.h hydro_space.h sort_part.h \
52
    chemistry.h chemistry_io.h chemistry_struct.h cosmology.h restart.h space_getsid.h utilities.h \
53
    mesh_gravity.h cbrt.h exp10.h velociraptor_interface.h swift_velociraptor_part.h output_list.h \
54
    logger_io.h tracers_io.h tracers.h tracers_struct.h star_formation_io.h fof.h fof_struct.h fof_io.h \
55
    multipole.h multipole_accept.h multipole_struct.h binomial.h integer_power.h sincos.h \
56
    star_formation_struct.h star_formation.h star_formation_iact.h \
57
    star_formation_logger.h star_formation_logger_struct.h \
58
    pressure_floor.h pressure_floor_struct.h pressure_floor_iact.h \
59
60
    velociraptor_struct.h velociraptor_io.h random.h memuse.h mpiuse.h memuse_rnodes.h \
    black_holes.h black_holes_io.h black_holes_properties.h black_holes_struct.h \
Loic Hausammann's avatar
Loic Hausammann committed
61
    feedback.h feedback_struct.h feedback_properties.h task_order.h \
62
    space_unique_id.h line_of_sight.h
63

64
65
66
67
68
69
# source files for EAGLE cooling
QLA_COOLING_SOURCES =
if HAVEQLACOOLING
QLA_COOLING_SOURCES += cooling/QLA/cooling.c cooling/QLA/cooling_tables.c
endif

70
71
72
# source files for EAGLE cooling
EAGLE_COOLING_SOURCES =
if HAVEEAGLECOOLING
73
EAGLE_COOLING_SOURCES += cooling/EAGLE/cooling.c cooling/EAGLE/cooling_tables.c
74
endif
75

Matthieu Schaller's avatar
Matthieu Schaller committed
76
77
78
79
80
81
# source files for COLIBRE cooling
COLIBRE_COOLING_SOURCES =
if HAVECOLIBRECOOLING
COLIBRE_COOLING_SOURCES += cooling/COLIBRE/cooling.c cooling/COLIBRE/cooling_tables.c
endif

82
83
84
85
86
87
# source files for EAGLE feedback
EAGLE_FEEDBACK_SOURCES =
if HAVEEAGLEFEEDBACK
EAGLE_FEEDBACK_SOURCES += feedback/EAGLE/feedback.c
endif

Loic Hausammann's avatar
Gear    
Loic Hausammann committed
88
89
90
91
92
93
# source files for GRACKLE cooling
GRACKLE_COOLING_SOURCES =
if HAVEGRACKLECOOLING
GRACKLE_COOLING_SOURCES += cooling/grackle/cooling.c
endif

Matthieu Schaller's avatar
Matthieu Schaller committed
94
# source files for GEAR feedback
Loic Hausammann's avatar
Gear    
Loic Hausammann committed
95
96
97
98
99
100
GEAR_FEEDBACK_SOURCES =
if HAVEGEARFEEDBACK
GEAR_FEEDBACK_SOURCES += feedback/GEAR/stellar_evolution.c feedback/GEAR/feedback.c \
	feedback/GEAR/initial_mass_function.c feedback/GEAR/supernovae_ia.c feedback/GEAR/supernovae_ii.c
endif

101
# Common source files
102
AM_SOURCES = space.c runner_main.c runner_doiact_hydro.c runner_doiact_limiter.c \
103
104
105
    runner_doiact_stars.c runner_doiact_black_holes.c runner_ghost.c runner_recv.c \
    runner_sort.c runner_drift.c runner_black_holes.c runner_time_integration.c \
    runner_doiact_hydro_vec.c runner_others.c\
106
    queue.c task.c cell.c engine.c engine_maketasks.c engine_split_particles.c \
107
108
    engine_marktasks.c engine_drift.c engine_unskip.c engine_collect_end_of_step.c \
    engine_redistribute.c engine_fof.c serial_io.c timers.c debug.c scheduler.c \
109
    proxy.c parallel_io.c units.c common_io.c single_io.c multipole.c version.c map.c \
110
    kernel_hydro.c tools.c part.c partition.c clocks.c parser.c distributed_io.c \
111
    physical_constants.c potential.c hydro_properties.c \
112
    threadpool.c cooling.c star_formation.c \
113
    statistics.c profiler.c dump.c logger.c \
114
    part_type.c xmf.c gravity_properties.c gravity.c \
115
    collectgroup.c hydro_space.c equation_of_state.c \
lhausamm's avatar
lhausamm committed
116
    chemistry.c cosmology.c restart.c mesh_gravity.c velociraptor_interface.c \
117
118
    output_list.c velociraptor_dummy.c logger_io.c memuse.c mpiuse.c memuse_rnodes.c fof.c \
    hashmap.c pressure_floor.c space_unique_id.c output_options.c line_of_sight.c \
119
    $(QLA_COOLING_SOURCES) \
Matthieu Schaller's avatar
Matthieu Schaller committed
120
    $(EAGLE_COOLING_SOURCES) $(EAGLE_FEEDBACK_SOURCES) \
Matthieu Schaller's avatar
Matthieu Schaller committed
121
122
    $(GRACKLE_COOLING_SOURCES) $(GEAR_FEEDBACK_SOURCES) \
    $(COLIBRE_COOLING_SOURCES)
123
124

# Include files for distribution, not installation.
125
nobase_noinst_HEADERS = align.h approx_math.h atomic.h barrier.h cycle.h error.h inline.h kernel_hydro.h kernel_gravity.h \
126
		 gravity_iact.h kernel_long_gravity.h vector.h accumulate.h cache.h exp.h \
127
128
	         runner_doiact_nosort.h runner_doiact_hydro.h runner_doiact_stars.h runner_doiact_black_holes.h runner_doiact_grav.h \
                 runner_doiact_functions_hydro.h runner_doiact_functions_stars.h runner_doiact_functions_black_holes.h \
129
		 runner_doiact_functions_limiter.h runner_doiact_limiter.h units.h intrinsics.h minmax.h \
130
                 kick.h timestep.h drift.h adiabatic_index.h io_properties.h dimension.h part_type.h periodic.h memswap.h \
131
                 timestep_limiter.h timestep_limiter_iact.h timestep_sync.h timestep_sync_part.h timestep_limiter_struct.h \
132
                 dump.h logger.h sign.h logger_io.h hashmap.h gravity.h gravity_io.h gravity_cache.h output_options.h \
133
		 gravity/Default/gravity.h gravity/Default/gravity_iact.h gravity/Default/gravity_io.h \
134
		 gravity/Default/gravity_debug.h gravity/Default/gravity_part.h  \
135
136
		 gravity/Potential/gravity.h gravity/Potential/gravity_iact.h gravity/Potential/gravity_io.h \
		 gravity/Potential/gravity_debug.h gravity/Potential/gravity_part.h  \
137
138
		 gravity/MultiSoftening/gravity.h gravity/MultiSoftening/gravity_iact.h gravity/MultiSoftening/gravity_io.h \
		 gravity/MultiSoftening/gravity_debug.h gravity/MultiSoftening/gravity_part.h  \
139
		 equation_of_state.h \
140
		 equation_of_state/ideal_gas/equation_of_state.h equation_of_state/isothermal/equation_of_state.h \
141
	 	 hydro.h hydro_io.h hydro_parameters.h \
142
		 hydro/Minimal/hydro.h hydro/Minimal/hydro_iact.h hydro/Minimal/hydro_io.h \
143
                 hydro/Minimal/hydro_debug.h hydro/Minimal/hydro_part.h \
144
		 hydro/Minimal/hydro_parameters.h \
145
146
		 hydro/Default/hydro.h hydro/Default/hydro_iact.h hydro/Default/hydro_io.h \
                 hydro/Default/hydro_debug.h hydro/Default/hydro_part.h \
147
		 hydro/Default/hydro_parameters.h \
148
		 hydro/Gadget2/hydro.h hydro/Gadget2/hydro_iact.h hydro/Gadget2/hydro_io.h \
149
                 hydro/Gadget2/hydro_debug.h hydro/Gadget2/hydro_part.h \
150
		 hydro/Gadget2/hydro_parameters.h \
151
152
		 hydro/PressureEntropy/hydro.h hydro/PressureEntropy/hydro_iact.h hydro/PressureEntropy/hydro_io.h \
                 hydro/PressureEntropy/hydro_debug.h hydro/PressureEntropy/hydro_part.h \
153
		 hydro/PressureEntropy/hydro_parameters.h \
154
155
		 hydro/PressureEnergy/hydro.h hydro/PressureEnergy/hydro_iact.h hydro/PressureEnergy/hydro_io.h \
                 hydro/PressureEnergy/hydro_debug.h hydro/PressureEnergy/hydro_part.h \
156
		 hydro/PressureEnergy/hydro_parameters.h \
157
158
		 hydro/PressureEnergyMorrisMonaghanAV/hydro.h hydro/PressureEnergyMorrisMonaghanAV/hydro_iact.h hydro/PressureEnergyMorrisMonaghanAV/hydro_io.h \
                 hydro/PressureEnergyMorrisMonaghanAV/hydro_debug.h hydro/PressureEnergyMorrisMonaghanAV/hydro_part.h \
159
		 hydro/PressureEnergyMorrisMonaghanAV/hydro_parameters.h \
160
161
		 hydro/AnarchyPU/hydro.h hydro/AnarchyPU/hydro_iact.h hydro/AnarchyPU/hydro_io.h \
                 hydro/AnarchyPU/hydro_debug.h hydro/AnarchyPU/hydro_part.h \
162
		 hydro/AnarchyPU/hydro_parameters.h \
163
164
		 hydro/SPHENIX/hydro.h hydro/SPHENIX/hydro_iact.h hydro/SPHENIX/hydro_io.h \
                 hydro/SPHENIX/hydro_debug.h hydro/SPHENIX/hydro_part.h \
Josh Borrow's avatar
Josh Borrow committed
165
		 hydro/SPHENIX/hydro_parameters.h \
166
167
168
169
		 hydro/Gizmo/hydro_parameters.h \
                 hydro/Gizmo/hydro_io.h hydro/Gizmo/hydro_debug.h \
                 hydro/Gizmo/hydro.h hydro/Gizmo/hydro_iact.h \
                 hydro/Gizmo/hydro_part.h \
170
171
172
173
                 hydro/Gizmo/hydro_gradients.h \
                 hydro/Gizmo/hydro_getters.h \
                 hydro/Gizmo/hydro_setters.h \
                 hydro/Gizmo/hydro_flux.h \
174
                 hydro/Gizmo/hydro_slope_limiters.h \
175
176
                 hydro/Gizmo/hydro_slope_limiters_face.h \
                 hydro/Gizmo/hydro_slope_limiters_cell.h \
177
178
179
                 hydro/Gizmo/hydro_unphysical.h \
                 hydro/Gizmo/hydro_gradients_sph.h \
                 hydro/Gizmo/hydro_gradients_gizmo.h \
180
                 hydro/Gizmo/hydro_velocities.h \
181
                 hydro/Gizmo/hydro_lloyd.h \
182
                 hydro/Gizmo/MFV/hydro_debug.h \
183
184
                 hydro/Gizmo/MFV/hydro_part.h \
                 hydro/Gizmo/MFV/hydro_velocities.h \
185
                 hydro/Gizmo/MFV/hydro_flux.h \
186
                 hydro/Gizmo/MFM/hydro_debug.h \
187
                 hydro/Gizmo/MFM/hydro_part.h \
188
                 hydro/Gizmo/MFM/hydro_flux.h \
189
                 hydro/Gizmo/MFM/hydro_velocities.h \
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
                 hydro/Shadowswift/hydro_debug.h \
                 hydro/Shadowswift/hydro_gradients.h hydro/Shadowswift/hydro.h \
                 hydro/Shadowswift/hydro_iact.h \
                 hydro/Shadowswift/hydro_io.h \
                 hydro/Shadowswift/hydro_part.h \
                 hydro/Shadowswift/hydro_slope_limiters_cell.h \
                 hydro/Shadowswift/hydro_slope_limiters_face.h \
                 hydro/Shadowswift/hydro_slope_limiters.h \
                 hydro/Shadowswift/voronoi1d_algorithm.h \
                 hydro/Shadowswift/voronoi1d_cell.h \
                 hydro/Shadowswift/voronoi2d_algorithm.h \
                 hydro/Shadowswift/voronoi2d_cell.h \
                 hydro/Shadowswift/voronoi3d_algorithm.h \
                 hydro/Shadowswift/voronoi3d_cell.h \
                 hydro/Shadowswift/voronoi_algorithm.h \
                 hydro/Shadowswift/voronoi_cell.h \
206
                 hydro/Shadowswift/hydro_parameters.h \
207
	         riemann/riemann_hllc.h riemann/riemann_trrs.h \
208
		 riemann/riemann_exact.h riemann/riemann_vacuum.h \
209
                 riemann/riemann_checks.h \
210
	 	 stars.h stars_io.h \
211
212
		 stars/Default/stars.h stars/Default/stars_iact.h stars/Default/stars_io.h \
		 stars/Default/stars_debug.h stars/Default/stars_part.h  \
213
214
		 stars/EAGLE/stars.h stars/EAGLE/stars_iact.h stars/EAGLE/stars_io.h \
		 stars/EAGLE/stars_debug.h stars/EAGLE/stars_part.h \
Loic Hausammann's avatar
Gear    
Loic Hausammann committed
215
216
		 stars/GEAR/stars.h stars/GEAR/stars_iact.h stars/GEAR/stars_io.h \
		 stars/GEAR/stars_debug.h stars/GEAR/stars_part.h \
217
218
	         potential/none/potential.h potential/point_mass/potential.h \
                 potential/isothermal/potential.h potential/disc_patch/potential.h \
219
220
221
222
                 potential/sine_wave/potential.h potential/constant/potential.h \
		 potential/hernquist/potential.h potential/nfw/potential.h \
		 potential/nfw_mn/potential.h potential/point_mass_softened/potential.h \
		 potential/point_mass_ring/potential.h \
223
		 star_formation/none/star_formation.h star_formation/none/star_formation_struct.h \
224
		 star_formation/none/star_formation_io.h star_formation/none/star_formation_iact.h \
225
226
		 star_formation/QLA/star_formation.h star_formation/QLA/star_formation_struct.h \
		 star_formation/QLA/star_formation_io.h star_formation/QLA/star_formation_iact.h \
227
		 star_formation/EAGLE/star_formation.h star_formation/EAGLE/star_formation_struct.h \
228
		 star_formation/EAGLE/star_formation_io.h star_formation/EAGLE/star_formation_iact.h \
Loic Hausammann's avatar
Loic Hausammann committed
229
		 star_formation/GEAR/star_formation.h star_formation/GEAR/star_formation_struct.h \
230
		 star_formation/GEAR/star_formation_io.h star_formation/GEAR/star_formation_iact.h \
231
232
233
234
                 star_formation/EAGLE/star_formation_logger.h star_formation/EAGLE/star_formation_logger_struct.h \
                 star_formation/GEAR/star_formation_logger.h star_formation/GEAR/star_formation_logger_struct.h \
                 star_formation/none/star_formation_logger.h star_formation/none/star_formation_logger_struct.h \
                 cooling/none/cooling.h cooling/none/cooling_struct.h \
235
                 cooling/none/cooling_io.h \
236
237
		 cooling/Compton/cooling.h cooling/Compton/cooling_struct.h \
                 cooling/Compton/cooling_io.h \
238
	         cooling/const_du/cooling.h cooling/const_du/cooling_struct.h \
239
                 cooling/const_du/cooling_io.h \
240
                 cooling/const_lambda/cooling.h cooling/const_lambda/cooling_struct.h \
241
                 cooling/const_lambda/cooling_io.h \
lhausamm's avatar
lhausamm committed
242
                 cooling/grackle/cooling.h cooling/grackle/cooling_struct.h \
243
                 cooling/grackle/cooling_io.h \
244
		 cooling/EAGLE/cooling.h cooling/EAGLE/cooling_struct.h cooling/EAGLE/cooling_tables.h \
245
                 cooling/EAGLE/cooling_io.h cooling/EAGLE/interpolate.h cooling/EAGLE/cooling_rates.h \
246
247
		 cooling/QLA/cooling.h cooling/QLA/cooling_struct.h cooling/QLA/cooling_tables.h \
                 cooling/QLA/cooling_io.h cooling/QLA/interpolate.h cooling/QLA/cooling_rates.h \
Matthieu Schaller's avatar
Matthieu Schaller committed
248
249
250
251
                 cooling/COLIBRE/cooling.h cooling/COLIBRE/cooling_struct.h cooling/COLIBRE/cooling_subgrid.h \
                 cooling/COLIBRE/cooling_io.h cooling/COLIBRE/interpolate.h cooling/COLIBRE/cooling_rates.h \
                 cooling/COLIBRE/cooling_tables.h cooling/COLIBRE/cooling_subgrid.h \
		 chemistry/none/chemistry.h \
lhausamm's avatar
lhausamm committed
252
		 chemistry/none/chemistry_io.h \
lhausamm's avatar
lhausamm committed
253
		 chemistry/none/chemistry_struct.h \
254
		 chemistry/none/chemistry_iact.h \
255
256
257
258
                 chemistry/GEAR/chemistry.h \
		 chemistry/GEAR/chemistry_io.h \
		 chemistry/GEAR/chemistry_struct.h \
		 chemistry/GEAR/chemistry_iact.h \
259
260
                 chemistry/EAGLE/chemistry.h \
		 chemistry/EAGLE/chemistry_io.h \
261
		 chemistry/EAGLE/chemistry_struct.h\
262
		 chemistry/EAGLE/chemistry_iact.h \
263
264
265
266
                 chemistry/QLA/chemistry.h \
		 chemistry/QLA/chemistry_io.h \
		 chemistry/QLA/chemistry_struct.h\
		 chemistry/QLA/chemistry_iact.h \
267
268
	         entropy_floor/none/entropy_floor.h \
                 entropy_floor/EAGLE/entropy_floor.h \
269
                 entropy_floor/QLA/entropy_floor.h \
270
271
272
		 tracers/none/tracers.h tracers/none/tracers_struct.h \
                 tracers/none/tracers_io.h \
		 tracers/EAGLE/tracers.h tracers/EAGLE/tracers_struct.h \
273
                 tracers/EAGLE/tracers_io.h \
274
275
276
277
278
	         feedback/none/feedback.h feedback/none/feedback_struct.h feedback/none/feedback_iact.h \
                 feedback/none/feedback_properties.h \
	         feedback/EAGLE/feedback.h feedback/EAGLE/feedback_struct.h feedback/EAGLE/feedback_iact.h \
                 feedback/EAGLE/feedback_properties.h feedback/EAGLE/imf.h feedback/EAGLE/interpolate.h \
                 feedback/EAGLE/yield_tables.h \
Loic Hausammann's avatar
Gear    
Loic Hausammann committed
279
280
281
282
283
		 feedback/GEAR/stellar_evolution_struct.h feedback/GEAR/stellar_evolution.h \
		 feedback/GEAR/feedback.h feedback/GEAR/feedback_iact.h \
		 feedback/GEAR/feedback_properties.h feedback/GEAR/feedback_struct.h \
                 feedback/GEAR/initial_mass_function.h feedback/GEAR/supernovae_ia.h feedback/GEAR/supernovae_ii.h \
                 feedback/GEAR/lifetime.h feedback/GEAR/hdf5_functions.h feedback/GEAR/interpolation.h \
284
                 black_holes/Default/black_holes.h black_holes/Default/black_holes_io.h \
285
		 black_holes/Default/black_holes_part.h black_holes/Default/black_holes_iact.h \
286
                 black_holes/Default/black_holes_properties.h \
287
                 black_holes/Default/black_holes_struct.h \
288
                 black_holes/EAGLE/black_holes.h black_holes/EAGLE/black_holes_io.h \
289
		 black_holes/EAGLE/black_holes_part.h black_holes/EAGLE/black_holes_iact.h \
290
                 black_holes/EAGLE/black_holes_properties.h black_holes/EAGLE/black_holes_parameters.h \
291
                 black_holes/EAGLE/black_holes_struct.h \
292
293
		 pressure_floor/GEAR/pressure_floor.h pressure_floor/none/pressure_floor.h \
		 pressure_floor/GEAR/pressure_floor_iact.h pressure_floor/none/pressure_floor_iact.h \
294
		 pressure_floor/GEAR/pressure_floor_struct.h pressure_floor/none/pressure_floor_struct.h \
Loic Hausammann's avatar
Loic Hausammann committed
295
	         task_order/GEAR/task_order.h task_order/EAGLE/task_order.h task_order/default/task_order.h \
296
297
		 sink/Default/sink.h sink/Default/sink_io.h sink/Default/sink_part.h \
		 sink.h sink_io.h
298

299

300
301
# Sources and special flags for the gravity library
libgrav_la_SOURCES = runner_doiact_grav.c
Loic Hausammann's avatar
Gear    
Loic Hausammann committed
302
libgrav_la_CFLAGS = $(AM_CFLAGS) $(GRAVITY_CFLAGS)
303
304
305
306
307
308
309
libgrav_la_LDFLAGS = $(AM_LDFLAGS) $(EXTRA_LIBS)

# Sources and special flags for the gravity MPI library
libgrav_mpi_la_SOURCES = runner_doiact_grav.c
libgrav_mpi_la_CFLAGS = $(AM_CFLAGS) $(GRAVITY_CFLAGS) -DWITH_MPI
libgrav_mpi_la_LDFLAGS = $(AM_LDFLAGS) $(MPI_LIBS) $(EXTRA_LIBS)

310
311
# Sources and flags for regular library
libswiftsim_la_SOURCES = $(AM_SOURCES)
312
libswiftsim_la_CFLAGS = $(AM_CFLAGS)
313
314
libswiftsim_la_LDFLAGS = $(AM_LDFLAGS) $(EXTRA_LIBS) -version-info 0:0:0
libswiftsim_la_LIBADD = $(GRACKLE_LIBS) $(VELOCIRAPTOR_LIBS) libgrav.la
315
316
317

# Sources and flags for MPI library
libswiftsim_mpi_la_SOURCES = $(AM_SOURCES)
318
libswiftsim_mpi_la_CFLAGS = $(AM_CFLAGS) $(MPI_FLAGS)
319
libswiftsim_mpi_la_LDFLAGS = $(AM_LDFLAGS) $(MPI_LIBS) $(EXTRA_LIBS) -version-info 0:0:0
320
libswiftsim_mpi_la_SHORTNAME = mpi
321
libswiftsim_mpi_la_LIBADD = $(GRACKLE_LIBS) $(VELOCIRAPTOR_LIBS) $(MPI_LIBS) libgrav_mpi.la
322

Matthieu Schaller's avatar
Matthieu Schaller committed
323
# Versioning. If any sources change then update the version_string.h file with
324
# the current git revision and package version.
Matthieu Schaller's avatar
Matthieu Schaller committed
325
# May have a checkout without a version_string.h file and no git command (tar/zip
326
# download), allow that, but make sure we know it.
327
version_string.h: version_string.h.in Makefile $(AM_SOURCES) $(include_HEADERS) $(noinst_HEADERS)
328
	if test "X$(GIT_CMD)" != "X"; then \
329
330
331
	    GIT_REVISION=`$(GIT_CMD) describe --abbrev=8  --always --tags --dirty 2>/dev/null`; \
	    GIT_BRANCH=`$(GIT_CMD) branch 2>/dev/null | sed -n 's/^\* \(.*\)/\1/p' 2>/dev/null`; \
            GIT_DATE=`$(GIT_CMD) log -1 --format=%ci 2>/dev/null`; \
332
	    sed -e "s,@PACKAGE_VERSION\@,$(PACKAGE_VERSION)," \
333
	        -e "s,@GIT_REVISION\@,$${GIT_REVISION}," \
334
	        -e "s|@GIT_BRANCH\@|$${GIT_BRANCH}|" \
335
	        -e "s|@GIT_DATE\@|$${GIT_DATE}|" \
336
	        -e "s|@SWIFT_CFLAGS\@|$(CFLAGS)|" $< > version_string.h; \
337
	else \
Matthieu Schaller's avatar
Matthieu Schaller committed
338
	    if test ! -f version_string.h; then \
339
	        sed -e "s,@PACKAGE_VERSION\@,$(PACKAGE_VERSION)," \
340
	            -e "s,@GIT_REVISION\@,unknown," \
341
		    -e "s,@GIT_BRANCH\@,unknown," \
342
		    -e "s,@GIT_DATE\@,unknown," \
343
	            -e "s|@SWIFT_CFLAGS\@|$(CFLAGS)|" $< > version_string.h; \
344
	    fi; \
345
	fi
346

Matthieu Schaller's avatar
Matthieu Schaller committed
347
348
#  Make sure version_string.h is built first.
BUILT_SOURCES = version_string.h
349

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