[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))
|
---|
[1894] | 9 | PYTHONVER := $(shell $(shell make -s -f $(PREFIX)/makedefs VARS=PYTHONVER eval_vars) && echo $$PYTHONVER)
|
---|
| 10 | PYDIR := $(PREFIX)/python/$(PYTHONVER)
|
---|
[1757] | 11 |
|
---|
| 12 | ifndef ASAPROOT
|
---|
| 13 | ASAPROOT := $(shell pwd)
|
---|
| 14 | endif
|
---|
[1877] | 15 | ATNFD := external-alma
|
---|
[1757] | 16 |
|
---|
| 17 | #PY := $(wildcard python/*.py)
|
---|
| 18 | PY := $(wildcard python/*.py python/svninfo.txt)
|
---|
[1849] | 19 | LIBS := /tmp/_asap.so
|
---|
[1757] | 20 | BINS := bin/asap
|
---|
[1761] | 21 | APPS := apps/asap2to3
|
---|
[1757] | 22 |
|
---|
| 23 | CASAROOT := $(word 1, $(CASAPATH))
|
---|
| 24 | PLATFORM := $(word 2, $(CASAPATH))
|
---|
| 25 | DISTDIR := asap_$(PLATFORM)
|
---|
| 26 |
|
---|
| 27 | all: module #doc
|
---|
| 28 |
|
---|
| 29 | module:
|
---|
| 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 |
|
---|
| 35 | doc:
|
---|
| 36 | @cd $(ASAPROOT)/doc; make
|
---|
| 37 |
|
---|
| 38 |
|
---|
| 39 | install:
|
---|
| 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 |
|
---|
| 52 | clean:
|
---|
| 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 |
|
---|
| 58 | datadist:
|
---|
| 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 |
|
---|
| 64 | dist: 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
|
---|