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