source: trunk/Makefile@ 1895

Last change on this file since 1895 was 1894, 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: try make

Put in Release Notes: No

Module(s): asap

Description: merged Wes's developments in NRAO repository.

Library and include pathes and build options are copied from casa build.


File size: 2.7 KB
RevLine 
[1757]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).
5#for mac
6#PREFIX := /opt/casa/darwin
7#for linux
8PREFIX := $(word 1, $(CASAPATH))/$(word 2,$(CASAPATH))
[1894]9PYTHONVER := $(shell $(shell make -s -f $(PREFIX)/makedefs VARS=PYTHONVER eval_vars) && echo $$PYTHONVER)
10PYDIR := $(PREFIX)/python/$(PYTHONVER)
[1757]11
12ifndef ASAPROOT
13 ASAPROOT := $(shell pwd)
14endif
[1877]15ATNFD := external-alma
[1757]16
17#PY := $(wildcard python/*.py)
18PY := $(wildcard python/*.py python/svninfo.txt)
[1849]19LIBS := /tmp/_asap.so
[1757]20BINS := bin/asap
[1761]21APPS := apps/asap2to3
[1757]22
23CASAROOT := $(word 1, $(CASAPATH))
24PLATFORM := $(word 2, $(CASAPATH))
25DISTDIR := asap_$(PLATFORM)
26
27all: module #doc
28
29module:
30 @if ( test -f getsvnrev.sh ) ; then /bin/bash getsvnrev.sh ; fi
[1877]31 @cd $(ASAPROOT)/$(ATNFD); make
[1757]32 @cd $(ASAPROOT)/src; make
[1761]33 @cd $(ASAPROOT)/apps; make
[1757]34
35doc:
36 @cd $(ASAPROOT)/doc; make
37
38
39install:
40 @if ( test -f getsvnrev.sh ) ; then /bin/bash getsvnrev.sh ; fi
41 @if ( test ! -d $(PYDIR)/asap ) ; then mkdir -p $(PYDIR)/asap ; fi
42 @if ( test ! -d $(PREFIX)/bin ) ; then mkdir -p $(PREFIX)/bin ; fi
43 @for file in $(LIBS) ; do cp -f $$file $(PYDIR)/asap ; done
44 @for file in $(BINS) ; do cp -f $$file $(PREFIX)/bin ; done
45 @for file in $(PY) ; do cp -f $$file $(PYDIR)/asap ; done
[1761]46 @for file in $(APPS) ; do cp -f $$file $(PREFIX)/bin ; done
[1757]47 @if ( test ! -d $(PREFIX)/share/asap ) ; then mkdir -p $(PREFIX)/share/asap ; fi
48 @cp -f share/ipythonrc-asap $(PREFIX)/share/asap/
[1879]49 @cd $(ASAPROOT)/$(ATNFD); make install
[1757]50 @echo "Successfully installed asap module to" $(PYDIR)
51
52clean:
53 @cd $(ASAPROOT)/src; make clean
[1894]54# @cd $(ASAPROOT)/doc; make clean
[1877]55 @cd $(ASAPROOT)/$(ATNFD); make realclean
[1894]56 @cd $(ASAPROOT)/apps; make clean
[1757]57
58datadist:
59 @echo "Generating ASAP data archive from aips++ installation..."
60 @cd $(CASAROOT); tar cfj $(ASAPROOT)/$(DISTDIR)/share/data.tar.bz2 data/ephemerides data/geodetic
61 @echo "...done."
62
63
64dist: module doc
65 @cd $(ASAPROOT)
66 @if ( test -d $(DISTDIR) ) ; then rm -rf $(DISTDIR) ; fi
67 @mkdir $(DISTDIR)
68 @mkdir $(DISTDIR)/build $(DISTDIR)/bin $(DISTDIR)/share
69 @for file in $(LIBS) ; do cp -f $$file $(DISTDIR)/build/ ; done
70 @for file in $(PY) ; do cp -f $$file $(DISTDIR)/build/ ; done
71 @for file in $(BINS) ; do cp -f $$file $(DISTDIR)/bin/ ; done
72 @cp -f share/ipythonrc-asap $(DISTDIR)/share/
73 make datadist
74 @cp -f doc/README $(DISTDIR)/
75 @cp -f doc/CHANGELOG $(DISTDIR)/
76 @cp -f bin/install.sh $(DISTDIR)/bin/
77 @echo "Creating compressed archive..."
78 @tar jcf $(DISTDIR).tar.bz2 $(DISTDIR)
79 @rm -rf $(DISTDIR)/
80 @echo "Successfully created binary package" $(DISTDIR).tar.bz2
81
82.PHONY: install clean
Note: See TracBrowser for help on using the repository browser.