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