aboutsummaryrefslogtreecommitdiffstats
path: root/mass_profile/Makefile
blob: 1d7f48bee427fa8a0f5681e187e14b896bf66767 (plain)
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
#
# Makefile for `chandra-acis-analysis/mass_profile` tools
#
# Junhua GU
# Weitian LI
# 2016-06-07
#


CXX ?= g++
#CXXFLAGS += -Wall -Werror
CXXFLAGS += -Wall

ifdef OPENMP
	CXXFLAGS += -fopenmp
endif

ifdef DEBUG
	CXXFLAGS += -g
else
	CXXFLAGS += -O2
endif

OPT_UTIL_INC ?= -I../opt_utilities

TARGETS= fit_nfw_sbp fit_dbeta_sbp fit_beta_sbp \
		fit_direct_beta fit_wang2012_model \
		fit_nfw_mass fit_mt_pl fit_lt_pl fit_mt_bpl \
		fit_lt_bpl cooling_time calc_lx_dbeta calc_lx_beta
HEADERS= projector.hpp spline.hpp vchisq.hpp

all: $(TARGETS)

# NOTE:
# Object/source files should placed *before* libraries (order matters)
fit_nfw_sbp: fit_nfw_sbp.o
	$(CXX) $(CXXFLAGS) $^ -o $@ $(OPT_UTIL_INC)

fit_dbeta_sbp: fit_dbeta_sbp.o beta_cfg.o report_error.o
	$(CXX) $(CXXFLAGS) $^ -o $@ $(OPT_UTIL_INC)

fit_beta_sbp: fit_beta_sbp.o beta_cfg.o dump_fit_qdp.o
	$(CXX) $(CXXFLAGS) $^ -o $@ $(OPT_UTIL_INC)

fit_wang2012_model: fit_wang2012_model.o
	$(CXX) $(CXXFLAGS) $^ -o $@ $(OPT_UTIL_INC)

fit_nfw_mass: fit_nfw_mass.o
	$(CXX) $(CXXFLAGS) $^ -o $@ $(OPT_UTIL_INC)

fit_direct_beta: fit_direct_beta.o
	$(CXX) $(CXXFLAGS) $^ -o $@ $(OPT_UTIL_INC)

calc_lx_dbeta: calc_lx_dbeta.o beta_cfg.o report_error.o
	$(CXX) $(CXXFLAGS) $^ -o $@ $(OPT_UTIL_INC)

calc_lx_beta: calc_lx_beta.o beta_cfg.o dump_fit_qdp.o
	$(CXX) $(CXXFLAGS) $^ -o $@ $(OPT_UTIL_INC)

fit_mt_pl: fit_mt_pl.cpp
	$(CXX) $(CXXFLAGS) $< -o $@ $(OPT_UTIL_INC)

fit_lt_pl: fit_lt_pl.cpp
	$(CXX) $(CXXFLAGS) $< -o $@ $(OPT_UTIL_INC)

fit_mt_bpl: fit_mt_bpl.cpp
	$(CXX) $(CXXFLAGS) $< -o $@ $(OPT_UTIL_INC)

fit_lt_bpl: fit_lt_bpl.cpp
	$(CXX) $(CXXFLAGS) $< -o $@ $(OPT_UTIL_INC)

cooling_time: cooling_time.cpp
	$(CXX) $(CXXFLAGS) -o $@ $<


fit_nfw_sbp.o: fit_nfw_sbp.cpp nfw_ne.hpp $(HEADERS)
	$(CXX) $(CXXFLAGS) -c $< $(OPT_UTIL_INC)

fit_dbeta_sbp.o: fit_dbeta_sbp.cpp constrained_dbeta.hpp $(HEADERS)
	$(CXX) $(CXXFLAGS) -c $< $(OPT_UTIL_INC)

fit_beta_sbp.o: fit_beta_sbp.cpp beta.hpp $(HEADERS)
	$(CXX) $(CXXFLAGS) -c $< $(OPT_UTIL_INC)

fit_wang2012_model.o: fit_wang2012_model.cpp wang2012_model.hpp chisq.hpp
	$(CXX) $(CXXFLAGS) -c $< $(OPT_UTIL_INC)

fit_nfw_mass.o: fit_nfw_mass.cpp nfw.hpp chisq.hpp
	$(CXX) $(CXXFLAGS) -c $< $(OPT_UTIL_INC)

calc_lx_dbeta.o: calc_lx_dbeta.cpp constrained_dbeta.hpp $(HEADERS)
	$(CXX) $(CXXFLAGS) -c $< $(OPT_UTIL_INC)

calc_lx_beta.o: calc_lx_beta.cpp beta.hpp $(HEADERS)
	$(CXX) $(CXXFLAGS) -c $< $(OPT_UTIL_INC)

beta_cfg.o: beta_cfg.cpp beta_cfg.hpp
	$(CXX) $(CXXFLAGS) -c $<

report_error.o: report_error.cpp report_error.hpp
	$(CXX) $(CXXFLAGS) -c $<

dump_fit_qdp.o: dump_fit_qdp.cpp dump_fit_qdp.hpp
	$(CXX) $(CXXFLAGS) -c $< $(OPT_UTIL_INC)

%.o: %.cc
	$(CXX) $(CXXFLAGS) -c $< $(OPT_UTIL_INC)

%.o: %.cpp
	$(CXX) $(CXXFLAGS) -c $< $(OPT_UTIL_INC)


clean:
	rm -f *.o $(TARGETS)