multifor: extended libraries with 'define for<System>'
This commit is contained in:
parent
df62eae454
commit
22d9ae409b
5 changed files with 79 additions and 0 deletions
37
tests/multifor/Makefile
Normal file
37
tests/multifor/Makefile
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
# Makefile to build class 'multifor' for Pure Data.
|
||||||
|
# Needs Makefile.pdlibbuilder as helper makefile for platform-dependent build
|
||||||
|
# settings and rules.
|
||||||
|
|
||||||
|
# library name
|
||||||
|
lib.name = multifor
|
||||||
|
|
||||||
|
# input source file (class name == source file basename)
|
||||||
|
class.sources = multiforA.c
|
||||||
|
|
||||||
|
# additional classes
|
||||||
|
define forLinux
|
||||||
|
class.sources += multiforB.c
|
||||||
|
endef
|
||||||
|
define forDarwin
|
||||||
|
class.sources += multiforB.c
|
||||||
|
endef
|
||||||
|
define forWindows
|
||||||
|
class.sources += multiforB.c
|
||||||
|
endef
|
||||||
|
|
||||||
|
# all extra files to be included in binary distribution of the library
|
||||||
|
datafiles = multifor-help.pd multifor-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 multiforA.$(extension)
|
||||||
|
test -e multiforB.$(extension)
|
||||||
|
installcheck: install
|
||||||
|
test -e $(installpath)/multiforA.$(extension)
|
||||||
|
test -e $(installpath)/multiforB.$(extension)
|
||||||
|
test -e $(installpath)/multifor-help.pd
|
||||||
|
test -e $(installpath)/multifor-meta.pd
|
||||||
7
tests/multifor/multifor-help.pd
Normal file
7
tests/multifor/multifor-help.pd
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
#N canvas 335 160 450 300 12;
|
||||||
|
#X msg 143 93 7;
|
||||||
|
#X obj 143 125 multiforA;
|
||||||
|
#X obj 223 125 multiforB;
|
||||||
|
#X msg 223 93 12;
|
||||||
|
#X connect 0 0 1 0;
|
||||||
|
#X connect 3 0 2 0;
|
||||||
9
tests/multifor/multifor-meta.pd
Normal file
9
tests/multifor/multifor-meta.pd
Normal file
|
|
@ -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 "multifor" external.;
|
||||||
|
#X text 10 30 NAME multifor;
|
||||||
|
#X restore 10 10 pd META;
|
||||||
13
tests/multifor/multiforA.c
Normal file
13
tests/multifor/multiforA.c
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
#include <m_pd.h>
|
||||||
|
t_class*multiforA_class;
|
||||||
|
static void multiforA_float(t_object*x, t_float f1) {
|
||||||
|
pd_error(x, "%s got %f", __FUNCTION__, f1);
|
||||||
|
}
|
||||||
|
static void*multiforA_new(void) {
|
||||||
|
return pd_new(multiforA_class);
|
||||||
|
}
|
||||||
|
void multiforA_setup(void) {
|
||||||
|
post("%s", __FUNCTION__);
|
||||||
|
multiforA_class = class_new(gensym("multiforA"), multiforA_new, 0, sizeof(t_object), 0, A_NULL);
|
||||||
|
class_addfloat(multiforA_class, multiforA_float);
|
||||||
|
}
|
||||||
13
tests/multifor/multiforB.c
Normal file
13
tests/multifor/multiforB.c
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
#include <m_pd.h>
|
||||||
|
t_class*multiforB_class;
|
||||||
|
static void multiforB_float(t_object*x, t_float f1) {
|
||||||
|
pd_error(x, "%s got %f", __FUNCTION__, f1);
|
||||||
|
}
|
||||||
|
static void*multiforB_new(void) {
|
||||||
|
return pd_new(multiforB_class);
|
||||||
|
}
|
||||||
|
void multiforB_setup(void) {
|
||||||
|
post("%s", __FUNCTION__);
|
||||||
|
multiforB_class = class_new(gensym("multiforB"), multiforB_new, 0, sizeof(t_object), 0, A_NULL);
|
||||||
|
class_addfloat(multiforB_class, multiforB_float);
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue