source: trunk/src/Makefile@ 1292

Last change on this file since 1292 was 1259, 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.9 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
[1259]27CFITSIOROOT := /usr/local
[794]28CFITSIOINC := -I$(CFITSIOROOT)/include
[1259]29CFITSIOLIB := -L$(CFITSIOROOT)/lib -lcfitsio
[71]30
[794]31#rpfits
32RPFITSROOT := /usr/local
33RPFITSLIB := $(RPFITSROOT)/lib/librpfits.a
[684]34
[1259]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)
[1198]39
[655]40# This assumes all casa libs are static only (*.a)
41# if not than there might by symbol resolution errors.
[82]42CASAPPLIB := $(CASALIB)/version.o \
[794]43 -L$(CASALIB) \
[818]44 -latnf -limages -lms -lcomponents -lcoordinates \
45 -llattices -lfits -lmeasures -lmeasures_f \
46 -ltables -lscimath -lscimath_f -lcasa \
47 $(CASALIB)/libwcs.a \
[1198]48 $(RPFITSLIB) $(CFITSIOLIB) $(G2CLIB) -lstdc++
[2]49
[794]50# darwin specific CASA flags
51ifeq "$(CASAARCH)" "darwin"
52 CASAPPLIB += -framework vecLib
53else
54 CASAPPLIB += -llapack -lblas
55endif
56
57# the linker
[635]58LD := $(CXX)
[794]59
[655]60LDFLAGS := -shared -Wl$(TARGET) -s
[794]61ifeq "$(CASAARCH)" "darwin"
[1198]62 LDFLAGS := -bundle
[794]63endif
[2]64
[1198]65# python
[655]66PYVERSION := 2.3
[908]67PYTHONROOT := /usr
[655]68PYTHONINC := -I$(PYTHONROOT)/include/python$(PYVERSION)
[908]69PYTHONLIB := -L$(PYTHONROOT)/lib -lpython$(PYVERSION)
[655]70
[1198]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
[794]79# has to be build with same g++ version as casa
[1259]80BOOSTROOT := /usr/local
[684]81BOOSTLIB := -L$(BOOSTROOT)/lib -lboost_python
[635]82BOOSTINC := -I$(BOOSTROOT)/include/boost
[2]83
[260]84
[794]85# DO NOT MODIFY AFTER THIS
[897]86INCDIRS := -I. $(CASAINC) $(CFITSIOINC) $(BOOSTINC) $(PYTHONINC)
[655]87LIBS := $(PYTHONLIB) $(BOOSTLIB) $(CASAPPLIB)
[2]88
[655]89CCOBJECTS := MathUtils.o \
[1198]90 MathUtils2.o \
[897]91 RowAccumulator.o \
[894]92 Logger.o \
[1259]93 LineCatalog.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 \
[1259]126 python_LineCatalog.o \
[879]127 python_asap.o
[31]128
[655]129OBJECTS := $(CCOBJECTS) $(PYOBJECTS)
[2]130
[813]131HEADERS := MathUtils.h \
[894]132 Logger.h \
[879]133 STAttr.h \
[901]134 STHeader.h \
[813]135 Scantable.h \
[818]136 STFiller.h \
137 STMath.h \
138 RowAccumulator.h \
139 STSubTable.h \
140 STMolecules.h \
141 STTcal.h \
142 STFocus.h \
143 STWeather.h \
[860]144 STHistory.h \
[818]145 STFrequencies.h \
[828]146 STDefs.h \
147 STWriter.h \
[882]148 STSelector.h \
[894]149 STFitter.h \
[962]150 STFit.h \
151 STFitEntry.h \
[897]152 STLineFinder.h \
153 Factory.h \
154 FactoryBase.h \
155 STPol.h \
[916]156 STPolStokes.h \
[988]157 STPolLinear.h \
158 STWriter.h \
159 STAsciiWriter.h
[2]160
[655]161STATICCCLIB := libasap.a
162MEMBERS := $(patsubst %,$(STATICCCLIB)(%),$(CCOBJECTS))
[193]163
[2]164.SUFFIXES: .c .o .cpp .cc .cxx .C
165
166.cpp.o:
[65]167 -@ echo
[818]168 $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
[2]169
170.cc.o:
[65]171 -@ echo
[818]172 $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
[2]173
[65]174.cxx.o:
175 -@ echo
[818]176 $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
[2]177
178.C.o:
[65]179 -@ echo
[818]180 $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
[2]181
182
[65]183.PHONY : all clean objects realclean relink
[2]184
[65]185all : $(TARGET)
186
187relink : cleanso $(TARGET)
188
189objects : $(OBJECTS)
190
191$(TARGET) : $(OBJECTS)
192 -@ echo
[818]193 $(LD) $(LDFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS)
[65]194
195$(OBJECTS) : $(HEADERS)
196
[655]197staticlib: $(MEMBERS)
198
[65]199clean :
[2]200 -rm -f $(OBJECTS)
201
[65]202cleanso :
[2]203 -rm -f $(TARGET)
[65]204
205realclean : clean cleanso
[813]206
[828]207test: objects tasap2.o
[813]208 -@ echo
[828]209 $(LD) -g -o /tmp/tasap2 $(OBJECTS) $(LIBS) tasap2.o
Note: See TracBrowser for help on using the repository browser.