~pconv-team/polconvertsd/trunk-1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#
# Makefile for PolConvert within DiFX tree
#
.NOTPARALLEL:

if HAVE_IT_ALL
PolConvertSources = \
	CalTable.cpp CalTable.h \
	DataIO.cpp DataIO.h \
	DataIOFITS.cpp DataIOFITS.h \
	DataIOSWIN.cpp DataIOSWIN.h \
	Weighter.cpp Weighter.h \
	_PolConvert.cpp polconvert.xml \
	_getAntInfo.cpp _PolGainSolve.cpp \
	_XPCal.cpp \
	setup.py task_polconvert.py
PostPolScripts = PP/prepolconvert.py PP/runpolconvert.py PP/README.POLCONVERT \
	PP/Estimate_DPFU.py PP/DPFU_scanner.py
ScriptCopies = prepolconvert.py runpolconvert.py README.POLCONVERT \
	Estimate_DPFU.py DPFU_scanner.py

# BUILT_SOURCES doesn't help here.
BuiltSources = $(PolConvertSources) $(PostPolScripts)

bin_SCRIPTS = PP/prepolconvert.py PP/drivepolconvert.py
pkgdata_DATA = _PolConvert.so \
	_getAntInfo.so _PolGainSolve.so _XPCal.so \
	PP/runpolconvert.py task_polconvert.py polconvert.xml \
	PP/README.POLCONVERT PP/Estimate_DPFU.py PP/DPFU_scanner.py

# need to get the install first, then the local data install task
install-data-am: install-pkgdataDATA install-data-local

# runs the CASA local build in the install directory
install-data-local: install-pkgdataDATA
	cd $(pkgdatadir) ;\
	export PATH=@DIFXCASAPATH@${PATH_SEPARATOR}${PATH} ;\
	buildmytasks

# things created in pkgdata by buildmytasks
bmt = polconvert.py polconvert_cli.py mytasks.py *.pyc
uninstall-local:
	cd $(pkgdatadir) ; rm -f $(bmt)

check-local:
	-ls -l $(bindir)/*polconvert* $(pkgdatadir)

# no work for in-place builds, otherwise import the sources
copy.them:
	[ $(abs_builddir) = $(abs_srcdir) ] || {\
	  for s in $(PolConvertSources); do cp -p $(srcdir)/$$s . ; done ;\
	  touch copy.them ;\
	}

$(BuiltSources): copy.them

# python does an inplace build in the directory
# note that all .so files are build with this
_PolConvert.so: copy.them
	export PATH=@DIFXCASAPATH@${PATH_SEPARATOR}${PATH} ;\
	[ -n "${DIFXCASAVENV}" ] && source ${DIFXCASAVENV} ;\
	python setup.py build_ext --inplace

# use copy.them to distinguish build and source dirs
clean-local:
	rm -rf build *.so *.pyc
	rm -rf polconvert.py polconvert_cli.py mytasks.py
	rm -f $(ScriptCopies)
	-[ -f copy.them ] && rm -f $(PolConvertSources) && rm -f copy.them
endif
#
# eof
#