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 | PREFIX := /opt/casa/darwin
|
---|
6 | #PREFIX := /export/home/minor/casa/active/linux_gnu
|
---|
7 | PYDIR := $(PREFIX)/python/2.5
|
---|
8 |
|
---|
9 | ifndef ASAPROOT
|
---|
10 | ASAPROOT := $(shell pwd)
|
---|
11 | endif
|
---|
12 |
|
---|
13 | #PY := $(wildcard python/*.py)
|
---|
14 | PY := $(wildcard python/*.py python/svninfo.txt)
|
---|
15 | LIBS := /tmp/_asap.so
|
---|
16 | BINS := bin/asap
|
---|
17 |
|
---|
18 | CASAROOT := $(word 1, $(CASAPATH))
|
---|
19 | PLATFORM := $(word 2, $(CASAPATH))
|
---|
20 | DISTDIR := asap_$(PLATFORM)
|
---|
21 |
|
---|
22 | all: module #doc
|
---|
23 |
|
---|
24 | module:
|
---|
25 | @cd $(ASAPROOT)/src; make
|
---|
26 | @if ( test -f getsvnrev.sh ) ; then /bin/bash getsvnrev.sh ; fi
|
---|
27 |
|
---|
28 | doc:
|
---|
29 | @cd $(ASAPROOT)/doc; make
|
---|
30 |
|
---|
31 |
|
---|
32 | install:
|
---|
33 | @if ( test ! -d $(PYDIR)/asap ) ; then mkdir -p $(PYDIR)/asap ; fi
|
---|
34 | @if ( test ! -d $(PREFIX)/bin ) ; then mkdir -p $(PREFIX)/bin ; fi
|
---|
35 | @for file in $(LIBS) ; do cp -f $$file $(PYDIR)/asap ; done
|
---|
36 | @for file in $(BINS) ; do cp -f $$file $(PREFIX)/bin ; done
|
---|
37 | @for file in $(PY) ; do cp -f $$file $(PYDIR)/asap ; done
|
---|
38 | @if ( test ! -d $(PREFIX)/share/asap ) ; then mkdir -p $(PREFIX)/share/asap ; fi
|
---|
39 | @cp -f share/ipythonrc-asap $(PREFIX)/share/asap/
|
---|
40 | @echo "Successfully installed asap module to" $(PYDIR)
|
---|
41 |
|
---|
42 | clean:
|
---|
43 | @cd $(ASAPROOT)/src; make clean
|
---|
44 | @cd $(ASAPROOT)/doc; make clean
|
---|
45 |
|
---|
46 | datadist:
|
---|
47 | @echo "Generating ASAP data archive from aips++ installation..."
|
---|
48 | @cd $(CASAROOT); tar cfj $(ASAPROOT)/$(DISTDIR)/share/data.tar.bz2 data/ephemerides data/geodetic
|
---|
49 | @echo "...done."
|
---|
50 |
|
---|
51 |
|
---|
52 | dist: module doc
|
---|
53 | @cd $(ASAPROOT)
|
---|
54 | @if ( test -d $(DISTDIR) ) ; then rm -rf $(DISTDIR) ; fi
|
---|
55 | @mkdir $(DISTDIR)
|
---|
56 | @mkdir $(DISTDIR)/build $(DISTDIR)/bin $(DISTDIR)/share
|
---|
57 | @for file in $(LIBS) ; do cp -f $$file $(DISTDIR)/build/ ; done
|
---|
58 | @for file in $(PY) ; do cp -f $$file $(DISTDIR)/build/ ; done
|
---|
59 | @for file in $(BINS) ; do cp -f $$file $(DISTDIR)/bin/ ; done
|
---|
60 | @cp -f share/ipythonrc-asap $(DISTDIR)/share/
|
---|
61 | make datadist
|
---|
62 | @cp -f doc/README $(DISTDIR)/
|
---|
63 | @cp -f doc/CHANGELOG $(DISTDIR)/
|
---|
64 | @cp -f bin/install.sh $(DISTDIR)/bin/
|
---|
65 | @echo "Creating compressed archive..."
|
---|
66 | @tar jcf $(DISTDIR).tar.bz2 $(DISTDIR)
|
---|
67 | @rm -rf $(DISTDIR)/
|
---|
68 | @echo "Successfully created binary package" $(DISTDIR).tar.bz2
|
---|
69 |
|
---|
70 | .PHONY: install clean
|
---|