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