source: branches/polybatch/external-alma/Makefile@ 1935

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

New Development: No

JIRA Issue: No (related to merge)

Ready for Test: Yes

Interface Changes: No

What Interface Changed:

Test Programs: make & make install

Put in Release Notes: No

Module(s): asap

Description: merged Wes's changes to Makefiles


File size: 4.3 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# cfitsio
43CFITSIOLIB := -lcfitsio
44
45#rpfits
46RPFITSLIB := -lrpfits
47
48# the linker
49LD := $(CXX)
50
51LDFLAGS += -shared
52ifeq ($(shell uname), Darwin)
53 LDFLAGS += -headerpad_max_install_names -install_name $(CASAROOT)/$(CASAARCH)/lib/$(TARGETLIB)
54endif
55
56INCDIRS := -I$(COREINCD) -I$(CFITSIOINCD) -I$(EXTDIR)
57LIBS := -L$(CFITSIOLIBD) $(CFITSIOLIB) -L$(RPFITSLIBD) $(RPFITSLIB) -L$(CASALIB) $(CORELIB) -lgfortran
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 #\
81# $(ATNFDIR)/PKSIO/PKSmsg.o
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
111.SUFFIXES: .o .cc
112.cc.o:
113 -@ echo
114 $(CXX) $(CXXOPTS) -c $(CXXFLAGS) $(INCDIRS) -o $@ $<
115
116.PHONY : all clean objects realclean install
117
118all : $(TARGETLIB)
119
120objects : $(OBJECTS)
121
122$(TARGETLIB) : $(OBJECTS)
123 -@ echo
124 $(LD) $(CXXFLAGS) $(LDFLAGS) -o $(TARGETLIB) $(OBJECTS) $(LIBS)
125
126$(OBJECTS) : $(HEADERS)
127
128install :
129 @if ( test -f $(TARGETLIB) ) ; then cp -f $(TARGETLIB) $(CASALIB)/. ; fi
130
131clean :
132 -rm -f $(OBJECTS)
133
134cleanso :
135 -rm -f $(TARGETLIB)
136
137realclean : clean cleanso
138
Note: See TracBrowser for help on using the repository browser.