source: trunk/Makefile@ 1848

Last change on this file since 1848 was 1848, checked in by Takeshi Nakazato, 14 years ago

test commit

File size: 2.4 KB
Line 
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
8PREFIX := $(word 1, $(CASAPATH))/$(word 2,$(CASAPATH))
9PYDIR := $(PREFIX)/python/2.5
10
11ifndef ASAPROOT
12 ASAPROOT := $(shell pwd)
13endif
14
15#PY := $(wildcard python/*.py)
16PY := $(wildcard python/*.py python/svninfo.txt)
17#LIBS := /tmp/_asap.so
18LIBS := /home/nakazato/tmp/_asap.so
19BINS := bin/asap
20APPS := apps/asap2to3
21
22CASAROOT := $(word 1, $(CASAPATH))
23PLATFORM := $(word 2, $(CASAPATH))
24DISTDIR := asap_$(PLATFORM)
25
26all: module #doc
27
28module:
29 @if ( test -f getsvnrev.sh ) ; then /bin/bash getsvnrev.sh ; fi
30 @cd $(ASAPROOT)/src; make
31 @cd $(ASAPROOT)/apps; make
32
33doc:
34 @cd $(ASAPROOT)/doc; make
35
36
37install:
38 @if ( test -f getsvnrev.sh ) ; then /bin/bash getsvnrev.sh ; fi
39 @if ( test ! -d $(PYDIR)/asap ) ; then mkdir -p $(PYDIR)/asap ; fi
40 @if ( test ! -d $(PREFIX)/bin ) ; then mkdir -p $(PREFIX)/bin ; fi
41 @for file in $(LIBS) ; do cp -f $$file $(PYDIR)/asap ; done
42 @for file in $(BINS) ; do cp -f $$file $(PREFIX)/bin ; done
43 @for file in $(PY) ; do cp -f $$file $(PYDIR)/asap ; done
44 @for file in $(APPS) ; do cp -f $$file $(PREFIX)/bin ; done
45 @if ( test ! -d $(PREFIX)/share/asap ) ; then mkdir -p $(PREFIX)/share/asap ; fi
46 @cp -f share/ipythonrc-asap $(PREFIX)/share/asap/
47 @echo "Successfully installed asap module to" $(PYDIR)
48
49clean:
50 @cd $(ASAPROOT)/src; make clean
51 @cd $(ASAPROOT)/doc; make clean
52
53datadist:
54 @echo "Generating ASAP data archive from aips++ installation..."
55 @cd $(CASAROOT); tar cfj $(ASAPROOT)/$(DISTDIR)/share/data.tar.bz2 data/ephemerides data/geodetic
56 @echo "...done."
57
58
59dist: module doc
60 @cd $(ASAPROOT)
61 @if ( test -d $(DISTDIR) ) ; then rm -rf $(DISTDIR) ; fi
62 @mkdir $(DISTDIR)
63 @mkdir $(DISTDIR)/build $(DISTDIR)/bin $(DISTDIR)/share
64 @for file in $(LIBS) ; do cp -f $$file $(DISTDIR)/build/ ; done
65 @for file in $(PY) ; do cp -f $$file $(DISTDIR)/build/ ; done
66 @for file in $(BINS) ; do cp -f $$file $(DISTDIR)/bin/ ; done
67 @cp -f share/ipythonrc-asap $(DISTDIR)/share/
68 make datadist
69 @cp -f doc/README $(DISTDIR)/
70 @cp -f doc/CHANGELOG $(DISTDIR)/
71 @cp -f bin/install.sh $(DISTDIR)/bin/
72 @echo "Creating compressed archive..."
73 @tar jcf $(DISTDIR).tar.bz2 $(DISTDIR)
74 @rm -rf $(DISTDIR)/
75 @echo "Successfully created binary package" $(DISTDIR).tar.bz2
76
77.PHONY: install clean
Note: See TracBrowser for help on using the repository browser.