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