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