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