source: branches/hpc34/external-alma/Makefile@ 2891

Last change on this file since 2891 was 1965, checked in by Kana Sugimoto, 14 years ago

New Development: No

JIRA Issue: No

Ready for Test: Yes

Interface Changes: No

What Interface Changed:

Test Programs: make asap

Put in Release Notes: No

Module(s): asap build

Description: modified Makefiles so that it works with libcasacore.so.


File size: 4.4 KB
Line 
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
8# the casa environment CASAPATH has to be defined
9CASAROOT := $(word 1, $(CASAPATH))
10CASAARCH := $(word 2, $(CASAPATH))
11
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)
15COREINCD := $(shell $(shell make -s -f $(CASAROOT)/$(CASAARCH)/makedefs VARS=COREINCD eval_vars) && echo $$COREINCD)
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
23CASALIB := $(CASAROOT)/$(CASAARCH)/lib
24CASACORELIB := $(filter $(CASALIB)/libcasa%, $(CORELIB))
25
26ifeq ($(shell uname), Darwin)
27 TARGETLIB := libatnf.dylib
28else
29 TARGETLIB := libatnf.so
30endif
31
32# the compiler
33ifndef CXX
34 CXX := g++
35endif
36
37# compiler flags
38CXXFLAGS += -fPIC
39
40# cfitsio
41CFITSIOLIB := -lcfitsio
42
43#rpfits
44RPFITSLIB := -lrpfits
45
46# the linker
47LD := $(CXX)
48
49LDFLAGS += -shared
50ifeq ($(shell uname), Darwin)
51 LDFLAGS += -headerpad_max_install_names -install_name $(CASAROOT)/$(CASAARCH)/lib/$(TARGETLIB)
52endif
53
54INCDIRS := -I$(COREINCD) -I$(CFITSIOINCD) -I$(EXTDIR)
55LIBS := -L$(CFITSIOLIBD) $(CFITSIOLIB) -L$(RPFITSLIBD) $(RPFITSLIB) -L$(CASALIB) $(CORELIB) -lgfortran
56
57OBJECTS := $(ATNFDIR)/pks/pks_maths.o \
58 $(ATNFDIR)/PKSIO/ASTEDataset.o \
59 $(ATNFDIR)/PKSIO/ASTEFXDataset.o \
60 $(ATNFDIR)/PKSIO/ASTEFXReader.o \
61 $(ATNFDIR)/PKSIO/ASTEReader.o \
62 $(ATNFDIR)/PKSIO/FITSreader.o \
63 $(ATNFDIR)/PKSIO/GBTFITSreader.o \
64 $(ATNFDIR)/PKSIO/MBFITSreader.o \
65 $(ATNFDIR)/PKSIO/MBrecord.o \
66 $(ATNFDIR)/PKSIO/NRO45FITSReader.o \
67 $(ATNFDIR)/PKSIO/NRO45Reader.o \
68 $(ATNFDIR)/PKSIO/NRODataset.o \
69 $(ATNFDIR)/PKSIO/NROFITSDataset.o \
70 $(ATNFDIR)/PKSIO/NROOTFDataset.o \
71 $(ATNFDIR)/PKSIO/NROReader.o \
72 $(ATNFDIR)/PKSIO/PKSFITSreader.o \
73 $(ATNFDIR)/PKSIO/PKSMS2reader.o \
74 $(ATNFDIR)/PKSIO/PKSMS2writer.o \
75 $(ATNFDIR)/PKSIO/PKSreader.o \
76 $(ATNFDIR)/PKSIO/PKSSDwriter.o \
77 $(ATNFDIR)/PKSIO/SDFITSreader.o \
78 $(ATNFDIR)/PKSIO/SDFITSwriter.o #\
79# $(ATNFDIR)/PKSIO/PKSmsg.o
80
81HEADERS := $(ATNFDIR)/pks/pks_maths.h \
82 $(ATNFDIR)/PKSIO/ASTEDataset.h \
83 $(ATNFDIR)/PKSIO/ASTEFXDataset.h \
84 $(ATNFDIR)/PKSIO/ASTEFXReader.h \
85 $(ATNFDIR)/PKSIO/ASTEReader.h \
86 $(ATNFDIR)/PKSIO/FITSreader.h \
87 $(ATNFDIR)/PKSIO/GBTFITSreader.h \
88 $(ATNFDIR)/PKSIO/MBFITSreader.h \
89 $(ATNFDIR)/PKSIO/MBrecord.h \
90 $(ATNFDIR)/PKSIO/NRO45FITSReader.h \
91 $(ATNFDIR)/PKSIO/NRO45Reader.h \
92 $(ATNFDIR)/PKSIO/NRODataRecord.h \
93 $(ATNFDIR)/PKSIO/NRODataset.h \
94 $(ATNFDIR)/PKSIO/NROFITSDataset.h \
95 $(ATNFDIR)/PKSIO/NROOTFDataset.h \
96 $(ATNFDIR)/PKSIO/NROReader.h \
97 $(ATNFDIR)/PKSIO/PKSFITSreader.h \
98 $(ATNFDIR)/PKSIO/PKSMS2reader.h \
99 $(ATNFDIR)/PKSIO/PKSMS2writer.h \
100 $(ATNFDIR)/PKSIO/PKSreader.h \
101 $(ATNFDIR)/PKSIO/PKSrecord.h \
102 $(ATNFDIR)/PKSIO/PKSSDwriter.h \
103 $(ATNFDIR)/PKSIO/PKSwriter.h \
104 $(ATNFDIR)/PKSIO/SDFITSreader.h \
105 $(ATNFDIR)/PKSIO/SDFITSwriter.h \
106 $(ATNFDIR)/PKSIO/SrcType.h #\
107# $(ATNFDIR)/PKSIO/PKSmsg.h
108
109
110.SUFFIXES: .o .cc
111.cc.o:
112 -@ echo
113 $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
114
115.PHONY : all clean objects realclean install
116
117all : $(TARGETLIB)
118
119objects : $(OBJECTS)
120
121$(TARGETLIB) : $(OBJECTS)
122 -@ echo
123 $(LD) $(CXXFLAGS) $(LDFLAGS) -o $(TARGETLIB) $(OBJECTS) $(LIBS)
124
125$(OBJECTS) : $(HEADERS) $(CASACORELIB)
126
127install :
128 @if ( test -f $(TARGETLIB) ) ; then cp -f $(TARGETLIB) $(CASALIB)/. ; fi
129
130clean :
131 -rm -f $(OBJECTS)
132
133cleanso :
134 -rm -f $(TARGETLIB)
135
136realclean : clean cleanso
137
Note: See TracBrowser for help on using the repository browser.