1 | TARGET := /tmp/_asap.so
|
---|
2 |
|
---|
3 | # the casa environment AIPSPATH has to be defined
|
---|
4 | CASAROOT := $(word 1, $(AIPSPATH))
|
---|
5 | CASAARCH := $(word 2, $(AIPSPATH))
|
---|
6 | CASAINC := -I$(CASAROOT)/code/include -I$(CASAROOT)/code/casa
|
---|
7 | CASALIB := $(CASAROOT)/$(CASAARCH)/lib
|
---|
8 |
|
---|
9 |
|
---|
10 | # the compiler
|
---|
11 | CXX := g++-3.2.3
|
---|
12 |
|
---|
13 | # compiler flags
|
---|
14 | CXXFLAGS := -fPIC -O3
|
---|
15 | CXXFLAGS += -ansi -pedantic -Wno-long-long -Wall
|
---|
16 | CXXOPTS := -DAIPS_NO_TEMPLATE_SRC
|
---|
17 |
|
---|
18 | # darwin specific flags
|
---|
19 | ifeq "$(CASAARCH)" "darwin"
|
---|
20 | CXXFLAGS := -O2 -DAIPS_DARWIN
|
---|
21 | CXXFLAGS += -ansi -pedantic -Wno-long-long -Wno-long-double
|
---|
22 | endif
|
---|
23 |
|
---|
24 |
|
---|
25 | # cfitsio
|
---|
26 | CFITSIOROOT := /usr/local
|
---|
27 | # If aips++ is build with LFS you need to have
|
---|
28 | # libcfitsio with lfs support
|
---|
29 | CFITSIOINC := -I$(CFITSIOROOT)/include
|
---|
30 | CFITSIOLIB := $(CFITSIOROOT)/lib/libcfitsio_lfs.a
|
---|
31 | #CFITSIOLIB := -L$(CFITSIOROOT) -lcfitsio
|
---|
32 |
|
---|
33 | #rpfits
|
---|
34 | RPFITSROOT := /usr/local
|
---|
35 | RPFITSLIB := $(RPFITSROOT)/lib/librpfits.a
|
---|
36 |
|
---|
37 | # This assumes all casa libs are static only (*.a)
|
---|
38 | # if not than there might by symbol resolution errors.
|
---|
39 | CASAPPLIB := $(CASALIB)/version.o \
|
---|
40 | -L$(CASALIB) \
|
---|
41 | -latnf -limages -lms -lcomponents -lcoordinates \
|
---|
42 | -llattices -lfits -lmeasures -lmeasures_f \
|
---|
43 | -ltables -lscimath -lscimath_f -lcasa \
|
---|
44 | $(CASALIB)/libwcs.a \
|
---|
45 | $(RPFITSLIB) $(CFITSIOLIB) -lg2c -lstdc++
|
---|
46 |
|
---|
47 | # darwin specific CASA flags
|
---|
48 | ifeq "$(CASAARCH)" "darwin"
|
---|
49 | CASAPPLIB += -framework vecLib
|
---|
50 | else
|
---|
51 | CASAPPLIB += -llapack -lblas
|
---|
52 | endif
|
---|
53 |
|
---|
54 | # the linker
|
---|
55 | LD := $(CXX)
|
---|
56 |
|
---|
57 | LDFLAGS := -shared -Wl$(TARGET) -s
|
---|
58 | ifeq "$(CASAARCH)" "darwin"
|
---|
59 | LDFLAGS := -dynamiclib -single_module
|
---|
60 | endif
|
---|
61 |
|
---|
62 | # python only 2.3 has been tested
|
---|
63 | PYVERSION := 2.3
|
---|
64 | PYTHONROOT := /usr/local
|
---|
65 | PYTHONINC := -I$(PYTHONROOT)/include/python$(PYVERSION)
|
---|
66 | PYTHONLIB := -L$(PYTHONROOT)/lib -lpython$(PYVERSION)
|
---|
67 |
|
---|
68 | # has to be build with same g++ version as casa
|
---|
69 | BOOSTROOT := /usr/local
|
---|
70 | BOOSTLIB := -L$(BOOSTROOT)/lib -lboost_python$(PYVERSION)
|
---|
71 | BOOSTINC := -I$(BOOSTROOT)/include/boost
|
---|
72 |
|
---|
73 |
|
---|
74 | # DO NOT MODIFY AFTER THIS
|
---|
75 | INCDIRS := -I. $(CASAINC) $(CFITSIOINC) $(BOOSTINC) $(PYTHONINC)
|
---|
76 | LIBS := $(PYTHONLIB) $(BOOSTLIB) $(CASAPPLIB)
|
---|
77 |
|
---|
78 | CCOBJECTS := MathUtils.o \
|
---|
79 | MathUtils2.o \
|
---|
80 | RowAccumulator.o \
|
---|
81 | Logger.o \
|
---|
82 | STAttr.o \
|
---|
83 | STHeader.o \
|
---|
84 | STFiller.o \
|
---|
85 | STMath.o \
|
---|
86 | STSubTable.o \
|
---|
87 | STMolecules.o \
|
---|
88 | STTcal.o \
|
---|
89 | STFocus.o \
|
---|
90 | STWeather.o \
|
---|
91 | STFrequencies.o \
|
---|
92 | STHistory.o \
|
---|
93 | STSelector.o \
|
---|
94 | STLineFinder.o \
|
---|
95 | STFitter.o \
|
---|
96 | STFitEntry.o \
|
---|
97 | STFit.o \
|
---|
98 | STPol.o \
|
---|
99 | STPolLinear.o \
|
---|
100 | STPolStokes.o \
|
---|
101 | STWriter.o \
|
---|
102 | STAsciiWriter.o \
|
---|
103 | Scantable.o \
|
---|
104 | Templates.o
|
---|
105 | PYOBJECTS := python_Scantable.o \
|
---|
106 | python_STFiller.o \
|
---|
107 | python_STSelector.o \
|
---|
108 | python_STMath.o \
|
---|
109 | python_Fitter.o \
|
---|
110 | python_Logger.o \
|
---|
111 | python_STLineFinder.o \
|
---|
112 | python_STFitEntry.o \
|
---|
113 | python_STWriter.o \
|
---|
114 | python_asap.o
|
---|
115 |
|
---|
116 | OBJECTS := $(CCOBJECTS) $(PYOBJECTS)
|
---|
117 |
|
---|
118 | HEADERS := MathUtils.h \
|
---|
119 | Logger.h \
|
---|
120 | STAttr.h \
|
---|
121 | STHeader.h \
|
---|
122 | Scantable.h \
|
---|
123 | STFiller.h \
|
---|
124 | STMath.h \
|
---|
125 | RowAccumulator.h \
|
---|
126 | STSubTable.h \
|
---|
127 | STMolecules.h \
|
---|
128 | STTcal.h \
|
---|
129 | STFocus.h \
|
---|
130 | STWeather.h \
|
---|
131 | STHistory.h \
|
---|
132 | STFrequencies.h \
|
---|
133 | STDefs.h \
|
---|
134 | STWriter.h \
|
---|
135 | STSelector.h \
|
---|
136 | STFitter.h \
|
---|
137 | STFit.h \
|
---|
138 | STFitEntry.h \
|
---|
139 | STLineFinder.h \
|
---|
140 | Factory.h \
|
---|
141 | FactoryBase.h \
|
---|
142 | STPol.h \
|
---|
143 | STPolStokes.h \
|
---|
144 | STPolLinear.h \
|
---|
145 | STWriter.h \
|
---|
146 | STAsciiWriter.h
|
---|
147 |
|
---|
148 | STATICCCLIB := libasap.a
|
---|
149 | MEMBERS := $(patsubst %,$(STATICCCLIB)(%),$(CCOBJECTS))
|
---|
150 |
|
---|
151 | .SUFFIXES: .c .o .cpp .cc .cxx .C
|
---|
152 |
|
---|
153 | .cpp.o:
|
---|
154 | -@ echo
|
---|
155 | $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
|
---|
156 |
|
---|
157 | .cc.o:
|
---|
158 | -@ echo
|
---|
159 | $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
|
---|
160 |
|
---|
161 | .cxx.o:
|
---|
162 | -@ echo
|
---|
163 | $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
|
---|
164 |
|
---|
165 | .C.o:
|
---|
166 | -@ echo
|
---|
167 | $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
|
---|
168 |
|
---|
169 |
|
---|
170 | .PHONY : all clean objects realclean relink
|
---|
171 |
|
---|
172 | all : $(TARGET)
|
---|
173 |
|
---|
174 | relink : cleanso $(TARGET)
|
---|
175 |
|
---|
176 | objects : $(OBJECTS)
|
---|
177 |
|
---|
178 | $(TARGET) : $(OBJECTS)
|
---|
179 | -@ echo
|
---|
180 | $(LD) $(LDFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS)
|
---|
181 |
|
---|
182 | $(OBJECTS) : $(HEADERS)
|
---|
183 |
|
---|
184 | staticlib: $(MEMBERS)
|
---|
185 |
|
---|
186 | clean :
|
---|
187 | -rm -f $(OBJECTS)
|
---|
188 |
|
---|
189 | cleanso :
|
---|
190 | -rm -f $(TARGET)
|
---|
191 |
|
---|
192 | realclean : clean cleanso
|
---|
193 |
|
---|
194 | test: objects tasap2.o
|
---|
195 | -@ echo
|
---|
196 | $(LD) -g -o /tmp/tasap2 $(OBJECTS) $(LIBS) tasap2.o
|
---|