source: trunk/src/Makefile@ 911

Last change on this file since 911 was 908, checked in by vor010, 19 years ago

rolled back Makefile to rev. 906/ changes were
specific to Narrabri

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