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