source: trunk/external-alma/Makefile@ 1908

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

New Development: No

JIRA Issue: No (related to asap merge)

Ready for Test: Yes

Interface Changes: No

Test Programs: build asap with make

Put in Release Notes: No

Module(s): asap

Description: Merged Jonas' modification for platform detection.


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