[684] | 1 | TARGET := /tmp/_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) \
|
---|
[193] | 43 | -latnf -limages -lms -lcomponents -lcoordinates \
|
---|
[82] | 44 | -llattices -lfits -lmeasures -lmeasures_f \
|
---|
[684] | 45 | -ltables -lscimath -lscimath_f -lcasa \
|
---|
| 46 | $(CASALIB)/libwcs.a \
|
---|
[794] | 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
|
---|
| 66 | PYTHONROOT := /usr
|
---|
| 67 | PYTHONINC := -I$(PYTHONROOT)/include/python$(PYVERSION)
|
---|
| 68 | PYTHONLIB := -L$(PYTHONROOT)/lib -lpython$(PYVERSION)
|
---|
| 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
|
---|
[82] | 77 | INCDIRS := -I. $(CASAINC) $(BOOSTINC) $(PYTHONINC) $(CFITSIOINC)
|
---|
[655] | 78 | LIBS := $(PYTHONLIB) $(BOOSTLIB) $(CASAPPLIB)
|
---|
[2] | 79 |
|
---|
[655] | 80 | CCOBJECTS := MathUtils.o \
|
---|
[137] | 81 | MathUtils2.o \
|
---|
[717] | 82 | SDLog.o \
|
---|
[356] | 83 | SDAttr.o \
|
---|
[65] | 84 | SDContainer.o \
|
---|
[813] | 85 | Scantable.o \
|
---|
| 86 | ScantableFiller.o \
|
---|
[65] | 87 | SDTemplates.o \
|
---|
[813] | 88 | STMath.o \
|
---|
| 89 | STSubTable.o \
|
---|
| 90 | STMolecules.o \
|
---|
| 91 | STTcal.o \
|
---|
| 92 | STFocus.o \
|
---|
| 93 | STWeather.o \
|
---|
| 94 | STFrequencies.o \
|
---|
| 95 | RowAccumulator.o \
|
---|
| 96 | STSelector.o
|
---|
| 97 | PYOBJECTS :=
|
---|
[31] | 98 |
|
---|
[655] | 99 | OBJECTS := $(CCOBJECTS) $(PYOBJECTS)
|
---|
[2] | 100 |
|
---|
[813] | 101 | HEADERS := MathUtils.h \
|
---|
| 102 | SDLog.h \
|
---|
[356] | 103 | SDAttr.h \
|
---|
[216] | 104 | SDContainer.h \
|
---|
[813] | 105 | Scantable.h \
|
---|
| 106 | ScantableFiller.h \
|
---|
| 107 | STMath.h \
|
---|
| 108 | RowAccumulator.h \
|
---|
| 109 | STSubTable.h \
|
---|
| 110 | STMolecules.h \
|
---|
| 111 | STTcal.h \
|
---|
| 112 | STFocus.h \
|
---|
| 113 | STWeather.h \
|
---|
| 114 | STFrequencies.h \
|
---|
| 115 | SDDefs.h \
|
---|
| 116 | STSelector.h
|
---|
[2] | 117 |
|
---|
[655] | 118 | STATICCCLIB := libasap.a
|
---|
| 119 | MEMBERS := $(patsubst %,$(STATICCCLIB)(%),$(CCOBJECTS))
|
---|
[193] | 120 |
|
---|
[2] | 121 | .SUFFIXES: .c .o .cpp .cc .cxx .C
|
---|
| 122 |
|
---|
| 123 | .cpp.o:
|
---|
[65] | 124 | -@ echo
|
---|
[684] | 125 | $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
|
---|
[2] | 126 |
|
---|
| 127 | .cc.o:
|
---|
[65] | 128 | -@ echo
|
---|
[684] | 129 | $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
|
---|
[2] | 130 |
|
---|
[65] | 131 | .cxx.o:
|
---|
| 132 | -@ echo
|
---|
[684] | 133 | $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
|
---|
[2] | 134 |
|
---|
| 135 | .C.o:
|
---|
[65] | 136 | -@ echo
|
---|
[684] | 137 | $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
|
---|
[2] | 138 |
|
---|
| 139 |
|
---|
[65] | 140 | .PHONY : all clean objects realclean relink
|
---|
[2] | 141 |
|
---|
[65] | 142 | all : $(TARGET)
|
---|
| 143 |
|
---|
| 144 | relink : cleanso $(TARGET)
|
---|
| 145 |
|
---|
| 146 | objects : $(OBJECTS)
|
---|
| 147 |
|
---|
| 148 | $(TARGET) : $(OBJECTS)
|
---|
| 149 | -@ echo
|
---|
| 150 | $(LD) $(LDFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS)
|
---|
| 151 |
|
---|
| 152 | $(OBJECTS) : $(HEADERS)
|
---|
| 153 |
|
---|
[655] | 154 | staticlib: $(MEMBERS)
|
---|
| 155 |
|
---|
[65] | 156 | clean :
|
---|
[2] | 157 | -rm -f $(OBJECTS)
|
---|
| 158 |
|
---|
[65] | 159 | cleanso :
|
---|
[2] | 160 | -rm -f $(TARGET)
|
---|
[65] | 161 |
|
---|
| 162 | realclean : clean cleanso
|
---|
[813] | 163 |
|
---|
| 164 | test: tFiller.o objects
|
---|
| 165 | -@ echo
|
---|
| 166 | $(LD) -g -o /tmp/tFiller $(OBJECTS) $(LIBS) tFiller.o
|
---|