[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 |
|
---|
[635] | 9 | CFITSIOROOT := /usr
|
---|
| 10 | # If aips++ is build with LFS
|
---|
| 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))
|
---|
| 16 | CASAINC := -I$(CASAROOT)/code/include
|
---|
| 17 | CASALIB := $(CASAROOT)/linux_gnu/lib
|
---|
| 18 | CASAPPLIB := $(CASALIB)/version.o \
|
---|
| 19 | -L$(CASALIB) \
|
---|
[193] | 20 | -latnf -limages -lms -lcomponents -lcoordinates \
|
---|
[82] | 21 | -llattices -lfits -lmeasures -lmeasures_f \
|
---|
| 22 | -ltables -lscimath -lscimath_f -lcasa \
|
---|
[635] | 23 | $(CASALIB)/libwcs.a \
|
---|
[71] | 24 | -lrpfits $(CFITSIOLIB) -llapack -lblas -lg2c
|
---|
[2] | 25 |
|
---|
[635] | 26 | LD := $(CXX)
|
---|
[65] | 27 | LDFLAGS := -shared -Wl,--soname=$(TARGET)
|
---|
| 28 | LDFLAGS += -s
|
---|
[2] | 29 |
|
---|
[635] | 30 | BOOSTROOT := /usr
|
---|
| 31 | BOOSTLIB := -L$(BOOSTROOT)/lib -lboost_python2.3
|
---|
| 32 | BOOSTINC := -I$(BOOSTROOT)/include/boost
|
---|
[2] | 33 |
|
---|
[635] | 34 | PYTHONROOT := /usr
|
---|
| 35 | PYTHONINC := -I$(PYTHONROOT)/include/python2.3
|
---|
| 36 | PYTHONLIB := -L$(PYTHONROOT)/lib -lpython2.3
|
---|
[260] | 37 |
|
---|
[82] | 38 | INCDIRS := -I. $(CASAINC) $(BOOSTINC) $(PYTHONINC) $(CFITSIOINC)
|
---|
| 39 | LIBS := $(BOOSTLIB) $(PYTHONLIB) $(CASAPPLIB)
|
---|
[2] | 40 |
|
---|
[65] | 41 | OBJECTS := MathUtils.o \
|
---|
[137] | 42 | MathUtils2.o \
|
---|
[356] | 43 | SDAttr.o \
|
---|
[65] | 44 | SDContainer.o \
|
---|
[465] | 45 | SDFitTable.o \
|
---|
[416] | 46 | SDPol.o \
|
---|
[460] | 47 | SDPol2.o \
|
---|
[65] | 48 | SDMemTable.o \
|
---|
| 49 | SDReader.o \
|
---|
| 50 | SDWriter.o \
|
---|
| 51 | SDMath.o \
|
---|
[99] | 52 | SDFitter.o \
|
---|
[65] | 53 | SDTemplates.o \
|
---|
[168] | 54 | SDMathWrapper.o \
|
---|
[193] | 55 | SDFITSImageWriter.o \
|
---|
[201] | 56 | SDAsciiWriter.o \
|
---|
[297] | 57 | SDLineFinder.o \
|
---|
[65] | 58 | python_SDMemTable.o \
|
---|
| 59 | python_SDReader.o \
|
---|
| 60 | python_SDWriter.o \
|
---|
| 61 | python_SDMath.o \
|
---|
[99] | 62 | python_SDFitter.o \
|
---|
[465] | 63 | python_SDFitTable.o \
|
---|
[297] | 64 | python_SDLineFinder.o \
|
---|
[65] | 65 | python_SD.o
|
---|
[31] | 66 |
|
---|
[2] | 67 |
|
---|
[216] | 68 | HEADERS := SDDefs.h \
|
---|
[356] | 69 | SDAttr.h \
|
---|
[216] | 70 | SDContainer.h \
|
---|
[465] | 71 | SDFitTable.h \
|
---|
[65] | 72 | SDMemTable.h \
|
---|
[416] | 73 | SDPol.h \
|
---|
[65] | 74 | SDReader.h \
|
---|
| 75 | SDWriter.h \
|
---|
| 76 | SDMath.h \
|
---|
[99] | 77 | SDFitter.h \
|
---|
[65] | 78 | SDMemTableWrapper.h \
|
---|
| 79 | SDMathWrapper.h \
|
---|
| 80 | SDReaderWrapper.h \
|
---|
| 81 | SDWriterWrapper.h \
|
---|
[193] | 82 | SDFITSImageWriter.h \
|
---|
[201] | 83 | SDAsciiWriter.h \
|
---|
[297] | 84 | SDLineFinder.h \
|
---|
[65] | 85 | python_SD.h
|
---|
[2] | 86 |
|
---|
[193] | 87 |
|
---|
[2] | 88 | .SUFFIXES: .c .o .cpp .cc .cxx .C
|
---|
| 89 |
|
---|
| 90 | .cpp.o:
|
---|
[65] | 91 | -@ echo
|
---|
| 92 | $(CXX) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
|
---|
[2] | 93 |
|
---|
| 94 | .cc.o:
|
---|
[65] | 95 | -@ echo
|
---|
| 96 | $(CXX) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
|
---|
[2] | 97 |
|
---|
[65] | 98 | .cxx.o:
|
---|
| 99 | -@ echo
|
---|
| 100 | $(CXX) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
|
---|
[2] | 101 |
|
---|
| 102 | .C.o:
|
---|
[65] | 103 | -@ echo
|
---|
| 104 | $(CXX) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
|
---|
[2] | 105 |
|
---|
| 106 |
|
---|
[65] | 107 | .PHONY : all clean objects realclean relink
|
---|
[2] | 108 |
|
---|
[65] | 109 | all : $(TARGET)
|
---|
| 110 |
|
---|
| 111 | relink : cleanso $(TARGET)
|
---|
| 112 |
|
---|
| 113 | objects : $(OBJECTS)
|
---|
| 114 |
|
---|
| 115 | $(TARGET) : $(OBJECTS)
|
---|
| 116 | -@ echo
|
---|
| 117 | $(LD) $(LDFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS)
|
---|
| 118 |
|
---|
| 119 | $(OBJECTS) : $(HEADERS)
|
---|
| 120 |
|
---|
| 121 | clean :
|
---|
[2] | 122 | -rm -f $(OBJECTS)
|
---|
| 123 |
|
---|
[65] | 124 | cleanso :
|
---|
[2] | 125 | -rm -f $(TARGET)
|
---|
[65] | 126 |
|
---|
| 127 | realclean : clean cleanso
|
---|