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