source: trunk/external/libpyrap/Makefile@ 1892

Last change on this file since 1892 was 1892, checked in by Takeshi Nakazato, 14 years ago

New Development: No

JIRA Issue: No

Ready for Test: Yes

Interface Changes: No

What Interface Changed: Please list interface changes

Test Programs: List test programs

Put in Release Notes: Yes/No

Module(s): Module Names change impacts.

Description: Describe your changes here...

Makefile for pyrap updated.
It creates libpyrap.so, but not tested this library.


File size: 2.6 KB
RevLine 
[1891]1#####
2# Makefile for libpyrap
3#
4# ASSUMPTION:
5# CASA+CASACORE build environment
6# numpy is installed (installing CASA is fine since it contains numpy)
7# boost is installed
8#
9#####
10EXTDIR := $(shell pwd)
[1892]11PYRAPROOT := $(EXTDIR)/pyrap-0.3.2/
[1891]12PYRAPDIR := $(EXTDIR)/pyrap-0.3.2/pyrap/Converters
13
14# the casa environment AIPSPATH has to be defined
15CASAROOT := $(word 1, $(CASAPATH))
16CASAARCH := $(word 2, $(CASAPATH))
17ifeq "$(CASAARCH)" "darwin"
[1892]18 CASADIST := /opt/casa
19else
[1891]20 CASADIST := /usr/lib/casapy
21endif
22
[1892]23TARGET := libpyrap.so
24INSTDIR := $(CASAROOT)/$(CASAARCH)/lib
[1891]25
26# CASACORE
[1892]27#COREINCD := $(shell $(shell make -s -f $(CASAROOT)/$(CASAARCH)/makedefs VARS=COREINCD eval_vars) && echo $$COREINCD)
[1891]28COREINCD := $(CASAROOT)/$(CASAARCH)/include/casacore
29CORELIBD := $(CASAROOT)/$(CASAARCH)/lib
[1892]30CORELIB := -L$(CORELIBD) -lcasa_casa
[1891]31
[1892]32# boost
33BOOSTROOT := $(shell $(shell make -s -f $(CASAROOT)/$(CASAARCH)/makedefs VARS=BOOSTROOT eval_vars) && echo $$BOOSTROOT)
34BOOSTINCD := $(BOOSTROOT)/include
35BOOSTLIBD := $(BOOSTROOT)/lib
36BOOSTLIB := -L$(BOOSTLIBD) -lboost_python
[1891]37
[1892]38# numpy (use numpy in CASA)
[1891]39NUMPYROOT := $(CASADIST)/lib/python2.5/site-packages/numpy
40NUMPYINCD := $(NUMPYROOT)/core/include
41NUMPYLIBD := $(NUMPYROOT)/core/
[1892]42NUMPYLIB := #-L$(NUMPYLIBD) -lmultiarray
[1891]43
[1892]44# python
45PYTHONROOT := $(shell $(shell make -s -f $(CASAROOT)/$(CASAARCH)/makedefs VARS=PYTHONROOT eval_vars) && echo $$PYTHONROOT)
46PYTHONINCD := $(PYTHONROOT)/include/python2.5
[1891]47
[1892]48# the compiler
49ifndef CXX
50 CXX := g++
51endif
[1891]52
[1892]53# the linker
54LD := $(CXX)
55
56# compiler flags
57CXXFLAGS := -fPIC -O3 -g
58CXXFLAGS += -ansi -Wno-long-long -Wall
59CXXOPTS := -DAIPS_64B -DAIPS_USENUMPY
60
61# links to external libraries
62LIBS := $(CORELIB) $(BOOSTLIB) $(NUMPYLIB)
63
64# include directories
65INCDIRS := -I$(COREINCD) -I$(BOOSTINCD) -I$(NUMPYINCD) \
66 -I$(PYRAPROOT) -I$(PYTHONINCD)
67
68# link option
69LDFLAGS := -shared
70
[1891]71OBJECTS := $(PYRAPDIR)/PycArray.o \
72 $(PYRAPDIR)/PycArrayNP.o \
73 $(PYRAPDIR)/PycBasicData.o \
[1892]74 $(PYRAPDIR)/PycExcp.o \
[1891]75 $(PYRAPDIR)/PycRecord.o \
76 $(PYRAPDIR)/PycValueHolder.o #\
77# $(PYRAPDIR)/PycArrayNA.o
78
[1892]79HEADERS := $(PYRAPDIR)/PycArrayComCC.h \
80 $(PYRAPDIR)/PycArrayComH.h \
81 $(PYRAPDIR)/PycArray.h \
82 $(PYRAPDIR)/PycArrayNP.h \
83 $(PYRAPDIR)/PycBasicData.h \
84 $(PYRAPDIR)/PycExcp.h \
85 $(PYRAPDIR)/PycRecord.h \
86 $(PYRAPDIR)/PycValueHolder.h #\
87# $(PYRAPDIR)/PycArrayNA.h
88
89all: $(TARGET)
90
91.cc.o:
92 $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
93
94$(TARGET): $(OBJECTS)
95 $(LD) $(LDFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS)
96
97$(OBJECTS): $(HEADERS)
98
99clean:
100 @rm -rf $(OBJECTS) $(TARGET)
101
102install:
103 @cp -f $(TARGET) $(INSTDIR)
Note: See TracBrowser for help on using the repository browser.