source: branches/Release12/src/Makefile@ 3109

Last change on this file since 3109 was 789, checked in by mar637, 19 years ago

made makefile darwin compatible; removed uneccessary templates - who knows why

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.0 KB
Line 
1TARGET := /tmp/_asap.so
2
3
4# the casa environment AIPSPATH has to be defined
5CASAROOT := $(word 1, $(AIPSPATH))
6CASAARCH := $(word 2, $(AIPSPATH))
7CASAINC := -I$(CASAROOT)/code/include -I$(CASAROOT)/code/casa
8CASALIB := $(CASAROOT)/$(CASAARCH)/lib
9
10
11# the compiler
12ifndef CXX
13 CXX := g++
14endif
15
16# compiler flags
17CXXFLAGS := -O3 -fPIC
18CXXFLAGS += -ansi -pedantic -Wno-long-long
19CXXOPTS := -DAIPS_NO_TEMPLATE_SRC
20
21# darwin specific flags
22ifeq "$(CASAARCH)" "darwin"
23 CXXFLAGS := -O2 -DAIPS_DARWIN
24 CXXFLAGS += -ansi -pedantic -Wno-long-long -Wno-long-double
25endif
26
27
28# cfitsio
29CFITSIOROOT := /usr/local
30# If aips++ is build with LFS you need to have
31# libcfitsio with lfs support
32CFITSIOINC := -I$(CFITSIOROOT)/include
33CFITSIOLIB := $(CFITSIOROOT)/lib/libcfitsio_lfs.a
34#CFITSIOLIB := -L$(CFITSIOROOT) -lcfitsio
35
36#rpfits
37RPFITSROOT := /usr/local
38RPFITSLIB := $(RPFITSROOT)/lib/librpfits.a
39
40# This assumes all casa libs are static only (*.a)
41# if not than there might by symbol resolution errors.
42CASAPPLIB := $(CASALIB)/version.o \
43 -L$(CASALIB) \
44 -latnf -limages -lms -lcomponents -lcoordinates \
45 -llattices -lfits -lmeasures -lmeasures_f \
46 -ltables -lscimath -lscimath_f -lcasa \
47 $(CASALIB)/libwcs.a \
48 $(RPFITSLIB) $(CFITSIOLIB) -lg2c -lstdc++
49
50# darwin specific CASA flags
51ifeq "$(CASAARCH)" "darwin"
52 CASAPPLIB += -framework vecLib
53else
54 CASAPPLIB += -llapack -lblas
55endif
56
57# the linker
58LD := $(CXX)
59
60LDFLAGS := -shared -Wl$(TARGET) -s
61ifeq "$(CASAARCH)" "darwin"
62 LDFLAGS := -dynamiclib -single_module
63endif
64
65# python only 2.3 has been tested
66PYVERSION := 2.3
67PYTHONROOT := /usr
68PYTHONINC := -I$(PYTHONROOT)/include/python$(PYVERSION)
69PYTHONLIB := -L$(PYTHONROOT)/lib -lpython$(PYVERSION)
70
71# has to be build with same g++ version as casa
72BOOSTROOT := /usr
73BOOSTLIB := -L$(BOOSTROOT)/lib -lboost_python
74BOOSTINC := -I$(BOOSTROOT)/include/boost
75
76
77# DO NOT MODIFY AFTER THIS
78INCDIRS := -I. $(CASAINC) $(BOOSTINC) $(PYTHONINC) $(CFITSIOINC)
79LIBS := $(PYTHONLIB) $(BOOSTLIB) $(CASAPPLIB)
80
81CCOBJECTS := MathUtils.o \
82 MathUtils2.o \
83 SDLog.o \
84 SDAttr.o \
85 SDContainer.o \
86 SDFitTable.o \
87 SDPol.o \
88 SDPol2.o \
89 SDMemTable.o \
90 SDReader.o \
91 SDWriter.o \
92 SDMath.o \
93 SDFitter.o \
94 SDTemplates.o \
95 SDMathWrapper.o \
96 SDFITSImageWriter.o \
97 SDAsciiWriter.o \
98 SDLineFinder.o
99PYOBJECTS := python_SDMemTable.o \
100 python_SDReader.o \
101 python_SDWriter.o \
102 python_SDMath.o \
103 python_SDFitter.o \
104 python_SDFitTable.o \
105 python_SDLineFinder.o \
106 python_SDLog.o \
107 python_SD.o
108
109OBJECTS := $(CCOBJECTS) $(PYOBJECTS)
110
111HEADERS := SDDefs.h \
112 SDAttr.h \
113 SDContainer.h \
114 SDFitTable.h \
115 SDMemTable.h \
116 SDPol.h \
117 SDReader.h \
118 SDWriter.h \
119 SDMath.h \
120 SDFitter.h \
121 SDMemTableWrapper.h \
122 SDMathWrapper.h \
123 SDReaderWrapper.h \
124 SDWriterWrapper.h \
125 SDFITSImageWriter.h \
126 SDAsciiWriter.h \
127 SDLineFinder.h \
128 SDLog.h \
129 python_SD.h
130
131STATICCCLIB := libasap.a
132MEMBERS := $(patsubst %,$(STATICCCLIB)(%),$(CCOBJECTS))
133
134.SUFFIXES: .c .o .cpp .cc .cxx .C
135
136.cpp.o:
137 -@ echo
138 $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
139
140.cc.o:
141 -@ echo
142 $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
143
144.cxx.o:
145 -@ echo
146 $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
147
148.C.o:
149 -@ echo
150 $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
151
152
153.PHONY : all clean objects realclean relink
154
155all : $(TARGET)
156
157relink : cleanso $(TARGET)
158
159objects : $(OBJECTS)
160
161$(TARGET) : $(OBJECTS)
162 -@ echo
163 $(LD) $(LDFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS)
164
165$(OBJECTS) : $(HEADERS)
166
167staticlib: $(MEMBERS)
168
169clean :
170 -rm -f $(OBJECTS)
171
172cleanso :
173 -rm -f $(TARGET)
174
175realclean : clean cleanso
Note: See TracBrowser for help on using the repository browser.