source: branches/alma/src/Makefile@ 1628

Last change on this file since 1628 was 1608, checked in by TakTsutsumi, 15 years ago

New Development: No

JIRA Issue: No

Ready to Release: Yes

Interface Changes: No

What Interface Changed: Please list interface changes

Test Programs: List test programs

Put in Release Notes: No

Module(s): Module Names change impacts.

Description: update from locally reverted Makefile

by Darrell


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