# Makefile for pure data externals in lib creb.
# Needs Makefile.pdlibbuilder to work.

lib.name = creb

# all C and C++ files in subdirs are source files per class
class.sources = $(wildcard modules/*.c modules++/*.cc)

datafiles = \
$(wildcard doc/*-help.pd abs/*.pd) \
creb-meta.pd \
CHANGES.LOG \
COPYING \
README \
TODO


################################################################################
### pdlibbuilder ###############################################################
################################################################################


# Include Makefile.pdlibbuilder from this directory, or else from externals
# root directory in pd-extended configuration.

include $(firstword $(wildcard Makefile.pdlibbuilder ../Makefile.pdlibbuilder))


################################################################################
### creb extra targets #########################################################
################################################################################


# if creb still doesn't have a meta.pd file, create it on the fly

define meta
#N canvas 48 350 450 300 10;\
\n#X text 9 18 AUTHOR Tom Schouten <tom@zwizwa.be>;\
\n#X text 9 42 DESCRIPTION This is a collection of pd externals. My bag of tricks.;\
\n#X text 9 79 LICENSE GNU GPL 2;\
\n#X text 9 105 VERSION 0.9.2;
endef

all: creb-meta.pd

creb-meta.pd: 
	@echo "$(meta)" > creb-meta.pd


# install files with idiosyncratic source/destination paths

install-data: install-creb-extras

install-creb-extras: all
	$(INSTALL_DIR) $(installpath)/manual && \
        $(INSTALL_DATA) doc/reference.txt $(installpath)/manual
	$(INSTALL_DIR) $(installpath)/examples && \
        $(INSTALL_DATA) $(wildcard doc/examples/*.pd) $(installpath)/examples
