forked from lime-rt/lime
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
165 lines (127 loc) · 3.63 KB
/
Makefile
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
160
161
162
163
164
# Makefile
# This file is part of LIME, the versatile line modeling engine
#
# Copyright (C) 2006-2014 Christian Brinch
# Copyright (C) 2015-2017 The LIME development team
# Platform-dependent stuff:
include Makefile.defs
##
## Make sure to put the correct paths.
##
PREFIX = ${PATHTOLIME}
# Paths:
srcdir = ${CURDIR}/src
docdir = ${CURDIR}/doc
exampledir = ${CURDIR}/example
pydir = ${CURDIR}/python
#*** better to use ${PREFIX} here rather than ${CURDIR}? (the latter is used in artist/lime.)
ifneq (,$(wildcard ${PREFIX}/lib/.))
LIBS += -L${PREFIX}/lib
endif
ifneq (,$(wildcard ${HOME}/lib/.))
LIBS += -L${HOME}/lib
endif
ifneq (,$(wildcard /opt/local/lib/.))
LIBS += -L/opt/local/lib
endif
ifneq (,$(wildcard /sw/lib/.))
LIBS += -L/sw/lib
endif
ifneq (,$(wildcard /usr/local/lib/.))
LIBS += -L/usr/local/lib
endif
CPPFLAGS += -I${PREFIX}/include \
-I${PREFIX}/src \
-I${HOME}/include \
-I/opt/local/include \
-I/sw//include \
${EXTRACPPFLAGS}
# Names of source files included:
include Makefile.srcs
##
## Do not change anything below unless you know what you are doing!
##
TARGET = lime.x # Overwritten in usual practice by the value passed in by the 'lime' script.
CASATARGET = casaray.so
CC = gcc -fopenmp
MODELS = model.c # Overwritten in usual practice by the value passed in by the 'lime' script.
MODELO = ${srcdir}/model.o
CCFLAGS += -O3 -falign-loops=16 -fno-strict-aliasing
LDFLAGS += -lgsl -lgslcblas -l${LIB_QHULL} -lcfitsio -lncurses -lm
ifeq (${DOTEST},yes)
CCFLAGS += -DTEST
# CC += -g -Wunused -Wno-unused-value -Wformat -Wformat-security
CC += -g -Wall
endif
ifeq (${VERBOSE},no)
CCFLAGS += -DNOVERBOSE
endif
ifeq (${USEHDF5},yes)
CPPFLAGS += -DUSEHDF5
CCFLAGS += -DH5_NO_DEPRECATED_SYMBOLS
LDFLAGS += -lhdf5_hl -lhdf5 -lz
CORESOURCES += ${HDF5SOURCES}
CONVSOURCES += ${HDF5SOURCES}
CASASOURCES += ${HDF5SOURCES}
COREINCLUDES += ${HDF5INCLUDES}
# CASAINCLUDES += ${HDF5INCLUDES}
else
CORESOURCES += ${FITSSOURCES}
CONVSOURCES += ${FITSSOURCES}
CASASOURCES += ${FITSSOURCES}
COREINCLUDES += ${FITSINCLUDES}
# CASAINCLUDES += ${FITSINCLUDES}
endif
SRCS = ${CORESOURCES} ${STDSOURCES}
INCS = ${COREINCLUDES}
OBJS = $(SRCS:.c=.o)
PYSRCS = ${CORESOURCES} ${PYSOURCES}
PYINCS = ${COREINCLUDES} ${PYINCLUDES}
PYOBJS = $(PYSRCS:.c=.o)
CASASRCS = ${CASASOURCES}
#CASAINCS = ${CASAINCLUDES}
CASAINCS = ${COREINCLUDES}
CASAOBJS = $(CASASRCS:.c=.o)
CONV_OBJS = $(CONVSOURCES:.c=.o)
.PHONY: all doc docclean objclean limeclean clean distclean pyclean casa
all:: ${TARGET}
# Implicit rules:
%.o : %.c
${CC} ${CCFLAGS} ${CPPFLAGS} -o $@ -c $<
${TARGET}: ${OBJS} ${MODELO}
${CC} -o $@ $^ ${LIBS} ${LDFLAGS}
${OBJS} : ${INCS}
${PYOBJS} : ${PYINCS}
${CONV_OBJS} : ${CONVINCLUDES}
${MODELO}: ${INCS}
${CC} ${CCFLAGS} ${CPPFLAGS} -o ${MODELO} -c ${MODELS}
pylime: CCFLAGS += ${PYCCFLAGS}
pylime: CPPFLAGS += -DNO_NCURSES -DIS_PYTHON
pylime: LDFLAGS += ${PYLDFLAGS}
pylime: ${PYOBJS}
${CC} -o $@ $^ ${LIBS} ${LDFLAGS}
casa: CCFLAGS += ${PYCCFLAGS} -fPIC
casa: CPPFLAGS += -DNO_NCURSES -DIS_PYTHON -DCASARAY
casa: LDFLAGS += ${PYLDFLAGS} -shared
casa: ${CASATARGET}
${CASATARGET}: ${CASAOBJS}
${CC} -o $@ $^ ${LIBS} ${LDFLAGS}
gridconvert : CPPFLAGS += -DNO_NCURSES
gridconvert: ${CONV_OBJS}
${CC} -o $@ $^ ${LIBS} ${LDFLAGS}
doc::
mkdir ${docdir}/_html || true
sphinx-build doc ${docdir}/_html
docclean::
rm -rf ${docdir}/_html
objclean::
rm -f ${srcdir}/*.o
limeclean:: objclean
rm -f ${TARGET}
pyclean:: objclean
rm -f ${pydir}/*.pyc pylime
clean:: objclean pyclean
rm -f gridconvert
rm -f *~ ${srcdir}/*~ ${CASATARGET}
distclean:: clean docclean limeclean
rm Makefile.defs