Makefile.am
1.44 KB
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
## Process this file with automake to produce Makefile.in
#
# The actual implemented logic is to use swig if swig is
# available on the system
if ENABLE_PYTHON_BINDING
if HAVE_PYTHON
if WITH_PYTHON_BINDING
# Set SWIG interface filename
SWIG_INTERFACE = ctatools.i
# Define the targets that should be built before anything else.
# These are honored by 'make all', 'make check' and 'make install'.
if HAVE_SWIG
BUILT_SOURCES = ctatools_wrap.cpp ctatools.py
endif
# Set files to be removed in clean
if HAVE_SWIG
CLEANFILES = ctatools_wrap.cpp ctatools.py
endif
all-local: build
# We build the python extension twice since the install step needs the result
# in a specific directory and the test make check has no access to the name
# of this specific directory. So we build one instance for checking, the other
# for installation. If we could get the name built by distutils we could avoid
# this.
build: ctatools_wrap.cpp ctatools.py
$(PYTHON_BUILD_PREFIX) $(PYTHON) setup.py build --build-platlib build
$(PYTHON_BUILD_PREFIX) $(PYTHON) setup.py build
install-exec-local:
$(PYTHON) setup.py install --prefix=$(prefix)
clean-local:
rm -rf build
if HAVE_SWIG
ctatools_wrap.cpp ctatools.py: $(SWIG_INTERFACE)
$(SWIG) -c++ -python -Wall -I$(prefix)/share/swig/gammalib -I$(GAMMALIB)/share/swig/gammalib -o ctatools_wrap.cpp -outdir . $(srcdir)/$(SWIG_INTERFACE)
endif # HAVE_SWIG
endif # WITH_PYTHON_BINDING
endif # HAVE_PYTHON
endif # ENABLE_PYTHON_BINDING