source: trunk/src/Makefile@ 1226

Last change on this file since 1226 was 1198, checked in by mar637, 18 years ago

Merge from Release2.1.0b tag

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