[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
|
---|
[698] | 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
|
---|
[698] | 12 | CFITSIOLIB := /usr/local/lib/libcfitsio_lfs.a
|
---|
| 13 | #CFITSIOINC := -I$(CFITSIOROOT)/include/cfitsio
|
---|
| 14 | #CFITSIOLIB := -L$(CFITSIOROOT) -lcfitsio
|
---|
[71] | 15 |
|
---|
[698] | 16 |
|
---|
[82] | 17 | CASAROOT := $(word 1, $(AIPSPATH))
|
---|
[655] | 18 | CASAARCH := $(word 2, $(AIPSPATH))
|
---|
[698] | 19 | CASAINC := -I$(CASAROOT)/code/include -I$(CASAROOT)/code/casa/wcslib
|
---|
[655] | 20 | CASALIB := $(CASAROOT)/$(CASAARCH)/lib
|
---|
[698] | 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 \
|
---|
[698] | 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
|
---|
[698] | 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 \
|
---|
[356] | 52 | SDAttr.o \
|
---|
[65] | 53 | SDContainer.o \
|
---|
[465] | 54 | SDFitTable.o \
|
---|
[416] | 55 | SDPol.o \
|
---|
[460] | 56 | SDPol2.o \
|
---|
[65] | 57 | SDMemTable.o \
|
---|
| 58 | SDReader.o \
|
---|
| 59 | SDWriter.o \
|
---|
| 60 | SDMath.o \
|
---|
[99] | 61 | SDFitter.o \
|
---|
[65] | 62 | SDTemplates.o \
|
---|
[168] | 63 | SDMathWrapper.o \
|
---|
[193] | 64 | SDFITSImageWriter.o \
|
---|
[201] | 65 | SDAsciiWriter.o \
|
---|
[655] | 66 | SDLineFinder.o
|
---|
| 67 | PYOBJECTS := python_SDMemTable.o \
|
---|
[65] | 68 | python_SDReader.o \
|
---|
| 69 | python_SDWriter.o \
|
---|
| 70 | python_SDMath.o \
|
---|
[99] | 71 | python_SDFitter.o \
|
---|
[465] | 72 | python_SDFitTable.o \
|
---|
[297] | 73 | python_SDLineFinder.o \
|
---|
[65] | 74 | python_SD.o
|
---|
[31] | 75 |
|
---|
[655] | 76 | OBJECTS := $(CCOBJECTS) $(PYOBJECTS)
|
---|
[2] | 77 |
|
---|
[216] | 78 | HEADERS := SDDefs.h \
|
---|
[356] | 79 | SDAttr.h \
|
---|
[216] | 80 | SDContainer.h \
|
---|
[465] | 81 | SDFitTable.h \
|
---|
[65] | 82 | SDMemTable.h \
|
---|
[416] | 83 | SDPol.h \
|
---|
[65] | 84 | SDReader.h \
|
---|
| 85 | SDWriter.h \
|
---|
| 86 | SDMath.h \
|
---|
[99] | 87 | SDFitter.h \
|
---|
[65] | 88 | SDMemTableWrapper.h \
|
---|
| 89 | SDMathWrapper.h \
|
---|
| 90 | SDReaderWrapper.h \
|
---|
| 91 | SDWriterWrapper.h \
|
---|
[193] | 92 | SDFITSImageWriter.h \
|
---|
[201] | 93 | SDAsciiWriter.h \
|
---|
[297] | 94 | SDLineFinder.h \
|
---|
[65] | 95 | python_SD.h
|
---|
[2] | 96 |
|
---|
[655] | 97 | STATICCCLIB := libasap.a
|
---|
| 98 | MEMBERS := $(patsubst %,$(STATICCCLIB)(%),$(CCOBJECTS))
|
---|
[193] | 99 |
|
---|
[2] | 100 | .SUFFIXES: .c .o .cpp .cc .cxx .C
|
---|
| 101 |
|
---|
| 102 | .cpp.o:
|
---|
[65] | 103 | -@ echo
|
---|
[698] | 104 | $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
|
---|
[2] | 105 |
|
---|
| 106 | .cc.o:
|
---|
[65] | 107 | -@ echo
|
---|
[698] | 108 | $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
|
---|
[2] | 109 |
|
---|
[65] | 110 | .cxx.o:
|
---|
| 111 | -@ echo
|
---|
[698] | 112 | $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
|
---|
[2] | 113 |
|
---|
| 114 | .C.o:
|
---|
[65] | 115 | -@ echo
|
---|
[698] | 116 | $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
|
---|
[2] | 117 |
|
---|
| 118 |
|
---|
[65] | 119 | .PHONY : all clean objects realclean relink
|
---|
[2] | 120 |
|
---|
[65] | 121 | all : $(TARGET)
|
---|
| 122 |
|
---|
| 123 | relink : cleanso $(TARGET)
|
---|
| 124 |
|
---|
| 125 | objects : $(OBJECTS)
|
---|
| 126 |
|
---|
| 127 | $(TARGET) : $(OBJECTS)
|
---|
| 128 | -@ echo
|
---|
| 129 | $(LD) $(LDFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS)
|
---|
| 130 |
|
---|
| 131 | $(OBJECTS) : $(HEADERS)
|
---|
| 132 |
|
---|
[655] | 133 | staticlib: $(MEMBERS)
|
---|
| 134 |
|
---|
[65] | 135 | clean :
|
---|
[2] | 136 | -rm -f $(OBJECTS)
|
---|
| 137 |
|
---|
[65] | 138 | cleanso :
|
---|
[2] | 139 | -rm -f $(TARGET)
|
---|
[65] | 140 |
|
---|
| 141 | realclean : clean cleanso
|
---|