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
|
|
|
#
|
|
|
|
# note:
|
|
|
|
# - VPATH building does not work yet
|
|
|
|
# - Tcl install procedure is not complete yet
|
2002-09-08 22:31:01 +00:00
|
|
|
|
2003-04-06 18:43:48 +00:00
|
|
|
SWIG=swig
|
2002-09-08 22:31:01 +00:00
|
|
|
|
2003-04-23 22:17:19 +00:00
|
|
|
#INCLUDES = @INCLUDES@ -Dbool=char -I@PERL_INC_DIR@ @TCL_INCLUDE_SPEC@ -I$(top_srcdir)/bindings
|
|
|
|
INCLUDES = @INCLUDES@ -I$(top_srcdir)/bindings @TCL_INCLUDE_SPEC@
|
2002-09-08 22:31:01 +00:00
|
|
|
|
2003-06-22 19:54:06 +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
|
|
|
|
|
2003-04-06 18:43:48 +00:00
|
|
|
##########################################
|
2002-09-08 22:31:01 +00:00
|
|
|
# Perl binding
|
|
|
|
|
2003-06-22 19:54:06 +00:00
|
|
|
hamlibperl_wrap.c: hamlib.swg $(SWIGDEP)
|
2003-04-06 18:43:48 +00:00
|
|
|
$(SWIG) -perl5 -shadow @INCLUDES@ -I$(top_srcdir)/bindings -o $@ \
|
|
|
|
`test -f hamlib.swg || echo '$(srcdir)/'`hamlib.swg
|
2002-09-08 22:31:01 +00:00
|
|
|
|
2003-04-06 18:43:48 +00:00
|
|
|
# Add LIB="$(libdir)" to install in private place
|
2003-04-23 22:17:19 +00:00
|
|
|
Hamlib-pl.mk: $(srcdir)/Makefile.PL
|
|
|
|
test -f Makefile.PL || $(LN_S) $(srcdir)/Makefile.PL Makefile.PL
|
|
|
|
perl `test -f Makefile.PL || echo '$(srcdir)/'`Makefile.PL \
|
|
|
|
MAKEFILE=Hamlib-pl.mk INST_MAN3DIR="$(mandir)" \
|
2003-04-06 18:43:48 +00:00
|
|
|
INC="$(INCLUDES)" \
|
|
|
|
OBJECT="hamlibperl_wrap.o" VERSION="$(PACKAGE_VERSION)" \
|
|
|
|
LIBS="-L$(top_builddir)/src/.libs -lhamlib"
|
2002-10-31 00:47:31 +00:00
|
|
|
|
2003-04-06 18:43:48 +00:00
|
|
|
all-perl: Hamlib-pl.mk hamlibperl_wrap.c
|
|
|
|
$(MAKE) $(AM_MAKEFLAGS) -f Hamlib-pl.mk all
|
|
|
|
|
|
|
|
check-perl: all-perl
|
|
|
|
$(MAKE) $(AM_MAKEFLAGS) -f Hamlib-pl.mk test
|
|
|
|
|
|
|
|
clean-perl: Hamlib-pl.mk
|
|
|
|
$(MAKE) $(AM_MAKEFLAGS) -f Hamlib-pl.mk clean
|
|
|
|
|
|
|
|
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
|
|
|
|
$(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
|
|
|
|
$(MAKE) $(AM_MAKEFLAGS) -f Hamlib-pl.mk install
|
|
|
|
|
|
|
|
|
|
|
|
##########################################
|
2002-09-08 22:31:01 +00:00
|
|
|
# Tcl binding
|
2003-04-06 18:43:48 +00:00
|
|
|
|
|
|
|
lib_LTLIBRARIES = hamlibtcl.la
|
|
|
|
|
2003-04-23 22:17:19 +00:00
|
|
|
PKG_VER=1.0
|
|
|
|
DLL=hamlibtcl-$(PKG_VER)@TCL_SHLIB_SUFFIX@
|
2002-09-08 22:31:01 +00:00
|
|
|
|
2002-10-31 00:47:31 +00:00
|
|
|
nodist_hamlibtcl_la_SOURCES = hamlibtcl_wrap.c
|
2003-04-23 22:17:19 +00:00
|
|
|
hamlibtcl_la_LDFLAGS = -no-undefined -module -release $(PKG_VER) -avoid-version @TCL_LIB_SPEC@
|
2002-11-13 20:39:07 +00:00
|
|
|
hamlibtcl_la_LIBADD = $(top_builddir)/src/libhamlib.la
|
2002-09-08 22:31:01 +00:00
|
|
|
|
2003-04-23 22:17:19 +00:00
|
|
|
pkgIndex.tcl: Makefile
|
2003-04-06 18:43:48 +00:00
|
|
|
echo 'package ifneeded Hamlib $(PKG_VER) [list load [file join $$dir $(DLL)] Hamlib]' > pkgIndex.tcl
|
|
|
|
|
2003-06-22 19:54:06 +00:00
|
|
|
hamlibtcl_wrap.c: hamlib.swg $(SWGDEP)
|
2003-04-23 22:17:19 +00:00
|
|
|
$(SWIG) -tcl -pkgversion $(PKG_VER) @INCLUDES@ -I$(top_srcdir)/bindings -o $@ \
|
|
|
|
`test -f hamlib.swg || echo '$(srcdir)/'`hamlib.swg
|
|
|
|
|
|
|
|
all-tcl: pkgIndex.tcl #$(DLL)
|
2003-04-06 18:43:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
PACKAGEDIR = $(TCL_EXEC_PREFIX)/lib/$(PACKAGE)
|
2003-04-23 22:17:19 +00:00
|
|
|
libdir = $(PACKAGEDIR)
|
2003-04-06 18:43:48 +00:00
|
|
|
|
|
|
|
install-tcl: all-tcl
|
|
|
|
# if test ! -d $(PACKAGEDIR); then mkdir $(PACKAGEDIR); fi
|
|
|
|
# $(INSTALL_PROGRAM) $(DLL) $(PACKAGEDIR)/$(DLL)
|
|
|
|
# $(INSTALL_DATA) pkgIndex.tcl $(PACKAGEDIR)/pkgIndex.tcl
|
|
|
|
# $(INSTALL_DATA) $(MANN) $(MAN_INSTALL_DIR)/
|
|
|
|
|
2003-04-23 22:17:19 +00:00
|
|
|
check-tcl: all-tcl
|
|
|
|
TCLLIBPATH=$(builddir)/.libs $(srcdir)/tcltest.tcl || echo "Tcl test failed" 1>&2
|
|
|
|
|
2003-04-06 18:43:48 +00:00
|
|
|
clean-tcl:
|
|
|
|
rm -f pkgIndex.tcl $(DLL)
|
|
|
|
distclean-tcl: clean-tcl
|
|
|
|
|
|
|
|
##########################################
|
|
|
|
|
|
|
|
all-local: all-perl all-tcl
|
|
|
|
|
|
|
|
check-local: check-perl check-tcl
|
|
|
|
clean-local: clean-perl clean-tcl
|
|
|
|
distclean-local: distclean-perl distclean-tcl
|
|
|
|
distcheck-local: distcheck-perl
|
|
|
|
install-exec-local: install-perl install-tcl
|
|
|
|
|
|
|
|
|
2002-09-08 22:31:01 +00:00
|
|
|
|
2002-11-13 20:39:07 +00:00
|
|
|
rig.swg: $(top_srcdir)/include/hamlib/rig.h $(top_srcdir)/include/hamlib/riglist.h
|
|
|
|
rotator.swg: $(top_srcdir)/include/hamlib/rotator.h $(top_srcdir)/include/hamlib/rotlist.h
|
2002-09-08 22:31:01 +00:00
|
|
|
|
|
|
|
hamlib.swg: ignore.swg rig.swg rotator.swg
|
|
|
|
|
2003-04-06 18:43:48 +00:00
|
|
|
|
2002-11-13 20:39:07 +00:00
|
|
|
EXTRA_DIST = hamlib.swg ignore.swg rig.swg rotator.swg \
|
2003-04-06 18:43:48 +00:00
|
|
|
Makefile.PL perltest.pl tcltest.tcl
|
|
|
|
|
|
|
|
BUILT_SOURCES = hamlibperl_wrap.c hamlibtcl_wrap.c
|
|
|
|
|
|
|
|
DISTCLEANFILES = Hamlib-pl.mk Hamlib-pl.mk.old
|
2002-09-08 22:31:01 +00:00
|
|
|
|
2003-04-06 18:43:48 +00:00
|
|
|
CLEANFILES = hamlibperl_wrap.c Hamlib.pm Hamlib.bs \
|
|
|
|
hamlibtcl_wrap.c pkgIndex.tcl
|
2002-10-07 21:44:51 +00:00
|
|
|
|
2002-11-13 20:39:07 +00:00
|
|
|
noinst_SCRIPTS = perltest.pl tcltest.tcl
|