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