source: trunk/src/Makefile@ 866

Last change on this file since 866 was 860, checked in by mar637, 19 years ago

reworked history table
added STHistory class

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.9 KB
Line 
1TARGET := /tmp/_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) $(BOOSTINC) $(PYTHONINC) $(CFITSIOINC)
78LIBS := $(PYTHONLIB) $(BOOSTLIB) $(CASAPPLIB)
79
80CCOBJECTS := MathUtils.o \
81 MathUtils2.o \
82 SDLog.o \
83 SDAttr.o \
84 SDContainer.o \
85 Scantable.o \
86 STFiller.o \
87 STTemplates.o \
88 STMath.o \
89 STSubTable.o \
90 STMolecules.o \
91 STTcal.o \
92 STFocus.o \
93 STWeather.o \
94 STFrequencies.o \
95 STHistory.o \
96 STWriter.o \
97 RowAccumulator.o \
98 STSelector.o
99PYOBJECTS :=
100
101OBJECTS := $(CCOBJECTS) $(PYOBJECTS)
102
103HEADERS := MathUtils.h \
104 SDLog.h \
105 SDAttr.h \
106 SDContainer.h \
107 Scantable.h \
108 STFiller.h \
109 STMath.h \
110 RowAccumulator.h \
111 STSubTable.h \
112 STMolecules.h \
113 STTcal.h \
114 STFocus.h \
115 STWeather.h \
116 STHistory.h \
117 STFrequencies.h \
118 STDefs.h \
119 STWriter.h \
120 STSelector.h
121
122STATICCCLIB := libasap.a
123MEMBERS := $(patsubst %,$(STATICCCLIB)(%),$(CCOBJECTS))
124
125.SUFFIXES: .c .o .cpp .cc .cxx .C
126
127.cpp.o:
128 -@ echo
129 $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
130
131.cc.o:
132 -@ echo
133 $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
134
135.cxx.o:
136 -@ echo
137 $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
138
139.C.o:
140 -@ echo
141 $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
142
143
144.PHONY : all clean objects realclean relink
145
146all : $(TARGET)
147
148relink : cleanso $(TARGET)
149
150objects : $(OBJECTS)
151
152$(TARGET) : $(OBJECTS)
153 -@ echo
154 $(LD) $(LDFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS)
155
156$(OBJECTS) : $(HEADERS)
157
158staticlib: $(MEMBERS)
159
160clean :
161 -rm -f $(OBJECTS)
162
163cleanso :
164 -rm -f $(TARGET)
165
166realclean : clean cleanso
167
168test: objects tasap2.o
169 -@ echo
170 $(LD) -g -o /tmp/tasap2 $(OBJECTS) $(LIBS) tasap2.o
Note: See TracBrowser for help on using the repository browser.