source: branches/casa-release-4_3/external/libpyrap/Makefile@ 3071

Last change on this file since 3071 was 1917, 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: build asap

Put in Release Notes: No

Module(s): Module Names change impacts.

Description: Describe your changes here...

Updates from Wes and Darrell.


File size: 3.7 KB
Line 
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)
11PYRAPROOT := $(EXTDIR)/pyrap-0.3.2/
12PYRAPDIR := $(EXTDIR)/pyrap-0.3.2/pyrap/Converters
13TESTDIR := $(PYRAPDIR)/test
14
15# the casa environment AIPSPATH has to be defined
16CASAROOT := $(word 1, $(CASAPATH))
17CASAARCH := $(word 2, $(CASAPATH))
18
19ifeq ($(shell uname), Darwin)
20 TARGET := libpyrap.dylib
21 TESTMOD := $(TESTDIR)/_tConvert.so
22else
23 TARGET := libpyrap.so
24 TESTMOD := $(TESTDIR)/_tConvert.so
25endif
26INSTDIR := $(CASAROOT)/$(CASAARCH)/lib
27
28# CASACORE
29COREINCD := $(shell $(shell make -s -f $(CASAROOT)/$(CASAARCH)/makedefs VARS=COREINCD eval_vars) && echo $$COREINCD)
30CORELIBD := $(CASAROOT)/$(CASAARCH)/lib
31CORELIB := $(shell $(shell make -s -f $(CASAROOT)/$(CASAARCH)/makedefs VARS=CORELIB eval_vars) && echo $$CORELIB)
32
33# boost
34BOOSTROOT := $(shell $(shell make -s -f $(CASAROOT)/$(CASAARCH)/makedefs VARS=BOOSTROOT eval_vars) && echo $$BOOSTROOT)
35BOOSTINCD := $(BOOSTROOT)/include
36BOOSTLIBD := $(BOOSTROOT)/lib
37BOOSTLIB := -L$(BOOSTLIBD) -lboost_python
38
39# python
40PYTHONROOT := $(shell $(shell make -s -f $(CASAROOT)/$(CASAARCH)/makedefs VARS=PYTHONROOT eval_vars) && echo $$PYTHONROOT)
41PYTHONINCD := $(shell $(shell make -s -f $(CASAROOT)/$(CASAARCH)/makedefs VARS=PYTHONINCD eval_vars) && echo $$PYTHONINCD)
42PYTHONLIBD := $(shell $(shell make -s -f $(CASAROOT)/$(CASAARCH)/makedefs VARS=PYTHONLIBD eval_vars) && echo $$PYTHONLIBD)
43PYTHONLIB := $(shell $(shell make -s -f $(CASAROOT)/$(CASAARCH)/makedefs VARS=PYTHONLIB eval_vars) && echo $$PYTHONLIB)
44
45# numpy (use numpy in CASA)
46#NUMPYROOT := $(PYTHONLIBD)/python2.5/site-packages/numpy
47#NUMPYINCD := $(NUMPYROOT)/core/include
48
49# the compiler
50ifndef CXX
51 CXX := g++
52endif
53
54# the linker
55LD := $(CXX)
56
57# compiler flags
58#CXXFLAGS := -fPIC -O3 -g
59#CXXFLAGS += -ansi -Wno-long-long -Wall
60CXXFLAGS := $(shell $(shell make -s -f $(CASAROOT)/$(CASAARCH)/makedefs VARS=CXXFLAGS eval_vars) && echo $$CXXFLAGS)
61CXXFLAGS += -fPIC -O3
62CXXOPTS := $(shell $(shell make -s -f $(CASAROOT)/$(CASAARCH)/makedefs VARS=COPTFLAGS eval_vars) && echo $$COPTFLAGS)
63CXXOPTS += -DAIPS_USENUMPY
64
65# links to external libraries
66LIBS := $(CORELIB) $(BOOSTLIB) $(PYTHONLIB)
67
68# include directories
69INCDIRS := -I$(COREINCD) -I$(BOOSTINCD) \
70 -I$(PYRAPROOT) $(addprefix -I, $(PYTHONINCD))
71
72# link option
73LDFLAGS := $(shell $(shell make -s -f $(CASAROOT)/$(CASAARCH)/makedefs VARS=LD_FLAGS eval_vars) && echo $$LD_FLAGS)
74LDFLAGS += -shared
75ifeq ($(shell uname), Darwin)
76 LDFLAGS += -headerpad_max_install_names -install_name $(CASAROOT)/$(CASAARCH)/lib/$(TARGET)
77endif
78
79OBJECTS := $(PYRAPDIR)/PycArray.o \
80 $(PYRAPDIR)/PycArrayNP.o \
81 $(PYRAPDIR)/PycBasicData.o \
82 $(PYRAPDIR)/PycExcp.o \
83 $(PYRAPDIR)/PycRecord.o \
84 $(PYRAPDIR)/PycValueHolder.o #\
85# $(PYRAPDIR)/PycArrayNA.o
86
87HEADERS := $(PYRAPDIR)/PycArrayComCC.h \
88 $(PYRAPDIR)/PycArrayComH.h \
89 $(PYRAPDIR)/PycArray.h \
90 $(PYRAPDIR)/PycArrayNP.h \
91 $(PYRAPDIR)/PycBasicData.h \
92 $(PYRAPDIR)/PycExcp.h \
93 $(PYRAPDIR)/PycRecord.h \
94 $(PYRAPDIR)/PycValueHolder.h #\
95# $(PYRAPDIR)/PycArrayNA.h
96
97TESTSRC := $(TESTDIR)/tConvert.cc
98TESTOBJ := $(TESTDIR)/tConvert.o
99
100all: $(TARGET)
101
102.cc.o:
103 $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
104
105$(TARGET): $(OBJECTS)
106 $(LD) $(LDFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS)
107
108$(OBJECTS): $(HEADERS)
109
110clean:
111 rm -f $(OBJECTS) $(TARGET)
112 rm -f $(TESTDIR)/$(TESTMOD) $(TESTDIR)/$(TESTOBJ)
113 rm -f $(INSTDIR)/$(TARGET)
114
115install:
116 cp -f $(TARGET) $(INSTDIR)
117
118test:
119 $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $(TESTOBJ) $(TESTSRC)
120 $(LD) $(LDFLAGS) -o $(TESTMOD) $(TESTOBJ) $(LIBS) -L$(EXTDIR) -lpyrap
Note: See TracBrowser for help on using the repository browser.