source: branches/Release2.1/src/Makefile@ 1858

Last change on this file since 1858 was 1253, checked in by mar637, 18 years ago

Changed default to darwin settings

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