1 | PREFIX := /opt/casa/darwin
|
---|
2 | #PREFIX := /export/home/minor/casa/active/linux_gnu
|
---|
3 | PYDIR := $(PREFIX)/python/2.5
|
---|
4 |
|
---|
5 | ifndef ASAPROOT
|
---|
6 | ASAPROOT := $(shell pwd)
|
---|
7 | endif
|
---|
8 |
|
---|
9 | #PY := $(wildcard python/*.py)
|
---|
10 | PY := $(wildcard python/*.py python/svninfo.txt)
|
---|
11 | LIBS := /tmp/_asap.so
|
---|
12 | BINS := bin/asap
|
---|
13 |
|
---|
14 | CASAROOT := $(word 1, $(AIPSPATH))
|
---|
15 | PLATFORM := $(word 2, $(AIPSPATH))
|
---|
16 | DISTDIR := asap_$(PLATFORM)
|
---|
17 |
|
---|
18 | all: module #doc
|
---|
19 |
|
---|
20 | module:
|
---|
21 | @cd $(ASAPROOT)/src; make
|
---|
22 | @if ( test -f getsvnrev.sh ) ; then /bin/bash getsvnrev.sh ; fi
|
---|
23 |
|
---|
24 | doc:
|
---|
25 | @cd $(ASAPROOT)/doc; make
|
---|
26 |
|
---|
27 |
|
---|
28 | install:
|
---|
29 | @if ( test ! -d $(PYDIR)/asap ) ; then mkdir -p $(PYDIR)/asap ; fi
|
---|
30 | @if ( test ! -d $(PREFIX)/bin ) ; then mkdir -p $(PREFIX)/bin ; 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
|
---|