source: trunk/src/Makefile@ 981

Last change on this file since 981 was 962, checked in by mar637, 19 years ago

added Fit objects

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.5 KB
RevLine 
[908]1TARGET := /tmp/asap/_asap.so
[794]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
[635]11ifndef CXX
12 CXX := g++
[260]13endif
[794]14
15# compiler flags
[813]16CXXFLAGS := -fPIC -g
[794]17CXXFLAGS += -ansi -pedantic -Wno-long-long
[684]18CXXOPTS := -DAIPS_NO_TEMPLATE_SRC
[2]19
[794]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
[655]30# libcfitsio with lfs support
[794]31CFITSIOINC := -I$(CFITSIOROOT)/include
32CFITSIOLIB := $(CFITSIOROOT)/lib/libcfitsio_lfs.a
[684]33#CFITSIOLIB := -L$(CFITSIOROOT) -lcfitsio
[71]34
[794]35#rpfits
36RPFITSROOT := /usr/local
37RPFITSLIB := $(RPFITSROOT)/lib/librpfits.a
[684]38
[655]39# This assumes all casa libs are static only (*.a)
40# if not than there might by symbol resolution errors.
[82]41CASAPPLIB := $(CASALIB)/version.o \
[794]42 -L$(CASALIB) \
[818]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++
[2]48
[794]49# darwin specific CASA flags
50ifeq "$(CASAARCH)" "darwin"
51 CASAPPLIB += -framework vecLib
52else
53 CASAPPLIB += -llapack -lblas
54endif
55
56# the linker
[635]57LD := $(CXX)
[794]58
[655]59LDFLAGS := -shared -Wl$(TARGET) -s
[794]60ifeq "$(CASAARCH)" "darwin"
61 LDFLAGS := -dynamiclib -single_module
62endif
[2]63
[794]64# python only 2.3 has been tested
[655]65PYVERSION := 2.3
[908]66PYTHONROOT := /usr
[655]67PYTHONINC := -I$(PYTHONROOT)/include/python$(PYVERSION)
[908]68PYTHONLIB := -L$(PYTHONROOT)/lib -lpython$(PYVERSION)
[655]69
[794]70# has to be build with same g++ version as casa
[635]71BOOSTROOT := /usr
[684]72BOOSTLIB := -L$(BOOSTROOT)/lib -lboost_python
[635]73BOOSTINC := -I$(BOOSTROOT)/include/boost
[2]74
[260]75
[794]76# DO NOT MODIFY AFTER THIS
[897]77INCDIRS := -I. $(CASAINC) $(CFITSIOINC) $(BOOSTINC) $(PYTHONINC)
[655]78LIBS := $(PYTHONLIB) $(BOOSTLIB) $(CASAPPLIB)
[2]79
[655]80CCOBJECTS := MathUtils.o \
[137]81 MathUtils2.o \
[897]82 RowAccumulator.o \
[894]83 Logger.o \
[879]84 STAttr.o \
[901]85 STHeader.o \
[818]86 STFiller.o \
87 STMath.o \
88 STSubTable.o \
89 STMolecules.o \
90 STTcal.o \
91 STFocus.o \
92 STWeather.o \
93 STFrequencies.o \
[860]94 STHistory.o \
[828]95 STWriter.o \
[879]96 STSelector.o \
[894]97 STLineFinder.o \
[897]98 STFitter.o \
[962]99 STFitEntry.o \
100 STFit.o \
[906]101 STPol.o \
[897]102 STPolLinear.o \
[916]103 STPolStokes.o \
[897]104 Scantable.o \
105 Templates.o
[879]106PYOBJECTS := python_Scantable.o \
107 python_STFiller.o \
108 python_STSelector.o \
109 python_STMath.o \
[894]110 python_Fitter.o \
111 python_Logger.o \
112 python_STLineFinder.o \
[962]113 python_STFitEntry.o \
[879]114 python_asap.o
[31]115
[655]116OBJECTS := $(CCOBJECTS) $(PYOBJECTS)
[2]117
[813]118HEADERS := MathUtils.h \
[894]119 Logger.h \
[879]120 STAttr.h \
[901]121 STHeader.h \
[813]122 Scantable.h \
[818]123 STFiller.h \
124 STMath.h \
125 RowAccumulator.h \
126 STSubTable.h \
127 STMolecules.h \
128 STTcal.h \
129 STFocus.h \
130 STWeather.h \
[860]131 STHistory.h \
[818]132 STFrequencies.h \
[828]133 STDefs.h \
134 STWriter.h \
[882]135 STSelector.h \
[894]136 STFitter.h \
[962]137 STFit.h \
138 STFitEntry.h \
[897]139 STLineFinder.h \
140 Factory.h \
141 FactoryBase.h \
142 STPol.h \
[916]143 STPolStokes.h \
[897]144 STPolLinear.h
[2]145
[655]146STATICCCLIB := libasap.a
147MEMBERS := $(patsubst %,$(STATICCCLIB)(%),$(CCOBJECTS))
[193]148
[2]149.SUFFIXES: .c .o .cpp .cc .cxx .C
150
151.cpp.o:
[65]152 -@ echo
[818]153 $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
[2]154
155.cc.o:
[65]156 -@ echo
[818]157 $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
[2]158
[65]159.cxx.o:
160 -@ echo
[818]161 $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
[2]162
163.C.o:
[65]164 -@ echo
[818]165 $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
[2]166
167
[65]168.PHONY : all clean objects realclean relink
[2]169
[65]170all : $(TARGET)
171
172relink : cleanso $(TARGET)
173
174objects : $(OBJECTS)
175
176$(TARGET) : $(OBJECTS)
177 -@ echo
[818]178 $(LD) $(LDFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS)
[65]179
180$(OBJECTS) : $(HEADERS)
181
[655]182staticlib: $(MEMBERS)
183
[65]184clean :
[2]185 -rm -f $(OBJECTS)
186
[65]187cleanso :
[2]188 -rm -f $(TARGET)
[65]189
190realclean : clean cleanso
[813]191
[828]192test: objects tasap2.o
[813]193 -@ echo
[828]194 $(LD) -g -o /tmp/tasap2 $(OBJECTS) $(LIBS) tasap2.o
Note: See TracBrowser for help on using the repository browser.