[635] | 1 | TARGET := _asap.so
|
---|
| 2 | ifndef CXX
|
---|
| 3 | CXX := g++
|
---|
[260] | 4 | endif
|
---|
[635] | 5 | CXXFLAGS := -O3 -fPIC
|
---|
| 6 | CXXFLAGS += -ansi
|
---|
[82] | 7 | CXXFLAGS += -pedantic -Wno-long-long
|
---|
[2] | 8 |
|
---|
[655] | 9 | CFITSIOROOT := /usr/local If aips++ is build with LFS you need to have
|
---|
| 10 | # libcfitsio with lfs support
|
---|
[635] | 11 | # CFITSIOLIB := /usr/local/lib/libcfitsio_lfs.a
|
---|
| 12 | CFITSIOINC := -I$(CFITSIOROOT)/include/cfitsio
|
---|
| 13 | CFITSIOLIB := -L$(CFITSIOROOT) -lcfitsio
|
---|
[71] | 14 |
|
---|
[82] | 15 | CASAROOT := $(word 1, $(AIPSPATH))
|
---|
[655] | 16 | CASAARCH := $(word 2, $(AIPSPATH))
|
---|
[82] | 17 | CASAINC := -I$(CASAROOT)/code/include
|
---|
[655] | 18 | CASALIB := $(CASAROOT)/$(CASAARCH)/lib
|
---|
| 19 | # This assumes all casa libs are static only (*.a)
|
---|
| 20 | # if not than there might by symbol resolution errors.
|
---|
[82] | 21 | CASAPPLIB := $(CASALIB)/version.o \
|
---|
[655] | 22 | -L$(CASALIB) -static \
|
---|
[193] | 23 | -latnf -limages -lms -lcomponents -lcoordinates \
|
---|
[82] | 24 | -llattices -lfits -lmeasures -lmeasures_f \
|
---|
[655] | 25 | -ltables -lscimath -lscimath_f -lcasa -lwcs \
|
---|
| 26 | -lrpfits $(CFITSIOLIB) -dy -llapack -lblas -lg2c
|
---|
[2] | 27 |
|
---|
[635] | 28 | LD := $(CXX)
|
---|
[655] | 29 | LDFLAGS := -shared -Wl$(TARGET) -s
|
---|
[2] | 30 |
|
---|
[655] | 31 | PYVERSION := 2.3
|
---|
| 32 | PYTHONROOT := /usr
|
---|
| 33 | PYTHONINC := -I$(PYTHONROOT)/include/python$(PYVERSION)
|
---|
| 34 | PYTHONLIB := -L$(PYTHONROOT)/lib -lpython$(PYVERSION)
|
---|
| 35 |
|
---|
| 36 |
|
---|
[635] | 37 | BOOSTROOT := /usr
|
---|
[655] | 38 | BOOSTLIB := -L$(BOOSTROOT)/lib -lboost_python$(PYVERSION)
|
---|
[635] | 39 | BOOSTINC := -I$(BOOSTROOT)/include/boost
|
---|
[2] | 40 |
|
---|
[260] | 41 |
|
---|
[82] | 42 | INCDIRS := -I. $(CASAINC) $(BOOSTINC) $(PYTHONINC) $(CFITSIOINC)
|
---|
[655] | 43 | LIBS := $(PYTHONLIB) $(BOOSTLIB) $(CASAPPLIB)
|
---|
[2] | 44 |
|
---|
[655] | 45 | CCOBJECTS := MathUtils.o \
|
---|
[137] | 46 | MathUtils2.o \
|
---|
[356] | 47 | SDAttr.o \
|
---|
[65] | 48 | SDContainer.o \
|
---|
[465] | 49 | SDFitTable.o \
|
---|
[416] | 50 | SDPol.o \
|
---|
[460] | 51 | SDPol2.o \
|
---|
[65] | 52 | SDMemTable.o \
|
---|
| 53 | SDReader.o \
|
---|
| 54 | SDWriter.o \
|
---|
| 55 | SDMath.o \
|
---|
[99] | 56 | SDFitter.o \
|
---|
[65] | 57 | SDTemplates.o \
|
---|
[168] | 58 | SDMathWrapper.o \
|
---|
[193] | 59 | SDFITSImageWriter.o \
|
---|
[201] | 60 | SDAsciiWriter.o \
|
---|
[655] | 61 | SDLineFinder.o
|
---|
| 62 | PYOBJECTS := python_SDMemTable.o \
|
---|
[65] | 63 | python_SDReader.o \
|
---|
| 64 | python_SDWriter.o \
|
---|
| 65 | python_SDMath.o \
|
---|
[99] | 66 | python_SDFitter.o \
|
---|
[465] | 67 | python_SDFitTable.o \
|
---|
[297] | 68 | python_SDLineFinder.o \
|
---|
[65] | 69 | python_SD.o
|
---|
[31] | 70 |
|
---|
[655] | 71 | OBJECTS := $(CCOBJECTS) $(PYOBJECTS)
|
---|
[2] | 72 |
|
---|
[216] | 73 | HEADERS := SDDefs.h \
|
---|
[356] | 74 | SDAttr.h \
|
---|
[216] | 75 | SDContainer.h \
|
---|
[465] | 76 | SDFitTable.h \
|
---|
[65] | 77 | SDMemTable.h \
|
---|
[416] | 78 | SDPol.h \
|
---|
[65] | 79 | SDReader.h \
|
---|
| 80 | SDWriter.h \
|
---|
| 81 | SDMath.h \
|
---|
[99] | 82 | SDFitter.h \
|
---|
[65] | 83 | SDMemTableWrapper.h \
|
---|
| 84 | SDMathWrapper.h \
|
---|
| 85 | SDReaderWrapper.h \
|
---|
| 86 | SDWriterWrapper.h \
|
---|
[193] | 87 | SDFITSImageWriter.h \
|
---|
[201] | 88 | SDAsciiWriter.h \
|
---|
[297] | 89 | SDLineFinder.h \
|
---|
[65] | 90 | python_SD.h
|
---|
[2] | 91 |
|
---|
[655] | 92 | STATICCCLIB := libasap.a
|
---|
| 93 | MEMBERS := $(patsubst %,$(STATICCCLIB)(%),$(CCOBJECTS))
|
---|
[193] | 94 |
|
---|
[2] | 95 | .SUFFIXES: .c .o .cpp .cc .cxx .C
|
---|
| 96 |
|
---|
| 97 | .cpp.o:
|
---|
[65] | 98 | -@ echo
|
---|
| 99 | $(CXX) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
|
---|
[2] | 100 |
|
---|
| 101 | .cc.o:
|
---|
[65] | 102 | -@ echo
|
---|
| 103 | $(CXX) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
|
---|
[2] | 104 |
|
---|
[65] | 105 | .cxx.o:
|
---|
| 106 | -@ echo
|
---|
| 107 | $(CXX) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
|
---|
[2] | 108 |
|
---|
| 109 | .C.o:
|
---|
[65] | 110 | -@ echo
|
---|
| 111 | $(CXX) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
|
---|
[2] | 112 |
|
---|
| 113 |
|
---|
[65] | 114 | .PHONY : all clean objects realclean relink
|
---|
[2] | 115 |
|
---|
[65] | 116 | all : $(TARGET)
|
---|
| 117 |
|
---|
| 118 | relink : cleanso $(TARGET)
|
---|
| 119 |
|
---|
| 120 | objects : $(OBJECTS)
|
---|
| 121 |
|
---|
| 122 | $(TARGET) : $(OBJECTS)
|
---|
| 123 | -@ echo
|
---|
| 124 | $(LD) $(LDFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS)
|
---|
| 125 |
|
---|
| 126 | $(OBJECTS) : $(HEADERS)
|
---|
| 127 |
|
---|
[655] | 128 | staticlib: $(MEMBERS)
|
---|
| 129 |
|
---|
[65] | 130 | clean :
|
---|
[2] | 131 | -rm -f $(OBJECTS)
|
---|
| 132 |
|
---|
[65] | 133 | cleanso :
|
---|
[2] | 134 | -rm -f $(TARGET)
|
---|
[65] | 135 |
|
---|
| 136 | realclean : clean cleanso
|
---|