source: branches/alma/src/Makefile@ 1449

Last change on this file since 1449 was 1446, checked in by TakTsutsumi, 16 years ago

Merged recent updates (since 2007) from nrao-asap

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