source: trunk/external-alma/Makefile@ 1955

Last change on this file since 1955 was 1951, 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...

Updated Makefile such that libatnf.so and _asap.so depend on
casacore libraries so that those libraries are rebuilt if
casacore is updated.


File size: 5.4 KB
RevLine 
[1877]1### Notice:
2### This Makefile assumes CASA+CASACore enviroment.
3### For who wants to build ASAP with older CASA without CASACore
4### environment, replace $(CASAPATH) with $(AIPSPATH).
5EXTDIR := $(shell pwd)
6ATNFDIR := $(EXTDIR)/atnf
7
[1898]8# the casa environment CASAPATH has to be defined
[1877]9CASAROOT := $(word 1, $(CASAPATH))
10CASAARCH := $(word 2, $(CASAPATH))
11
[1894]12CXXFLAGS := $(shell $(shell make -s -f $(CASAROOT)/$(CASAARCH)/makedefs VARS=CXXFLAGS eval_vars) && echo $$CXXFLAGS)
13CXXOPTS := $(shell $(shell make -s -f $(CASAROOT)/$(CASAARCH)/makedefs VARS=COPTFLAGS eval_vars) && echo $$COPTFLAGS)
14LDFLAGS := $(shell $(shell make -s -f $(CASAROOT)/$(CASAARCH)/makedefs VARS=LD_FLAGS eval_vars) && echo $$LD_FLAGS)
[1877]15COREINCD := $(shell $(shell make -s -f $(CASAROOT)/$(CASAARCH)/makedefs VARS=COREINCD eval_vars) && echo $$COREINCD)
[1894]16CORELIB := $(shell $(shell make -s -f $(CASAROOT)/$(CASAARCH)/makedefs VARS=CORELIB eval_vars) && echo $$CORELIB)
17WCSLIBLIB := $(shell $(shell make -s -f $(CASAROOT)/$(CASAARCH)/makedefs VARS=WCSLIBLIB eval_vars) && echo $$WCSLIBLIB)
18CFITSIOLIBD := $(shell $(shell make -s -f $(CASAROOT)/$(CASAARCH)/makedefs VARS=CFITSIOLIBD eval_vars) && echo $$CFITSIOLIBD)
19CFITSIOINCD := $(shell $(shell make -s -f $(CASAROOT)/$(CASAARCH)/makedefs VARS=CFITSIOINCD eval_vars) && echo $$CFITSIOINCD)
20RPFITSLIBD := $(shell $(shell make -s -f $(CASAROOT)/$(CASAARCH)/makedefs VARS=RPFITSLIBD eval_vars) && echo $$RPFITSLIBD)
21
22CASAINC := -I$(CASAROOT)/code/include -I$(COREINCD) -I$(CASAROOT)/$(CASAARCH)/include
[1877]23CASALIB := $(CASAROOT)/$(CASAARCH)/lib
24
[1894]25CASALIB := $(CASAROOT)/$(CASAARCH)/lib
26#USELIB := lib64
27
[1898]28ifeq ($(shell uname), Darwin)
[1877]29 TARGETLIB := libatnf.dylib
[1894]30else
31 TARGETLIB := libatnf.so
[1877]32endif
33
34# the compiler
35ifndef CXX
36 CXX := g++
37endif
38
39# compiler flags
[1894]40CXXFLAGS += -fPIC
[1877]41
42# cfitsio
43CFITSIOLIB := -lcfitsio
44
45#rpfits
46RPFITSLIB := -lrpfits
47
48# the linker
49LD := $(CXX)
50
[1894]51LDFLAGS += -shared
[1898]52ifeq ($(shell uname), Darwin)
[1894]53 LDFLAGS += -headerpad_max_install_names -install_name $(CASAROOT)/$(CASAARCH)/lib/$(TARGETLIB)
54endif
[1877]55
[1894]56INCDIRS := -I$(COREINCD) -I$(CFITSIOINCD) -I$(EXTDIR)
[1915]57LIBS := -L$(CFITSIOLIBD) $(CFITSIOLIB) -L$(RPFITSLIBD) $(RPFITSLIB) -L$(CASALIB) $(CORELIB) -lgfortran
[1877]58
59OBJECTS := $(ATNFDIR)/pks/pks_maths.o \
60 $(ATNFDIR)/PKSIO/ASTEDataset.o \
61 $(ATNFDIR)/PKSIO/ASTEFXDataset.o \
62 $(ATNFDIR)/PKSIO/ASTEFXReader.o \
63 $(ATNFDIR)/PKSIO/ASTEReader.o \
64 $(ATNFDIR)/PKSIO/FITSreader.o \
65 $(ATNFDIR)/PKSIO/GBTFITSreader.o \
66 $(ATNFDIR)/PKSIO/MBFITSreader.o \
67 $(ATNFDIR)/PKSIO/MBrecord.o \
68 $(ATNFDIR)/PKSIO/NRO45FITSReader.o \
69 $(ATNFDIR)/PKSIO/NRO45Reader.o \
70 $(ATNFDIR)/PKSIO/NRODataset.o \
71 $(ATNFDIR)/PKSIO/NROFITSDataset.o \
72 $(ATNFDIR)/PKSIO/NROOTFDataset.o \
73 $(ATNFDIR)/PKSIO/NROReader.o \
74 $(ATNFDIR)/PKSIO/PKSFITSreader.o \
75 $(ATNFDIR)/PKSIO/PKSMS2reader.o \
76 $(ATNFDIR)/PKSIO/PKSMS2writer.o \
77 $(ATNFDIR)/PKSIO/PKSreader.o \
78 $(ATNFDIR)/PKSIO/PKSSDwriter.o \
79 $(ATNFDIR)/PKSIO/SDFITSreader.o \
80 $(ATNFDIR)/PKSIO/SDFITSwriter.o #\
[1894]81# $(ATNFDIR)/PKSIO/PKSmsg.o
[1877]82
83HEADERS := $(ATNFDIR)/pks/pks_maths.h \
84 $(ATNFDIR)/PKSIO/ASTEDataset.h \
85 $(ATNFDIR)/PKSIO/ASTEFXDataset.h \
86 $(ATNFDIR)/PKSIO/ASTEFXReader.h \
87 $(ATNFDIR)/PKSIO/ASTEReader.h \
88 $(ATNFDIR)/PKSIO/FITSreader.h \
89 $(ATNFDIR)/PKSIO/GBTFITSreader.h \
90 $(ATNFDIR)/PKSIO/MBFITSreader.h \
91 $(ATNFDIR)/PKSIO/MBrecord.h \
92 $(ATNFDIR)/PKSIO/NRO45FITSReader.h \
93 $(ATNFDIR)/PKSIO/NRO45Reader.h \
94 $(ATNFDIR)/PKSIO/NRODataRecord.h \
95 $(ATNFDIR)/PKSIO/NRODataset.h \
96 $(ATNFDIR)/PKSIO/NROFITSDataset.h \
97 $(ATNFDIR)/PKSIO/NROOTFDataset.h \
98 $(ATNFDIR)/PKSIO/NROReader.h \
99 $(ATNFDIR)/PKSIO/PKSFITSreader.h \
100 $(ATNFDIR)/PKSIO/PKSMS2reader.h \
101 $(ATNFDIR)/PKSIO/PKSMS2writer.h \
102 $(ATNFDIR)/PKSIO/PKSreader.h \
103 $(ATNFDIR)/PKSIO/PKSrecord.h \
104 $(ATNFDIR)/PKSIO/PKSSDwriter.h \
105 $(ATNFDIR)/PKSIO/PKSwriter.h \
106 $(ATNFDIR)/PKSIO/SDFITSreader.h \
107 $(ATNFDIR)/PKSIO/SDFITSwriter.h \
108 $(ATNFDIR)/PKSIO/SrcType.h #\
109# $(ATNFDIR)/PKSIO/PKSmsg.h
110
[1951]111ifeq ($(shell uname), Darwin)
112 CASACORELIB = $(CASALIB)/libcasa_casa.dylib \
113 $(CASALIB)/libcasa_components.dylib \
114 $(CASALIB)/libcasa_coordinates.dylib \
115 $(CASALIB)/libcasa_derivedmscal.dylib \
116 $(CASALIB)/libcasa_fits.dylib \
117 $(CASALIB)/libcasa_images.dylib \
118 $(CASALIB)/libcasa_lattices.dylib \
119 $(CASALIB)/libcasa_measures.dylib \
120 $(CASALIB)/libcasa_mirlib.dylib \
121 $(CASALIB)/libcasa_msfits.dylib \
122 $(CASALIB)/libcasa_ms.dylib \
123 $(CASALIB)/libcasa_scimath_f.dylib \
124 $(CASALIB)/libcasa_scimath.dylib \
125 $(CASALIB)/libcasa_tables.dylib
126else
127 CASACORELIB = $(CASALIB)/libcasa_casa.so \
128 $(CASALIB)/libcasa_components.so \
129 $(CASALIB)/libcasa_coordinates.so \
130 $(CASALIB)/libcasa_derivedmscal.so \
131 $(CASALIB)/libcasa_fits.so \
132 $(CASALIB)/libcasa_images.so \
133 $(CASALIB)/libcasa_lattices.so \
134 $(CASALIB)/libcasa_measures.so \
135 $(CASALIB)/libcasa_mirlib.so \
136 $(CASALIB)/libcasa_msfits.so \
137 $(CASALIB)/libcasa_ms.so \
138 $(CASALIB)/libcasa_scimath_f.so \
139 $(CASALIB)/libcasa_scimath.so \
140 $(CASALIB)/libcasa_tables.so
141endif
142
[1877]143.SUFFIXES: .o .cc
144.cc.o:
145 -@ echo
146 $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
147
148.PHONY : all clean objects realclean install
149
[1879]150all : $(TARGETLIB)
[1877]151
152objects : $(OBJECTS)
153
154$(TARGETLIB) : $(OBJECTS)
155 -@ echo
156 $(LD) $(CXXFLAGS) $(LDFLAGS) -o $(TARGETLIB) $(OBJECTS) $(LIBS)
157
[1951]158$(OBJECTS) : $(HEADERS) $(CASACORELIB)
[1877]159
160install :
161 @if ( test -f $(TARGETLIB) ) ; then cp -f $(TARGETLIB) $(CASALIB)/. ; fi
162
163clean :
164 -rm -f $(OBJECTS)
165
166cleanso :
167 -rm -f $(TARGETLIB)
168
169realclean : clean cleanso
170
Note: See TracBrowser for help on using the repository browser.