2002-09-08 22:31:01 +00:00
|
|
|
|
2003-04-06 18:43:48 +00:00
|
|
|
# Hamlib bindings using SWIG
|
2002-10-07 21:44:51 +00:00
|
|
|
# more information on swig at http://www.swig.org
|
2003-04-06 18:43:48 +00:00
|
|
|
#
|
2020-03-23 12:52:01 +00:00
|
|
|
|
2021-03-09 05:26:44 +00:00
|
|
|
AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(top_srcdir)/include -I$(top_srcdir)/bindings \
|
2021-03-11 05:45:38 +00:00
|
|
|
$(TCL_INCLUDE_SPEC) $(PYTHON_CPPFLAGS)
|
2002-09-08 22:31:01 +00:00
|
|
|
|
2021-09-03 22:31:33 +00:00
|
|
|
AM_CFLAGS = @AM_CPPFLAGS@ -fno-strict-aliasing
|
2020-04-10 13:36:51 +00:00
|
|
|
AM_CXXFLAGS = -O2
|
2012-11-17 14:45:16 +00:00
|
|
|
|
2020-09-07 14:59:32 +00:00
|
|
|
SWGFILES = hamlib.swg ignore.swg rig.swg rotator.swg amplifier.swg
|
2008-05-04 21:36:33 +00:00
|
|
|
|
2017-07-26 11:33:42 +00:00
|
|
|
SWGDEP = \
|
|
|
|
$(top_srcdir)/include/hamlib/rig.h \
|
|
|
|
$(top_srcdir)/include/hamlib/riglist.h \
|
|
|
|
$(top_srcdir)/include/hamlib/rotator.h \
|
|
|
|
$(top_srcdir)/include/hamlib/rotlist.h \
|
2020-09-07 14:59:32 +00:00
|
|
|
$(top_srcdir)/include/hamlib/amplifier.h \
|
|
|
|
$(top_srcdir)/include/hamlib/amplist.h \
|
2008-05-04 21:36:33 +00:00
|
|
|
$(SWGFILES)
|
2003-06-22 19:54:06 +00:00
|
|
|
|
2012-11-17 14:45:16 +00:00
|
|
|
EXTRA_DIST = $(SWGFILES) \
|
2017-07-26 11:33:42 +00:00
|
|
|
Makefile.PL perltest.pl tcltest.tcl.in pytest.py py3test.py \
|
|
|
|
luatest.lua README.python
|
2012-11-17 14:45:16 +00:00
|
|
|
|
2017-07-26 11:33:42 +00:00
|
|
|
exampledir = $(docdir)/examples
|
|
|
|
example_DATA =
|
2012-11-17 14:45:16 +00:00
|
|
|
|
2017-07-26 11:33:42 +00:00
|
|
|
BUILT_SOURCES =
|
|
|
|
MOSTLYCLEANFILES =
|
2009-03-23 22:49:45 +00:00
|
|
|
|
2012-02-04 04:09:45 +00:00
|
|
|
|
2012-11-17 14:45:16 +00:00
|
|
|
if ENABLE_PERL
|
2003-04-06 18:43:48 +00:00
|
|
|
##########################################
|
2002-09-08 22:31:01 +00:00
|
|
|
# Perl binding
|
|
|
|
|
2012-11-17 14:45:16 +00:00
|
|
|
BUILT_SOURCES += hamlibperl_wrap.c
|
2012-11-28 23:11:41 +00:00
|
|
|
MOSTLYCLEANFILES += hamlibperl_wrap.c Hamlib.pm Hamlib.bs Hamlib-pl.mk.old
|
2017-07-26 11:33:42 +00:00
|
|
|
example_DATA += perltest.pl
|
2012-11-17 14:45:16 +00:00
|
|
|
|
2003-06-22 19:54:06 +00:00
|
|
|
hamlibperl_wrap.c: hamlib.swg $(SWIGDEP)
|
2017-07-27 20:54:57 +00:00
|
|
|
$(AM_V_GEN)$(SWIG) -perl5 -shadow $(AM_CPPFLAGS) -I$(top_srcdir)/bindings \
|
2020-05-30 18:14:33 +00:00
|
|
|
-o $@ $$(test -f hamlib.swg || echo '$(srcdir)/')hamlib.swg
|
2002-09-08 22:31:01 +00:00
|
|
|
|
2003-04-23 22:17:19 +00:00
|
|
|
Hamlib-pl.mk: $(srcdir)/Makefile.PL
|
2017-07-27 20:54:57 +00:00
|
|
|
$(AM_V_at)test -f Makefile.PL || $(LN_S) $(srcdir)/Makefile.PL Makefile.PL
|
2020-05-30 18:14:33 +00:00
|
|
|
$(AM_V_at)perl $$(test -f Makefile.PL || echo '$(srcdir)/')Makefile.PL \
|
2006-11-07 04:28:26 +00:00
|
|
|
MAKEFILE="Hamlib-pl.mk" \
|
2004-02-08 17:52:59 +00:00
|
|
|
PREFIX="$(prefix)" \
|
2012-02-04 13:51:25 +00:00
|
|
|
INC="$(AM_CPPFLAGS)" \
|
2003-11-16 22:09:38 +00:00
|
|
|
CC="$(CC)" \
|
2006-11-07 04:28:26 +00:00
|
|
|
OBJECT="hamlibperl_wrap.o" \
|
|
|
|
VERSION="$(PACKAGE_VERSION)" \
|
2008-05-17 16:36:54 +00:00
|
|
|
LIBS="-L$(top_builddir)/src/.libs -lhamlib"
|
2017-07-27 20:54:57 +00:00
|
|
|
$(AM_V_at)sed -e 's/^LD_RUN_PATH.*/LD_RUN_PATH =/' Hamlib-pl.mk > Hamlib-pl-norpath.mk
|
|
|
|
$(AM_V_at)mv Hamlib-pl-norpath.mk Hamlib-pl.mk
|
2002-10-31 00:47:31 +00:00
|
|
|
|
2003-04-06 18:43:48 +00:00
|
|
|
all-perl: Hamlib-pl.mk hamlibperl_wrap.c
|
2017-07-27 20:54:57 +00:00
|
|
|
$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -f Hamlib-pl.mk all
|
2003-04-06 18:43:48 +00:00
|
|
|
|
|
|
|
check-perl: all-perl
|
2017-07-27 20:54:57 +00:00
|
|
|
$(AM_V_at)LD_LIBRARY_PATH=$(top_builddir)/src/.libs perl $(top_srcdir)/bindings/perltest.pl
|
2003-04-06 18:43:48 +00:00
|
|
|
|
|
|
|
clean-perl: Hamlib-pl.mk
|
2017-07-27 20:54:57 +00:00
|
|
|
$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -f Hamlib-pl.mk clean
|
2003-04-06 18:43:48 +00:00
|
|
|
|
2012-11-28 23:11:41 +00:00
|
|
|
## 'distclean' target is a NOOP in Hamlib-pl.mk
|
2006-11-07 04:28:26 +00:00
|
|
|
distclean-perl: ## Hamlib-pl.mk
|
|
|
|
## $(MAKE) $(AM_MAKEFLAGS) -f Hamlib-pl.mk distclean
|
2002-09-08 22:31:01 +00:00
|
|
|
|
2003-04-06 18:43:48 +00:00
|
|
|
distcheck-perl: Hamlib-pl.mk
|
2017-07-27 20:54:57 +00:00
|
|
|
$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -f Hamlib-pl.mk distcheck
|
2002-09-08 22:31:01 +00:00
|
|
|
|
2003-04-06 18:43:48 +00:00
|
|
|
install-perl: Hamlib-pl.mk
|
2020-03-30 04:57:28 +00:00
|
|
|
$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -f Hamlib-pl.mk install_site
|
2003-04-06 18:43:48 +00:00
|
|
|
|
2006-11-09 04:32:35 +00:00
|
|
|
## ExtUtils::MakeMaker says uninstall is deprecated and won't remove the files
|
|
|
|
## anyway, so we'll have to figure out another way to remove the installed files.
|
|
|
|
uninstall-perl: ## Hamlib-pl.mk
|
|
|
|
## $(MAKE) $(AM_MAKEFLAGS) -f Hamlib-pl.mk uninstall
|
2004-02-08 17:52:59 +00:00
|
|
|
|
2012-11-17 14:45:16 +00:00
|
|
|
endif
|
|
|
|
# Perl
|
|
|
|
|
2003-04-06 18:43:48 +00:00
|
|
|
|
2012-11-28 23:11:41 +00:00
|
|
|
if ENABLE_PYTHON
|
2003-04-06 18:43:48 +00:00
|
|
|
##########################################
|
2003-08-25 22:26:08 +00:00
|
|
|
# Python binding
|
2003-04-06 18:43:48 +00:00
|
|
|
|
2014-06-18 20:42:07 +00:00
|
|
|
pyexec_ltlib = _Hamlib.la
|
2004-02-08 17:52:59 +00:00
|
|
|
|
2017-07-26 11:33:42 +00:00
|
|
|
MOSTLYCLEANFILES += hamlibpy_wrap.c Hamlib.py *.pyc
|
2012-11-19 20:30:48 +00:00
|
|
|
BUILT_SOURCES += hamlibpy_wrap.c Hamlib.py
|
|
|
|
|
2017-07-26 11:33:42 +00:00
|
|
|
# Set by AM_CONDITIONAL in configure.ac
|
|
|
|
if PYVER_3
|
|
|
|
pytest = py3test.py
|
|
|
|
else !PYVER_3
|
|
|
|
pytest = pytest.py
|
|
|
|
endif
|
|
|
|
# PYVER_3
|
|
|
|
|
|
|
|
example_DATA += $(pytest)
|
|
|
|
|
2014-06-18 20:42:07 +00:00
|
|
|
nodist_pyexec_PYTHON = Hamlib.py
|
2003-08-25 22:26:08 +00:00
|
|
|
nodist__Hamlib_la_SOURCES = hamlibpy_wrap.c
|
2012-11-19 20:30:48 +00:00
|
|
|
|
2007-11-27 19:55:19 +00:00
|
|
|
_Hamlib_la_LDFLAGS = -no-undefined -module -avoid-version
|
2017-07-23 02:44:57 +00:00
|
|
|
_Hamlib_la_LIBADD = $(top_builddir)/src/libhamlib.la $(PYTHON_LIBS)
|
2014-06-18 20:42:07 +00:00
|
|
|
_Hamlib_ladir = $(pyexecdir)
|
|
|
|
_Hamlib_la_LTLIBRARIES = $(pyexec_ltlib)
|
2004-02-08 17:52:59 +00:00
|
|
|
|
2014-06-18 20:42:07 +00:00
|
|
|
all-py: $(pyexec_ltlib)
|
2003-08-25 22:26:08 +00:00
|
|
|
|
|
|
|
check-py: all-py
|
2017-07-27 20:08:22 +00:00
|
|
|
$(AM_V_at)PYTHONPATH=$(builddir):$(builddir)/.libs \
|
|
|
|
$(PYTHON) $(srcdir)/$(pytest) \
|
|
|
|
|| echo "Python test failed" 1>&2
|
2003-08-25 22:26:08 +00:00
|
|
|
|
2010-05-04 22:18:11 +00:00
|
|
|
Hamlib.py: hamlibpy_wrap.c
|
2012-11-19 20:30:48 +00:00
|
|
|
|
2010-05-04 22:18:11 +00:00
|
|
|
hamlibpy_wrap.c: hamlib.swg $(SWGDEP)
|
2021-03-09 16:09:22 +00:00
|
|
|
$(AM_V_GEN)$(SWIG) -python $(AM_CPPFLAGS) $(PYTHON_CPPFLAGS) -I$(top_srcdir)/bindings \
|
2020-05-30 18:14:33 +00:00
|
|
|
-o $@ $$(test -f hamlib.swg || echo '$(srcdir)/')hamlib.swg
|
2010-05-04 22:18:11 +00:00
|
|
|
|
2004-02-08 17:52:59 +00:00
|
|
|
install-py:
|
|
|
|
clean-py:
|
|
|
|
distclean-py:
|
2012-02-04 04:09:45 +00:00
|
|
|
uninstall-py:
|
2003-08-25 22:26:08 +00:00
|
|
|
|
2012-11-17 14:45:16 +00:00
|
|
|
endif
|
|
|
|
# Python
|
|
|
|
|
|
|
|
|
2012-11-28 23:11:41 +00:00
|
|
|
if ENABLE_TCL
|
2010-05-02 21:55:00 +00:00
|
|
|
##########################################
|
2012-11-28 23:11:41 +00:00
|
|
|
# Tcl binding
|
|
|
|
|
2017-07-26 11:33:42 +00:00
|
|
|
BUILT_SOURCES += hamlibtcl_wrap.c
|
|
|
|
MOSTLYCLEANFILES += hamlibtcl_wrap.c pkgIndex.tcl tcltest.tcl
|
|
|
|
example_DATA += tcltest.tcl
|
2012-11-28 23:11:41 +00:00
|
|
|
|
|
|
|
tcl_ltlib = hamlibtcl.la
|
|
|
|
|
2017-07-26 11:33:42 +00:00
|
|
|
tcldir = $(libdir)/tcl$(TCL_VERSION)/Hamlib
|
2012-11-28 23:11:41 +00:00
|
|
|
|
2017-07-26 11:33:42 +00:00
|
|
|
PKG_VER = $(ABI_VERSION).$(ABI_REVISION)
|
|
|
|
DLL = hamlibtcl-$(PKG_VER)$(TCL_SHLIB_SUFFIX)
|
2012-11-28 23:11:41 +00:00
|
|
|
|
|
|
|
nodist_hamlibtcl_la_SOURCES = hamlibtcl_wrap.c
|
2017-07-26 11:33:42 +00:00
|
|
|
hamlibtcl_la_LDFLAGS = -no-undefined -module -release $(PKG_VER) -avoid-version
|
|
|
|
hamlibtcl_la_LIBADD = $(top_builddir)/src/libhamlib.la $(TCL_LIB_SPEC)
|
2012-11-28 23:11:41 +00:00
|
|
|
|
|
|
|
hamlibtcl_ladir = $(tcldir)
|
|
|
|
hamlibtcl_la_DATA = pkgIndex.tcl
|
|
|
|
|
2017-07-26 11:33:42 +00:00
|
|
|
# Install hamlibtcl.la into the $(tcldir)/Hamlib directory
|
|
|
|
# set by $(hamlibtcl_ladir)
|
2012-11-28 23:11:41 +00:00
|
|
|
hamlibtcl_la_LTLIBRARIES = $(tcl_ltlib)
|
|
|
|
|
Fix spelling errors
Fixed using the following command:
codespell --write-changes --summary --skip=*.m4 --ignore-words-list="develope,get's,quitt,setts,som,ue,vektor"
codespell --write-changes --summary --skip=aclocal.m4,lib --ignore-words-list="develope,get's,quitt,setts,som,ue,vektor"
Codespell home page: https://github.com/codespell-project/codespell
2020-07-24 07:02:12 +00:00
|
|
|
# Having the first occurrence of 'hamlib' capitalized seemed to cause confusion
|
2012-11-28 23:11:41 +00:00
|
|
|
# for the TCL interpreter loading the Hamlib module.
|
|
|
|
pkgIndex.tcl: Makefile
|
2017-07-27 19:44:40 +00:00
|
|
|
$(AM_V_at)echo 'package ifneeded hamlib $(PKG_VER) [list load [file join $$dir $(DLL)] Hamlib]' > pkgIndex.tcl
|
2012-11-28 23:11:41 +00:00
|
|
|
|
|
|
|
hamlibtcl_wrap.c: hamlib.swg $(SWGDEP)
|
2017-07-27 19:44:40 +00:00
|
|
|
$(AM_V_GEN)$(SWIG) -tcl -pkgversion $(PKG_VER) $(AM_CPPFLAGS) \
|
|
|
|
-I$(top_srcdir)/bindings \
|
2020-05-30 18:14:33 +00:00
|
|
|
-o $@ $$(test -f hamlib.swg || echo '$(srcdir)/')hamlib.swg
|
2017-07-26 11:33:42 +00:00
|
|
|
|
|
|
|
do_subst = sed -e 's,[@]tcldir[@],$(tcldir),g'
|
|
|
|
|
|
|
|
tcltest.tcl: tcltest.tcl.in Makefile
|
2017-07-27 19:44:40 +00:00
|
|
|
$(AM_V_GEN)$(do_subst) < $(srcdir)/tcltest.tcl.in > tcltest.tcl
|
2012-11-28 23:11:41 +00:00
|
|
|
|
2017-07-26 11:33:42 +00:00
|
|
|
all-tcl: pkgIndex.tcl $(tcl_ltlib) tcltest.tcl
|
2012-11-28 23:11:41 +00:00
|
|
|
|
|
|
|
check-tcl: all-tcl
|
2017-07-27 19:44:40 +00:00
|
|
|
$(AM_V_at)cp $(builddir)/pkgIndex.tcl $(builddir)/.libs
|
|
|
|
$(AM_V_at)TCLLIBPATH=$(builddir)/.libs tclsh $(builddir)/tcltest.tcl \
|
|
|
|
|| echo "Tcl test failed" 1>&2
|
|
|
|
$(AM_V_at)rm -f $(builddir)/.libs/pkgIndex.tcl
|
2012-11-28 23:11:41 +00:00
|
|
|
|
|
|
|
install-tcl:
|
|
|
|
clean-tcl:
|
|
|
|
distclean-tcl: clean-tcl
|
|
|
|
uninstall-tcl:
|
|
|
|
|
|
|
|
endif
|
|
|
|
# TCL
|
|
|
|
|
2016-11-03 12:04:40 +00:00
|
|
|
if ENABLE_LUA
|
|
|
|
##########################################
|
|
|
|
# Lua binding
|
|
|
|
|
|
|
|
luaexec_ltlib = Hamliblua.la
|
|
|
|
|
2017-07-26 11:33:42 +00:00
|
|
|
MOSTLYCLEANFILES += hamliblua_wrap.c
|
2016-11-03 12:04:40 +00:00
|
|
|
BUILT_SOURCES += hamliblua_wrap.c
|
2017-07-26 11:33:42 +00:00
|
|
|
example_DATA += luatest.lua
|
2016-11-03 12:04:40 +00:00
|
|
|
|
|
|
|
nodist_luaexec_LUA = Hamlib.lua
|
|
|
|
nodist_Hamliblua_la_SOURCES = hamliblua_wrap.c
|
|
|
|
|
|
|
|
Hamliblua_la_CPPFLAGS = $(LUA_INCLUDE) -I$(top_srcdir)/include -I$(top_srcdir)/src
|
|
|
|
Hamliblua_la_LDFLAGS = -no-undefined -module -avoid-version
|
|
|
|
Hamliblua_la_LIBADD = $(top_builddir)/src/libhamlib.la
|
|
|
|
Hamliblua_ladir = $(luaexecdir)
|
|
|
|
Hamliblua_la_LTLIBRARIES = $(luaexec_ltlib)
|
|
|
|
|
|
|
|
all-lua: $(luaexec_ltlib)
|
|
|
|
|
|
|
|
check-lua: all-lua
|
2017-07-27 21:48:03 +00:00
|
|
|
$(AM_V_at)LUA_CPATH="$(abs_builddir)/.libs/?.so" $(LUA) $(srcdir)/luatest.lua \
|
|
|
|
|| echo "Lua test failed" 1>&2
|
2016-11-03 12:04:40 +00:00
|
|
|
|
|
|
|
Hamlib.lua: hamliblua_wrap.c
|
|
|
|
|
|
|
|
hamliblua_wrap.c: hamlib.swg $(SWGDEP)
|
2017-07-27 21:48:03 +00:00
|
|
|
$(AM_V_GEN)$(SWIG) -lua $(AM_CPPFLAGS) -I$(top_srcdir)/bindings \
|
2020-05-30 18:14:33 +00:00
|
|
|
-o $@ $$(test -f hamlib.swg || echo '$(srcdir)/')hamlib.swg
|
2016-11-03 12:04:40 +00:00
|
|
|
|
|
|
|
install-lua:
|
|
|
|
clean-lua:
|
|
|
|
distclean-lua:
|
|
|
|
uninstall-lua:
|
|
|
|
|
|
|
|
endif
|
|
|
|
# Lua
|
|
|
|
|
2003-08-25 22:26:08 +00:00
|
|
|
|
2005-04-03 17:06:37 +00:00
|
|
|
all-local: @BINDING_ALL@
|
|
|
|
|
|
|
|
check-local: @BINDING_CHECK@
|
|
|
|
clean-local: @BINDING_CLEAN@
|
|
|
|
distclean-local: @BINDING_DISTCLEAN@
|
|
|
|
distcheck-local: @BINDING_DISTCHECK@
|
|
|
|
install-exec-local: @BINDING_INSTALL_EXEC@
|
|
|
|
uninstall-local: @BINDING_UNINSTALL@
|