[1198] | 1 | TARGET := _asap.so
|
---|
[794] | 2 |
|
---|
| 3 | # the casa environment AIPSPATH has to be defined
|
---|
| 4 | CASAROOT := $(word 1, $(AIPSPATH))
|
---|
| 5 | CASAARCH := $(word 2, $(AIPSPATH))
|
---|
| 6 | CASAINC := -I$(CASAROOT)/code/include -I$(CASAROOT)/code/casa
|
---|
| 7 | CASALIB := $(CASAROOT)/$(CASAARCH)/lib
|
---|
| 8 |
|
---|
| 9 |
|
---|
| 10 | # the compiler
|
---|
[635] | 11 | ifndef CXX
|
---|
| 12 | CXX := g++
|
---|
[260] | 13 | endif
|
---|
[794] | 14 |
|
---|
| 15 | # compiler flags
|
---|
[997] | 16 | CXXFLAGS := -fPIC -O3
|
---|
[1198] | 17 | CXXFLAGS += -ansi -Wno-long-long -Wall
|
---|
[684] | 18 | CXXOPTS := -DAIPS_NO_TEMPLATE_SRC
|
---|
[2] | 19 |
|
---|
[794] | 20 | # darwin specific flags
|
---|
| 21 | ifeq "$(CASAARCH)" "darwin"
|
---|
[1198] | 22 | CXXFLAGS +=-DAIPS_DARWIN
|
---|
| 23 | CXXFLAGS += -Wno-long-double
|
---|
[794] | 24 | endif
|
---|
| 25 |
|
---|
| 26 | # cfitsio
|
---|
[1259] | 27 | CFITSIOROOT := /usr/local
|
---|
[794] | 28 | CFITSIOINC := -I$(CFITSIOROOT)/include
|
---|
[1259] | 29 | CFITSIOLIB := -L$(CFITSIOROOT)/lib -lcfitsio
|
---|
[71] | 30 |
|
---|
[794] | 31 | #rpfits
|
---|
| 32 | RPFITSROOT := /usr/local
|
---|
| 33 | RPFITSLIB := $(RPFITSROOT)/lib/librpfits.a
|
---|
[684] | 34 |
|
---|
[1259] | 35 | G2CROOT := /usr/local
|
---|
| 36 | G2CARCH := $(G2CROOT)/lib/gcc/i386-apple-darwin8.7.1/4.2.0/libgcc.a
|
---|
| 37 | G2CARCH := $(G2CROOT)/lib/gcc/powerpc-apple-darwin8.7.0/4.2.0/libgcc.a
|
---|
| 38 | G2CLIB := $(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] | 42 | CASAPPLIB := $(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
|
---|
| 51 | ifeq "$(CASAARCH)" "darwin"
|
---|
| 52 | CASAPPLIB += -framework vecLib
|
---|
| 53 | else
|
---|
| 54 | CASAPPLIB += -llapack -lblas
|
---|
| 55 | endif
|
---|
| 56 |
|
---|
| 57 | # the linker
|
---|
[635] | 58 | LD := $(CXX)
|
---|
[794] | 59 |
|
---|
[655] | 60 | LDFLAGS := -shared -Wl$(TARGET) -s
|
---|
[794] | 61 | ifeq "$(CASAARCH)" "darwin"
|
---|
[1198] | 62 | LDFLAGS := -bundle
|
---|
[794] | 63 | endif
|
---|
[2] | 64 |
|
---|
[1198] | 65 | # python
|
---|
[655] | 66 | PYVERSION := 2.3
|
---|
[908] | 67 | PYTHONROOT := /usr
|
---|
[655] | 68 | PYTHONINC := -I$(PYTHONROOT)/include/python$(PYVERSION)
|
---|
[908] | 69 | PYTHONLIB := -L$(PYTHONROOT)/lib -lpython$(PYVERSION)
|
---|
[655] | 70 |
|
---|
[1198] | 71 | # use python universal build
|
---|
| 72 | ifeq "$(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
|
---|
| 77 | endif
|
---|
| 78 |
|
---|
[794] | 79 | # has to be build with same g++ version as casa
|
---|
[1259] | 80 | BOOSTROOT := /usr/local
|
---|
[684] | 81 | BOOSTLIB := -L$(BOOSTROOT)/lib -lboost_python
|
---|
[635] | 82 | BOOSTINC := -I$(BOOSTROOT)/include/boost
|
---|
[2] | 83 |
|
---|
[260] | 84 |
|
---|
[794] | 85 | # DO NOT MODIFY AFTER THIS
|
---|
[897] | 86 | INCDIRS := -I. $(CASAINC) $(CFITSIOINC) $(BOOSTINC) $(PYTHONINC)
|
---|
[655] | 87 | LIBS := $(PYTHONLIB) $(BOOSTLIB) $(CASAPPLIB)
|
---|
[2] | 88 |
|
---|
[655] | 89 | CCOBJECTS := 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] | 117 | PYOBJECTS := 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] | 129 | OBJECTS := $(CCOBJECTS) $(PYOBJECTS)
|
---|
[2] | 130 |
|
---|
[813] | 131 | HEADERS := 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] | 161 | STATICCCLIB := libasap.a
|
---|
| 162 | MEMBERS := $(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] | 185 | all : $(TARGET)
|
---|
| 186 |
|
---|
| 187 | relink : cleanso $(TARGET)
|
---|
| 188 |
|
---|
| 189 | objects : $(OBJECTS)
|
---|
| 190 |
|
---|
| 191 | $(TARGET) : $(OBJECTS)
|
---|
| 192 | -@ echo
|
---|
[818] | 193 | $(LD) $(LDFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS)
|
---|
[65] | 194 |
|
---|
| 195 | $(OBJECTS) : $(HEADERS)
|
---|
| 196 |
|
---|
[655] | 197 | staticlib: $(MEMBERS)
|
---|
| 198 |
|
---|
[65] | 199 | clean :
|
---|
[2] | 200 | -rm -f $(OBJECTS)
|
---|
| 201 |
|
---|
[65] | 202 | cleanso :
|
---|
[2] | 203 | -rm -f $(TARGET)
|
---|
[65] | 204 |
|
---|
| 205 | realclean : clean cleanso
|
---|
[813] | 206 |
|
---|
[828] | 207 | test: objects tasap2.o
|
---|
[813] | 208 | -@ echo
|
---|
[828] | 209 | $(LD) -g -o /tmp/tasap2 $(OBJECTS) $(LIBS) tasap2.o
|
---|