eccodes/deprecated/python/Makefile.am

128 lines
3.3 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
###############################################################################
pkgpyexec_LTLIBRARIES = _gribapi_swig.la
2013-03-25 12:04:10 +00:00
_gribapi_swig_la_SOURCES = gribapi_swig_wrap.c grib_interface.c grib_interface.h
_gribapi_swig_la_LIBADD = $(top_builddir)/src/libeccodes.la $(PYTHON_LIBS)
_gribapi_swig_la_LDFLAGS = -module -avoid-version $(PYTHON_LDFLAGS)
2013-03-25 12:04:10 +00:00
INCLUDES = $(PYTHON_INCLUDES) -I$(NUMPY_INCLUDE)
gribapi_swig_wrap.c: swig_wrap_$(PYTHON_DATA_HANDLER).c
2016-07-18 16:47:15 +00:00
ln -s gribapi/gribapi.py
ln -s eccodes/eccodes.py
cp -f swig_wrap_$(PYTHON_DATA_HANDLER).c gribapi_swig_wrap.c
2013-03-25 12:04:10 +00:00
gribapi_swig.py: swig_wrap_$(PYTHON_DATA_HANDLER).py
cp -f swig_wrap_$(PYTHON_DATA_HANDLER).py gribapi_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 \
gribapi_swig.i \
gribapi.py \
2015-01-13 18:45:34 +00:00
eccodes.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 \
2014-06-18 16:14:01 +00:00
swig_wrap_numpy.py \
CMakeLists.txt
2013-03-25 12:04:10 +00:00
# What else I want installed
pkgpyexec_DATA = \
gribapi.py \
2015-01-13 18:45:34 +00:00
eccodes.py \
gribapi_swig.py
2013-03-25 12:04:10 +00:00
CLEANFILES = \
gribapi_swig_wrap.c \
gribapi_swig.py \
_gribapi_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) \
gribapi_swig_wrap.c \
gribapi_swig.py \
_gribapi_swig.so
2013-03-25 12:04:10 +00:00
# Extra stuff to go into the distribution
2016-04-04 15:53:25 +00:00
EXTRA_DIST = setup.py.autotools.in \
2013-03-25 12:04:10 +00:00
grib_interface.h \
grib_interface.c \
gribapi_swig.i \
gribapi.py \
2015-01-13 18:45:34 +00:00
eccodes.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 \
2014-06-18 16:14:01 +00:00
swig_wrap_numpy.py \
CMakeLists.txt
2013-03-25 12:04:10 +00:00
# What I want installed
2015-02-23 10:02:31 +00:00
pdir = $(libdir)/python$(PYTHON_VERSION)/site-packages/eccodes
2013-03-25 12:04:10 +00:00
p_DATA = \
_gribapi_swig.so \
gribapi.py \
2015-01-13 18:45:34 +00:00
eccodes.py \
gribapi_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_AEC[@],$(LIB_AEC),g' \
-e 's,[@]AEC_DIR[@],$(AEC_DIR),g' \
2013-03-25 12:04:10 +00:00
-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
2016-04-04 15:53:25 +00:00
setup.py: setup.py.autotools.in
$(do_subst) < setup.py.autotools.in > setup.py
2013-03-25 12:04:10 +00:00
gribapi_swig_wrap.c: swig_wrap_$(PYTHON_DATA_HANDLER).c
2016-07-18 16:47:15 +00:00
ln -s gribapi/gribapi.py
ln -s eccodes/eccodes.py
cp -f swig_wrap_$(PYTHON_DATA_HANDLER).c gribapi_swig_wrap.c
2013-03-25 12:04:10 +00:00
gribapi_swig.py: swig_wrap_$(PYTHON_DATA_HANDLER).py
cp -f swig_wrap_$(PYTHON_DATA_HANDLER).py gribapi_swig.py
2013-03-25 12:04:10 +00:00
_gribapi_swig.so: setup.py gribapi_swig_wrap.c gribapi_swig.py
2013-03-25 12:04:10 +00:00
$(PYTHON) setup.py build_ext --inplace
include $(DEVEL_RULES)
endif
else
# Case when WITH_PYTHON is not defined. Must add this rule otherwise
# make dist will fail
gribapi_swig_wrap.c: swig_wrap_array.c
cp -f swig_wrap_array.c gribapi_swig_wrap.c
2013-03-25 12:04:10 +00:00
endif