source: trunk/external/libpyrap/Makefile@ 3026

Last change on this file since 3026 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
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
[1895]13TESTDIR := $(PYRAPDIR)/test
[1891]14
15# the casa environment AIPSPATH has to be defined
16CASAROOT := $(word 1, $(CASAPATH))
17CASAARCH := $(word 2, $(CASAPATH))
18
[1905]19ifeq ($(shell uname), Darwin)
20 TARGET := libpyrap.dylib
[1915]21 TESTMOD := $(TESTDIR)/_tConvert.so
[1905]22else
23 TARGET := libpyrap.so
24 TESTMOD := $(TESTDIR)/_tConvert.so
25endif
[1892]26INSTDIR := $(CASAROOT)/$(CASAARCH)/lib
[1891]27
28# CASACORE
[1917]29COREINCD := $(shell $(shell make -s -f $(CASAROOT)/$(CASAARCH)/makedefs VARS=COREINCD eval_vars) && echo $$COREINCD)
[1891]30CORELIBD := $(CASAROOT)/$(CASAARCH)/lib
[1917]31CORELIB := $(shell $(shell make -s -f $(CASAROOT)/$(CASAARCH)/makedefs VARS=CORELIB eval_vars) && echo $$CORELIB)
[1891]32
[1892]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
[1891]38
[1892]39# python
40PYTHONROOT := $(shell $(shell make -s -f $(CASAROOT)/$(CASAARCH)/makedefs VARS=PYTHONROOT eval_vars) && echo $$PYTHONROOT)
[1915]41PYTHONINCD := $(shell $(shell make -s -f $(CASAROOT)/$(CASAARCH)/makedefs VARS=PYTHONINCD eval_vars) && echo $$PYTHONINCD)
[1905]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)
[1891]44
[1899]45# numpy (use numpy in CASA)
[1915]46#NUMPYROOT := $(PYTHONLIBD)/python2.5/site-packages/numpy
47#NUMPYINCD := $(NUMPYROOT)/core/include
[1899]48
[1892]49# the compiler
50ifndef CXX
51 CXX := g++
52endif
[1891]53
[1892]54# the linker
55LD := $(CXX)
56
57# compiler flags
[1905]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
[1892]64
65# links to external libraries
[1905]66LIBS := $(CORELIB) $(BOOSTLIB) $(PYTHONLIB)
[1892]67
68# include directories
[1915]69INCDIRS := -I$(COREINCD) -I$(BOOSTINCD) \
70 -I$(PYRAPROOT) $(addprefix -I, $(PYTHONINCD))
[1892]71
72# link option
[1915]73LDFLAGS := $(shell $(shell make -s -f $(CASAROOT)/$(CASAARCH)/makedefs VARS=LD_FLAGS eval_vars) && echo $$LD_FLAGS)
74LDFLAGS += -shared
[1917]75ifeq ($(shell uname), Darwin)
76 LDFLAGS += -headerpad_max_install_names -install_name $(CASAROOT)/$(CASAARCH)/lib/$(TARGET)
77endif
[1892]78
[1891]79OBJECTS := $(PYRAPDIR)/PycArray.o \
80 $(PYRAPDIR)/PycArrayNP.o \
81 $(PYRAPDIR)/PycBasicData.o \
[1892]82 $(PYRAPDIR)/PycExcp.o \
[1891]83 $(PYRAPDIR)/PycRecord.o \
84 $(PYRAPDIR)/PycValueHolder.o #\
85# $(PYRAPDIR)/PycArrayNA.o
86
[1892]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
[1895]97TESTSRC := $(TESTDIR)/tConvert.cc
98TESTOBJ := $(TESTDIR)/tConvert.o
99
[1892]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:
[1899]111 rm -f $(OBJECTS) $(TARGET)
112 rm -f $(TESTDIR)/$(TESTMOD) $(TESTDIR)/$(TESTOBJ)
113 rm -f $(INSTDIR)/$(TARGET)
[1892]114
115install:
[1895]116 cp -f $(TARGET) $(INSTDIR)
117
118test:
119 $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $(TESTOBJ) $(TESTSRC)
[1905]120 $(LD) $(LDFLAGS) -o $(TESTMOD) $(TESTOBJ) $(LIBS) -L$(EXTDIR) -lpyrap
Note: See TracBrowser for help on using the repository browser.