source: branches/Release12/src/Makefile@ 913

Last change on this file since 913 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
RevLine 
[684]1TARGET := /tmp/_asap.so
[789]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
[635]12ifndef CXX
13 CXX := g++
[260]14endif
[789]15
16# compiler flags
[635]17CXXFLAGS := -O3 -fPIC
[789]18CXXFLAGS += -ansi -pedantic -Wno-long-long
[684]19CXXOPTS := -DAIPS_NO_TEMPLATE_SRC
[2]20
[789]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
[655]31# libcfitsio with lfs support
[789]32CFITSIOINC := -I$(CFITSIOROOT)/include
33CFITSIOLIB := $(CFITSIOROOT)/lib/libcfitsio_lfs.a
[684]34#CFITSIOLIB := -L$(CFITSIOROOT) -lcfitsio
[71]35
[789]36#rpfits
37RPFITSROOT := /usr/local
38RPFITSLIB := $(RPFITSROOT)/lib/librpfits.a
[684]39
[655]40# This assumes all casa libs are static only (*.a)
41# if not than there might by symbol resolution errors.
[82]42CASAPPLIB := $(CASALIB)/version.o \
[789]43 -L$(CASALIB) \
[193]44 -latnf -limages -lms -lcomponents -lcoordinates \
[82]45 -llattices -lfits -lmeasures -lmeasures_f \
[684]46 -ltables -lscimath -lscimath_f -lcasa \
47 $(CASALIB)/libwcs.a \
[789]48 $(RPFITSLIB) $(CFITSIOLIB) -lg2c -lstdc++
[2]49
[789]50# darwin specific CASA flags
51ifeq "$(CASAARCH)" "darwin"
52 CASAPPLIB += -framework vecLib
53else
54 CASAPPLIB += -llapack -lblas
55endif
56
57# the linker
[635]58LD := $(CXX)
[789]59
[655]60LDFLAGS := -shared -Wl$(TARGET) -s
[789]61ifeq "$(CASAARCH)" "darwin"
62 LDFLAGS := -dynamiclib -single_module
63endif
[2]64
[789]65# python only 2.3 has been tested
[655]66PYVERSION := 2.3
67PYTHONROOT := /usr
68PYTHONINC := -I$(PYTHONROOT)/include/python$(PYVERSION)
69PYTHONLIB := -L$(PYTHONROOT)/lib -lpython$(PYVERSION)
70
[789]71# has to be build with same g++ version as casa
[635]72BOOSTROOT := /usr
[684]73BOOSTLIB := -L$(BOOSTROOT)/lib -lboost_python
[635]74BOOSTINC := -I$(BOOSTROOT)/include/boost
[2]75
[260]76
[789]77# DO NOT MODIFY AFTER THIS
[82]78INCDIRS := -I. $(CASAINC) $(BOOSTINC) $(PYTHONINC) $(CFITSIOINC)
[655]79LIBS := $(PYTHONLIB) $(BOOSTLIB) $(CASAPPLIB)
[2]80
[655]81CCOBJECTS := MathUtils.o \
[137]82 MathUtils2.o \
[717]83 SDLog.o \
[356]84 SDAttr.o \
[65]85 SDContainer.o \
[465]86 SDFitTable.o \
[416]87 SDPol.o \
[460]88 SDPol2.o \
[65]89 SDMemTable.o \
90 SDReader.o \
91 SDWriter.o \
92 SDMath.o \
[99]93 SDFitter.o \
[65]94 SDTemplates.o \
[168]95 SDMathWrapper.o \
[193]96 SDFITSImageWriter.o \
[201]97 SDAsciiWriter.o \
[655]98 SDLineFinder.o
99PYOBJECTS := python_SDMemTable.o \
[65]100 python_SDReader.o \
101 python_SDWriter.o \
102 python_SDMath.o \
[99]103 python_SDFitter.o \
[465]104 python_SDFitTable.o \
[297]105 python_SDLineFinder.o \
[717]106 python_SDLog.o \
[65]107 python_SD.o
[31]108
[655]109OBJECTS := $(CCOBJECTS) $(PYOBJECTS)
[2]110
[216]111HEADERS := SDDefs.h \
[356]112 SDAttr.h \
[216]113 SDContainer.h \
[465]114 SDFitTable.h \
[65]115 SDMemTable.h \
[416]116 SDPol.h \
[65]117 SDReader.h \
118 SDWriter.h \
119 SDMath.h \
[99]120 SDFitter.h \
[65]121 SDMemTableWrapper.h \
122 SDMathWrapper.h \
123 SDReaderWrapper.h \
124 SDWriterWrapper.h \
[193]125 SDFITSImageWriter.h \
[201]126 SDAsciiWriter.h \
[297]127 SDLineFinder.h \
[717]128 SDLog.h \
[65]129 python_SD.h
[2]130
[655]131STATICCCLIB := libasap.a
132MEMBERS := $(patsubst %,$(STATICCCLIB)(%),$(CCOBJECTS))
[193]133
[2]134.SUFFIXES: .c .o .cpp .cc .cxx .C
135
136.cpp.o:
[65]137 -@ echo
[684]138 $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
[2]139
140.cc.o:
[65]141 -@ echo
[684]142 $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
[2]143
[65]144.cxx.o:
145 -@ echo
[684]146 $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
[2]147
148.C.o:
[65]149 -@ echo
[684]150 $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
[2]151
152
[65]153.PHONY : all clean objects realclean relink
[2]154
[65]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
[655]167staticlib: $(MEMBERS)
168
[65]169clean :
[2]170 -rm -f $(OBJECTS)
171
[65]172cleanso :
[2]173 -rm -f $(TARGET)
[65]174
175realclean : clean cleanso
Note: See TracBrowser for help on using the repository browser.