[684] | 1 | TARGET := /tmp/_asap.so
|
---|
[794] | 2 |
|
---|
| 3 |
|
---|
| 4 | # the casa environment AIPSPATH has to be defined
|
---|
| 5 | CASAROOT := $(word 1, $(AIPSPATH))
|
---|
| 6 | CASAARCH := $(word 2, $(AIPSPATH))
|
---|
| 7 | CASAINC := -I$(CASAROOT)/code/include -I$(CASAROOT)/code/casa
|
---|
| 8 | CASALIB := $(CASAROOT)/$(CASAARCH)/lib
|
---|
| 9 |
|
---|
| 10 |
|
---|
| 11 | # the compiler
|
---|
[635] | 12 | ifndef CXX
|
---|
| 13 | CXX := g++
|
---|
[260] | 14 | endif
|
---|
[794] | 15 |
|
---|
| 16 | # compiler flags
|
---|
[635] | 17 | CXXFLAGS := -O3 -fPIC
|
---|
[794] | 18 | CXXFLAGS += -ansi -pedantic -Wno-long-long
|
---|
[684] | 19 | CXXOPTS := -DAIPS_NO_TEMPLATE_SRC
|
---|
[2] | 20 |
|
---|
[794] | 21 | # darwin specific flags
|
---|
| 22 | ifeq "$(CASAARCH)" "darwin"
|
---|
| 23 | CXXFLAGS := -O2 -DAIPS_DARWIN
|
---|
| 24 | CXXFLAGS += -ansi -pedantic -Wno-long-long -Wno-long-double
|
---|
| 25 | endif
|
---|
| 26 |
|
---|
| 27 |
|
---|
| 28 | # cfitsio
|
---|
| 29 | CFITSIOROOT := /usr/local
|
---|
| 30 | # If aips++ is build with LFS you need to have
|
---|
[655] | 31 | # libcfitsio with lfs support
|
---|
[794] | 32 | CFITSIOINC := -I$(CFITSIOROOT)/include
|
---|
| 33 | CFITSIOLIB := $(CFITSIOROOT)/lib/libcfitsio_lfs.a
|
---|
[684] | 34 | #CFITSIOLIB := -L$(CFITSIOROOT) -lcfitsio
|
---|
[71] | 35 |
|
---|
[794] | 36 | #rpfits
|
---|
| 37 | RPFITSROOT := /usr/local
|
---|
| 38 | RPFITSLIB := $(RPFITSROOT)/lib/librpfits.a
|
---|
[684] | 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) \
|
---|
[193] | 44 | -latnf -limages -lms -lcomponents -lcoordinates \
|
---|
[82] | 45 | -llattices -lfits -lmeasures -lmeasures_f \
|
---|
[684] | 46 | -ltables -lscimath -lscimath_f -lcasa \
|
---|
| 47 | $(CASALIB)/libwcs.a \
|
---|
[794] | 48 | $(RPFITSLIB) $(CFITSIOLIB) -lg2c -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"
|
---|
| 62 | LDFLAGS := -dynamiclib -single_module
|
---|
| 63 | endif
|
---|
[2] | 64 |
|
---|
[794] | 65 | # python only 2.3 has been tested
|
---|
[655] | 66 | PYVERSION := 2.3
|
---|
| 67 | PYTHONROOT := /usr
|
---|
| 68 | PYTHONINC := -I$(PYTHONROOT)/include/python$(PYVERSION)
|
---|
| 69 | PYTHONLIB := -L$(PYTHONROOT)/lib -lpython$(PYVERSION)
|
---|
| 70 |
|
---|
[794] | 71 | # has to be build with same g++ version as casa
|
---|
[635] | 72 | BOOSTROOT := /usr
|
---|
[684] | 73 | BOOSTLIB := -L$(BOOSTROOT)/lib -lboost_python
|
---|
[635] | 74 | BOOSTINC := -I$(BOOSTROOT)/include/boost
|
---|
[2] | 75 |
|
---|
[260] | 76 |
|
---|
[794] | 77 | # DO NOT MODIFY AFTER THIS
|
---|
[82] | 78 | INCDIRS := -I. $(CASAINC) $(BOOSTINC) $(PYTHONINC) $(CFITSIOINC)
|
---|
[655] | 79 | LIBS := $(PYTHONLIB) $(BOOSTLIB) $(CASAPPLIB)
|
---|
[2] | 80 |
|
---|
[655] | 81 | CCOBJECTS := MathUtils.o \
|
---|
[137] | 82 | MathUtils2.o \
|
---|
[717] | 83 | SDLog.o \
|
---|
[356] | 84 | SDAttr.o \
|
---|
[65] | 85 | SDContainer.o \
|
---|
[465] | 86 | SDFitTable.o \
|
---|
[416] | 87 | SDPol.o \
|
---|
[460] | 88 | SDPol2.o \
|
---|
[65] | 89 | SDMemTable.o \
|
---|
| 90 | SDReader.o \
|
---|
| 91 | SDWriter.o \
|
---|
| 92 | SDMath.o \
|
---|
[99] | 93 | SDFitter.o \
|
---|
[65] | 94 | SDTemplates.o \
|
---|
[168] | 95 | SDMathWrapper.o \
|
---|
[193] | 96 | SDFITSImageWriter.o \
|
---|
[201] | 97 | SDAsciiWriter.o \
|
---|
[655] | 98 | SDLineFinder.o
|
---|
| 99 | PYOBJECTS := python_SDMemTable.o \
|
---|
[65] | 100 | python_SDReader.o \
|
---|
| 101 | python_SDWriter.o \
|
---|
| 102 | python_SDMath.o \
|
---|
[99] | 103 | python_SDFitter.o \
|
---|
[465] | 104 | python_SDFitTable.o \
|
---|
[297] | 105 | python_SDLineFinder.o \
|
---|
[717] | 106 | python_SDLog.o \
|
---|
[65] | 107 | python_SD.o
|
---|
[31] | 108 |
|
---|
[655] | 109 | OBJECTS := $(CCOBJECTS) $(PYOBJECTS)
|
---|
[2] | 110 |
|
---|
[216] | 111 | HEADERS := SDDefs.h \
|
---|
[356] | 112 | SDAttr.h \
|
---|
[216] | 113 | SDContainer.h \
|
---|
[465] | 114 | SDFitTable.h \
|
---|
[65] | 115 | SDMemTable.h \
|
---|
[416] | 116 | SDPol.h \
|
---|
[65] | 117 | SDReader.h \
|
---|
| 118 | SDWriter.h \
|
---|
| 119 | SDMath.h \
|
---|
[99] | 120 | SDFitter.h \
|
---|
[65] | 121 | SDMemTableWrapper.h \
|
---|
| 122 | SDMathWrapper.h \
|
---|
| 123 | SDReaderWrapper.h \
|
---|
| 124 | SDWriterWrapper.h \
|
---|
[193] | 125 | SDFITSImageWriter.h \
|
---|
[201] | 126 | SDAsciiWriter.h \
|
---|
[297] | 127 | SDLineFinder.h \
|
---|
[717] | 128 | SDLog.h \
|
---|
[65] | 129 | python_SD.h
|
---|
[2] | 130 |
|
---|
[655] | 131 | STATICCCLIB := libasap.a
|
---|
| 132 | MEMBERS := $(patsubst %,$(STATICCCLIB)(%),$(CCOBJECTS))
|
---|
[193] | 133 |
|
---|
[2] | 134 | .SUFFIXES: .c .o .cpp .cc .cxx .C
|
---|
| 135 |
|
---|
| 136 | .cpp.o:
|
---|
[65] | 137 | -@ echo
|
---|
[684] | 138 | $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
|
---|
[2] | 139 |
|
---|
| 140 | .cc.o:
|
---|
[65] | 141 | -@ echo
|
---|
[684] | 142 | $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
|
---|
[2] | 143 |
|
---|
[65] | 144 | .cxx.o:
|
---|
| 145 | -@ echo
|
---|
[684] | 146 | $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
|
---|
[2] | 147 |
|
---|
| 148 | .C.o:
|
---|
[65] | 149 | -@ echo
|
---|
[684] | 150 | $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
|
---|
[2] | 151 |
|
---|
| 152 |
|
---|
[65] | 153 | .PHONY : all clean objects realclean relink
|
---|
[2] | 154 |
|
---|
[65] | 155 | all : $(TARGET)
|
---|
| 156 |
|
---|
| 157 | relink : cleanso $(TARGET)
|
---|
| 158 |
|
---|
| 159 | objects : $(OBJECTS)
|
---|
| 160 |
|
---|
| 161 | $(TARGET) : $(OBJECTS)
|
---|
| 162 | -@ echo
|
---|
| 163 | $(LD) $(LDFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS)
|
---|
| 164 |
|
---|
| 165 | $(OBJECTS) : $(HEADERS)
|
---|
| 166 |
|
---|
[655] | 167 | staticlib: $(MEMBERS)
|
---|
| 168 |
|
---|
[65] | 169 | clean :
|
---|
[2] | 170 | -rm -f $(OBJECTS)
|
---|
| 171 |
|
---|
[65] | 172 | cleanso :
|
---|
[2] | 173 | -rm -f $(TARGET)
|
---|
[65] | 174 |
|
---|
| 175 | realclean : clean cleanso
|
---|