source: branches/Release2.1.1/src/Makefile.woody@ 3037

Last change on this file since 3037 was 1036, checked in by mar637, 19 years ago

woody specific Makefile

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