diff --git a/tests/multishared/Makefile b/tests/multishared/Makefile new file mode 100644 index 0000000..745f3a8 --- /dev/null +++ b/tests/multishared/Makefile @@ -0,0 +1,31 @@ +# Makefile to build class 'multishared' for Pure Data. +# Needs Makefile.pdlibbuilder as helper makefile for platform-dependent build +# settings and rules. + +# library name +lib.name = multishared + +# common functions +shared.sources = shared.c + +# input source file (class name == source file basename) +class.sources = multisharedA.c multisharedB.c + +# all extra files to be included in binary distribution of the library +datafiles = multishared-help.pd multishared-meta.pd + +# include Makefile.pdlibbuilder from submodule directory 'pd-lib-builder' +PDLIBBUILDER_DIR=../.. +include $(PDLIBBUILDER_DIR)/Makefile.pdlibbuilder + +# simplistic tests whether all expected files have been produced/installed +buildcheck: all + test -e lib$(lib.name).$(shared.extension) + test -e multisharedA.$(extension) + test -e multisharedB.$(extension) +installcheck: install + test -e $(installpath)/lib$(lib.name).$(shared.extension) + test -e $(installpath)/multisharedA.$(extension) + test -e $(installpath)/multisharedB.$(extension) + test -e $(installpath)/multishared-help.pd + test -e $(installpath)/multishared-meta.pd diff --git a/tests/multishared/multishared-help.pd b/tests/multishared/multishared-help.pd new file mode 100644 index 0000000..da18aed --- /dev/null +++ b/tests/multishared/multishared-help.pd @@ -0,0 +1,7 @@ +#N canvas 335 160 450 300 12; +#X msg 143 93 7; +#X obj 143 125 multisharedA; +#X obj 223 125 multisharedB; +#X msg 223 93 12; +#X connect 0 0 1 0; +#X connect 3 0 2 0; diff --git a/tests/multishared/multishared-meta.pd b/tests/multishared/multishared-meta.pd new file mode 100644 index 0000000..088f750 --- /dev/null +++ b/tests/multishared/multishared-meta.pd @@ -0,0 +1,9 @@ +#N canvas 966 322 200 200 10; +#N canvas 19 51 420 300 META 0; +#X text 10 10 META this is a prototype of a libdir meta file; +#X text 10 51 AUTHOR IOhannes m zmolnig; +#X text 10 110 VERSION 1.0.0; +#X text 10 90 LICENSE CC0; +#X text 10 70 DESCRIPTION Example "multishared" external.; +#X text 10 30 NAME multishared; +#X restore 10 10 pd META; diff --git a/tests/multishared/multishared.h b/tests/multishared/multishared.h new file mode 100644 index 0000000..2e7712a --- /dev/null +++ b/tests/multishared/multishared.h @@ -0,0 +1,3 @@ +#include + +void multishared_foo(t_float f); diff --git a/tests/multishared/multisharedA.c b/tests/multishared/multisharedA.c new file mode 100644 index 0000000..9e8ae57 --- /dev/null +++ b/tests/multishared/multisharedA.c @@ -0,0 +1,14 @@ +#include "multishared.h" +t_class*multisharedA_class; +static void multisharedA_float(t_object*x, t_float f1) { + pd_error(x, "%s got %f", __FUNCTION__, f1); + multishared_foo(f1); +} +static void*multisharedA_new(void) { + return pd_new(multisharedA_class); +} +void multisharedA_setup(void) { + post("%s", __FUNCTION__); + multisharedA_class = class_new(gensym("multisharedA"), multisharedA_new, 0, sizeof(t_object), 0, A_NULL); + class_addfloat(multisharedA_class, multisharedA_float); +} diff --git a/tests/multishared/multisharedB.c b/tests/multishared/multisharedB.c new file mode 100644 index 0000000..ca7b669 --- /dev/null +++ b/tests/multishared/multisharedB.c @@ -0,0 +1,14 @@ +#include "multishared.h" +t_class*multisharedB_class; +static void multisharedB_float(t_object*x, t_float f1) { + pd_error(x, "%s got %f", __FUNCTION__, f1); + multishared_foo(f1); +} +static void*multisharedB_new(void) { + return pd_new(multisharedB_class); +} +void multisharedB_setup(void) { + post("%s", __FUNCTION__); + multisharedB_class = class_new(gensym("multisharedB"), multisharedB_new, 0, sizeof(t_object), 0, A_NULL); + class_addfloat(multisharedB_class, multisharedB_float); +} diff --git a/tests/multishared/shared.c b/tests/multishared/shared.c new file mode 100644 index 0000000..47284a2 --- /dev/null +++ b/tests/multishared/shared.c @@ -0,0 +1,5 @@ +#include "multishared.h" + +void multishared_foo(t_float f) { + post("%s(%f)", __FUNCTION__, f); +}