source: branches/alma/src/Makefile@ 1694

Last change on this file since 1694 was 1693, checked in by Takeshi Nakazato, 15 years ago

New Development: No

JIRA Issue: Yes CAS-1908

Ready to Release: Yes

Interface Changes: No

What Interface Changed: Please list interface changes

Test Programs: List test programs

Put in Release Notes: Yes

Module(s): Module Names change impacts.

Description: Describe your changes here...

Changed a tagging as the source type is tagged by using SRCTYPE, not
an extra string in SRCNAME. To do this, I have defined a selection method
by SRCTYPE in STSelector class. I have newly added python_SrcType.cpp
that defines a Python interface of SrcType enums which is defined
in atnf/PKSIO/SrcType.h.

Since I have added new file in the src directory, I have modified src/Makefile
to compile new file.

File size: 6.0 KB
RevLine 
[1455]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'.
[1520]9TARGET := /tmp/_asap.so
[1446]10
11# the casa environment AIPSPATH has to be defined
[1455]12CASAROOT := $(word 1, $(CASAPATH))
13CASAARCH := $(word 2, $(CASAPATH))
[1608]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
[1446]25CASALIB := $(CASAROOT)/$(CASAARCH)/lib
[1608]26USELIB := lib
[1446]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
[1608]53G2CLIB := -lgfortran
[1446]54
55# This assumes all casa libs are static only (*.a)
56# if not than there might by symbol resolution errors.
[1608]57CASAPPLIB := -L$(CASALIB) -latnf $(CORELIB) \
58 -L$(WCSLIBLIBD) $(WCSLIBLIB) \
[1446]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
[1608]69PYTHONINC := $(addprefix -I,$(PYTHONINCD))
70PYTHONLIB := -L$(PYTHONLIBD) $(PYTHONLIB)
[1446]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
[1608]85BOOSTINC := -I$(BOOSTROOT)/include/boost -I$(BOOSTROOT)/include
[1446]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 \
[1603]123 STFITSImageWriter.o \
[1446]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 \
[1693]136 python_SrcType.o \
[1446]137 python_asap.o
138
139OBJECTS := $(CCOBJECTS) $(PYOBJECTS)
140
141HEADERS := MathUtils.h \
142 Logger.h \
143 STAttr.h \
144 STHeader.h \
145 Scantable.h \
146 STFiller.h \
147 STMath.h \
148 RowAccumulator.h \
149 STSubTable.h \
150 STMolecules.h \
151 STTcal.h \
152 STFocus.h \
153 STWeather.h \
154 STHistory.h \
155 STFrequencies.h \
156 STDefs.h \
157 STWriter.h \
158 STSelector.h \
159 STFitter.h \
160 STFit.h \
161 STFitEntry.h \
162 STLineFinder.h \
163 Factory.h \
164 FactoryBase.h \
165 STPol.h \
166 STPolStokes.h \
167 STPolCircular.h \
168 STPolLinear.h \
169 STWriter.h \
[1603]170 STAsciiWriter.h \
171 STFITSImageWriter.h
[1446]172
173STATICCCLIB := libasap.a
174MEMBERS := $(patsubst %,$(STATICCCLIB)(%),$(CCOBJECTS))
175
176.SUFFIXES: .c .o .cpp .cc .cxx .C
177
178.cpp.o:
179 -@ echo
180 $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
181
182.cc.o:
183 -@ echo
184 $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
185
186.cxx.o:
187 -@ echo
188 $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
189
190.C.o:
191 -@ echo
192 $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
193
194
195.PHONY : all clean objects realclean relink
196
197all : $(TARGET)
198
199relink : cleanso $(TARGET)
200
201objects : $(OBJECTS)
202
203$(TARGET) : $(OBJECTS)
204 -@ echo
205 $(LD) $(LDFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS)
206
207$(OBJECTS) : $(HEADERS)
208
209staticlib: $(MEMBERS)
210
211clean :
212 -rm -f $(OBJECTS)
213
214cleanso :
215 -rm -f $(TARGET)
216
217realclean : clean cleanso
218
219test: objects tasap2.o
220 -@ echo
221 $(LD) -g -o /tmp/tasap2 $(OBJECTS) $(LIBS) tasap2.o
Note: See TracBrowser for help on using the repository browser.