source: branches/Release2.1.2/src/Makefile@ 1472

Last change on this file since 1472 was 1295, checked in by mar637, 18 years ago

merge form Release2.1.1 branch

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