eccodes/python/Makefile.am

110 lines
2.8 KiB
Makefile
Raw Normal View History

2013-03-25 12:04:10 +00:00
if WITH_PYTHON
if CREATING_SHARED_LIBS
###############################################################################
# Case when shared libraries are enabled
###############################################################################
2013-03-25 14:23:07 +00:00
pkgpyexec_LTLIBRARIES = _eccode_swig.la
2013-03-25 12:04:10 +00:00
2013-03-25 14:23:07 +00:00
_eccode_swig_la_SOURCES = eccode_swig_wrap.c grib_interface.c grib_interface.h
_eccode_swig_la_LIBADD = $(top_builddir)/src/libgrib_api.la $(PYTHON_LIBS)
_eccode_swig_la_LDFLAGS = -module -avoid-version $(PYTHON_LDFLAGS)
2013-03-25 12:04:10 +00:00
INCLUDES = $(PYTHON_INCLUDES) -I$(NUMPY_INCLUDE)
2013-03-25 14:23:07 +00:00
eccode_swig_wrap.c: swig_wrap_$(PYTHON_DATA_HANDLER).c
cp -f swig_wrap_$(PYTHON_DATA_HANDLER).c eccode_swig_wrap.c
2013-03-25 12:04:10 +00:00
2013-03-25 14:23:07 +00:00
eccode_swig.py: swig_wrap_$(PYTHON_DATA_HANDLER).py
cp -f swig_wrap_$(PYTHON_DATA_HANDLER).py eccode_swig.py
2013-03-25 12:04:10 +00:00
# Extra stuff to go into the distribution
EXTRA_DIST = grib_interface.h \
grib_interface.c \
2013-03-25 14:23:07 +00:00
eccode_swig.i \
eccode.py \
2013-03-25 12:04:10 +00:00
numpy.i \
grib_errors.h \
extrules.am \
dummy.am \
swig_wrap_array.c \
swig_wrap_numpy.c \
swig_wrap_array.py \
swig_wrap_numpy.py
# What else I want installed
pkgpyexec_DATA = \
2013-03-25 14:23:07 +00:00
eccode.py \
eccode_swig.py
2013-03-25 12:04:10 +00:00
CLEANFILES = \
2013-03-25 14:23:07 +00:00
eccode_swig_wrap.c \
eccode_swig.py \
_eccode_swig.la
2013-03-25 12:04:10 +00:00
include $(DEVEL_RULES)
else
###############################################################################
# When shared libraries are disabled.
# Uses the static library so must have --with-pic
###############################################################################
noinst_SCRIPTS = setup.py
CLEANFILES = $(noinst_SCRIPTS) \
2013-03-25 14:23:07 +00:00
eccode_swig_wrap.c \
eccode_swig.py \
_eccode_swig.so
2013-03-25 12:04:10 +00:00
# Extra stuff to go into the distribution
EXTRA_DIST = setup.py.in \
grib_interface.h \
grib_interface.c \
2013-03-25 14:23:07 +00:00
eccode_swig.i \
eccode.py \
2013-03-25 12:04:10 +00:00
numpy.i \
grib_errors.h \
extrules.am \
dummy.am \
swig_wrap_array.c \
swig_wrap_numpy.c \
swig_wrap_array.py \
swig_wrap_numpy.py
# What I want installed
2013-03-25 14:23:07 +00:00
pdir = $(libdir)/python$(PYTHON_VERSION)/site-packages/eccode
2013-03-25 12:04:10 +00:00
p_DATA = \
2013-03-25 14:23:07 +00:00
_eccode_swig.so \
eccode.py \
eccode_swig.py
2013-03-25 12:04:10 +00:00
do_subst = sed -e 's,[@]LIB_JASPER[@],$(LIB_JASPER),g' \
-e 's,[@]JASPER_DIR[@],$(JASPER_DIR),g' \
-e 's,[@]LIB_OPENJPEG[@],$(LIB_OPENJPEG),g' \
-e 's,[@]OPENJPEG_DIR[@],$(OPENJPEG_DIR),g' \
-e 's,[@]LIB_PNG[@],$(LIB_PNG),g' \
-e 's,[@]BUILD_DIR[@],$(top_builddir),g' \
-e 's,[@]DATA_HANDLER[@],$(PYTHON_DATA_HANDLER),g'
clean-local:
-rm -rf build
setup.py: setup.py.in
$(do_subst) < setup.py.in > setup.py
2013-03-25 14:23:07 +00:00
eccode_swig_wrap.c: swig_wrap_$(PYTHON_DATA_HANDLER).c
cp -f swig_wrap_$(PYTHON_DATA_HANDLER).c eccode_swig_wrap.c
2013-03-25 12:04:10 +00:00
2013-03-25 14:23:07 +00:00
eccode_swig.py: swig_wrap_$(PYTHON_DATA_HANDLER).py
cp -f swig_wrap_$(PYTHON_DATA_HANDLER).py eccode_swig.py
2013-03-25 12:04:10 +00:00
2013-03-25 14:23:07 +00:00
_eccode_swig.so: setup.py eccode_swig_wrap.c eccode_swig.py
2013-03-25 12:04:10 +00:00
$(PYTHON) setup.py build_ext --inplace
include $(DEVEL_RULES)
endif
endif