test-case for sources in subdirs
This commit is contained in:
parent
b96e3692e0
commit
9bd01a2f41
7 changed files with 78 additions and 0 deletions
27
tests/subdir/Makefile
Normal file
27
tests/subdir/Makefile
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
# Makefile to build class 'subdir' for Pure Data.
|
||||||
|
# Needs Makefile.pdlibbuilder as helper makefile for platform-dependent build
|
||||||
|
# settings and rules.
|
||||||
|
|
||||||
|
# library name
|
||||||
|
lib.name = subdir
|
||||||
|
|
||||||
|
# input source file (class name == source file basename)
|
||||||
|
class.sources = src/subdir.c src/subdir~.c
|
||||||
|
|
||||||
|
# all extra files to be included in binary distribution of the library
|
||||||
|
datafiles = subdir-help.pd subdir-meta.pd
|
||||||
|
|
||||||
|
# include Makefile.pdlibbuilder
|
||||||
|
# (for real-world projects see the "Project Management" section
|
||||||
|
# in tips-tricks.md)
|
||||||
|
|
||||||
|
PDLIBBUILDER_DIR=../..
|
||||||
|
include $(PDLIBBUILDER_DIR)/Makefile.pdlibbuilder
|
||||||
|
cflags+=-DYYY
|
||||||
|
|
||||||
|
|
||||||
|
# simplistic tests whether all expected files have been produced/installed
|
||||||
|
#buildcheck: all
|
||||||
|
# test -e subdir.$(extension)
|
||||||
|
#installcheck: install
|
||||||
|
# test -e $(installpath)/subdir.$(extension)
|
||||||
8
tests/subdir/README.md
Normal file
8
tests/subdir/README.md
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
subdir
|
||||||
|
======
|
||||||
|
|
||||||
|
pd-lib-builder project that shows how to compile
|
||||||
|
a library that contains a single C-file in a separate src/ directory,
|
||||||
|
that is compiled into a single binary containing a subdir Pd-objectclass.
|
||||||
|
|
||||||
|
this is a special case of the one-object-per-binary library structure.
|
||||||
13
tests/subdir/src/subdir.c
Normal file
13
tests/subdir/src/subdir.c
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
#include <m_pd.h>
|
||||||
|
t_class*subdir_class;
|
||||||
|
static void subdir_float(t_object*x, t_float f1) {
|
||||||
|
pd_error(x, "%s got %f", __FUNCTION__, f1);
|
||||||
|
}
|
||||||
|
static void*subdir_new(void) {
|
||||||
|
return pd_new(subdir_class);
|
||||||
|
}
|
||||||
|
void subdir_setup(void) {
|
||||||
|
post("%s", __FUNCTION__);
|
||||||
|
subdir_class = class_new(gensym("subdir"), subdir_new, 0, sizeof(t_object), 0, A_NULL);
|
||||||
|
class_addfloat(subdir_class, subdir_float);
|
||||||
|
}
|
||||||
13
tests/subdir/src/subdir~.c
Normal file
13
tests/subdir/src/subdir~.c
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
#include <m_pd.h>
|
||||||
|
t_class*subdir_tilde_class;
|
||||||
|
static void subdir_tilde_float(t_object*x, t_float f1) {
|
||||||
|
pd_error(x, "%s got %f", __FUNCTION__, f1);
|
||||||
|
}
|
||||||
|
static void*subdir_tilde_new(void) {
|
||||||
|
return pd_new(subdir_tilde_class);
|
||||||
|
}
|
||||||
|
void subdir_tilde_setup(void) {
|
||||||
|
post("%s", __FUNCTION__);
|
||||||
|
subdir_tilde_class = class_new(gensym("subdir~"), subdir_tilde_new, 0, sizeof(t_object), 0, A_NULL);
|
||||||
|
class_addfloat(subdir_tilde_class, subdir_tilde_float);
|
||||||
|
}
|
||||||
4
tests/subdir/subdir-help.pd
Normal file
4
tests/subdir/subdir-help.pd
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
#N canvas 335 160 450 300 12;
|
||||||
|
#X obj 143 125 subdir;
|
||||||
|
#X msg 143 93 7;
|
||||||
|
#X connect 1 0 0 0;
|
||||||
9
tests/subdir/subdir-meta.pd
Normal file
9
tests/subdir/subdir-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 "subdir" external.;
|
||||||
|
#X text 10 30 NAME subdir;
|
||||||
|
#X restore 10 10 pd META;
|
||||||
4
tests/subdir/subdir~-help.pd
Normal file
4
tests/subdir/subdir~-help.pd
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
#N canvas 335 160 450 300 12;
|
||||||
|
#X obj 143 125 subdir~;
|
||||||
|
#X msg 143 93 7;
|
||||||
|
#X connect 1 0 0 0;
|
||||||
Loading…
Reference in a new issue