forked from GalacticDynamics-Oxford/Agama
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.msvc
159 lines (144 loc) · 4.72 KB
/
Makefile.msvc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
# This variant of Makefile is specific for MSVC on Windows and should be processed with nmake.exe
# this file is for general settings such as file list, etc.
# machine-specific settings such as include paths and #defines are in Makefile.local
include Makefile.local
# set up folder names
SRCDIR = src
OBJDIR = obj
EXEDIR = exe
TESTSDIR = tests
TORUSDIR = src/torus
# sources of the main library
SOURCES = \
py_wrapper.cpp \
math_core.cpp \
math_fit.cpp \
math_gausshermite.cpp \
math_geometry.cpp \
math_linalg.cpp \
math_ode.cpp \
math_optimization.cpp \
math_random.cpp \
math_sample.cpp \
math_specfunc.cpp \
math_sphharm.cpp \
math_spline.cpp \
particles_io.cpp \
actions_focal_distance_finder.cpp \
actions_isochrone.cpp \
actions_spherical.cpp \
actions_staeckel.cpp \
actions_torus.cpp \
coord.cpp \
cubature.cpp \
df_base.cpp \
df_disk.cpp \
df_factory.cpp \
df_halo.cpp \
df_spherical.cpp \
galaxymodel_base.cpp \
galaxymodel_densitygrid.cpp \
galaxymodel_fokkerplanck.cpp \
galaxymodel_jeans.cpp \
galaxymodel_losvd.cpp \
galaxymodel_selfconsistent.cpp \
galaxymodel_spherical.cpp \
galaxymodel_velocitysampler.cpp \
orbit.cpp \
orbit_lyapunov.cpp \
potential_analytic.cpp \
potential_base.cpp \
potential_composite.cpp \
potential_cylspline.cpp \
potential_dehnen.cpp \
potential_disk.cpp \
potential_factory.cpp \
potential_ferrers.cpp \
potential_king.cpp \
potential_multipole.cpp \
potential_perfect_ellipsoid.cpp \
potential_spheroid.cpp \
potential_utils.cpp \
raga_core.cpp \
raga_binary.cpp \
raga_losscone.cpp \
raga_potential.cpp \
raga_relaxation.cpp \
raga_trajectory.cpp \
utils.cpp \
utils_config.cpp \
fortran_wrapper.cpp \
nemo_wrapper.cpp \
# ancient Torus code
TORUSSRC = CHB.cc \
Fit.cc \
Fit2.cc \
GeneratingFunction.cc \
Orb.cc \
PJMCoords.cc \
PJMNum.cc \
Point_ClosedOrbitCheby.cc \
Point_None.cc \
Torus.cc \
Toy_Isochrone.cc \
WD_Numerics.cc \
# test and example programs
TESTSRCS = test_math_core.cpp \
test_math_linalg.cpp \
test_math_spline.cpp \
test_coord.cpp \
test_units.cpp \
test_utils.cpp \
test_orbit_integr.cpp \
test_orbit_lyapunov.cpp \
test_potentials.cpp \
test_potential_expansions.cpp \
test_actions_isochrone.cpp \
test_actions_spherical.cpp \
test_actions_staeckel.cpp \
test_actions_torus.cpp \
test_action_finder.cpp \
test_df_halo.cpp \
test_df_spherical.cpp \
test_density_grid.cpp \
test_losvd.cpp \
test_galaxymodel.cpp \
example_actions_nbody.cpp \
example_df_fit.cpp \
example_doublepowerlaw.cpp \
example_self_consistent_model.cpp \
mkspherical.cpp \
phaseflow.cpp \
raga.cpp \
LIBNAME = agama.lib
PYDNAME = agama.pyd
OBJECTS = $(SOURCES:.cpp=.obj)
OBJECTS = obj/$(OBJECTS: = obj/)
TORUSOBJ= $(TORUSSRC:.cc=.obj)
TORUSOBJ= obj/$(TORUSOBJ: = obj/)
TESTEXE = $(TESTSRCS:.cpp=.exe)
TESTEXE = exe/$(TESTEXE: = exe/)
CXXFLAGS = $(CXXFLAGS) -I$(SRCDIR)
# this is the default target (build all), if make is launched without parameters
all: $(OBJDIR) $(EXEDIR) $(LIBNAME) $(PYDNAME) $(TESTEXE)
$(LIBNAME): $(OBJECTS) $(TORUSOBJ) Makefile.local
lib.exe $(OBJECTS) $(TORUSOBJ) $(LINK_FLAGS) /out:$(LIBNAME)
$(PYDNAME): $(OBJECTS) $(TORUSOBJ) Makefile.local
link.exe $(OBJECTS) $(TORUSOBJ) $(LINK_FLAGS) /dll /out:$(PYDNAME) /implib:agama_pyd.lib
del agama_pyd.lib
del agama_pyd.exp
$(TESTEXE): $(LIBNAME) Makefile.local
{src}.cpp{obj}.obj:
$(CC) $(CXXFLAGS) $(COMPILE_FLAGS) -c $< -Foobj/
{src/torus}.cc{obj}.obj:
$(CC) $(CXXFLAGS) $(COMPILE_FLAGS) -c $< -Foobj/
{tests}.cpp{exe}.exe:
$(CC) -Fe: "$@" -Foobj/tmp.obj "$<" $(CXXFLAGS) /link $(LIBNAME) $(EXE_FLAGS)
$(OBJDIR):
mkdir $(OBJDIR)
$(EXEDIR):
mkdir $(EXEDIR)
# run tests (both C++ and python)
test:
cd py
python alltest.py