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