#!/usr/bin/make -f
# Makefile to the 'iem_tab' library for Pure Data.
# Needs Makefile.pdlibbuilder as helper makefile for platform-dependent build
# settings and rules (https://github.com/pure-data/pd-lib-builder).

lib.name = iem_tab

## iemlib.h lives in include/
cflags  = -Iinclude

# special file that does not provide a class
lib.setup.sources = src/$(lib.name).c

# all other C and C++ files in subdirs are source files per class
# (alternatively, enumerate them by hand)
# class.sources = $(filter-out $(lib.setup.sources),$(wildcard src/*.c))

class.sources = \
	src/tab_abs.c \
	src/tab_add.c \
	src/tab_add_scalar.c \
	src/tab_carth2polar.c \
	src/tab_complex_inv.c \
	src/tab_complex_mul.c \
	src/tab_const.c \
	src/tab_conv.c \
	src/tab_copy.c \
	src/tab_counter.c \
	src/tab_cross_corr.c \
	src/tab_dbtorms.c \
	src/tab_dbtopow.c \
	src/tab_div.c \
	src/tab_eq.c \
	src/tab_eq_scalar.c \
	src/tab_fft.c \
	src/tab_find_exact_peaks.c \
	src/tab_find_peaks.c \
	src/tab_ge.c \
	src/tab_ge_scalar.c \
	src/tab_gt.c \
	src/tab_gt_scalar.c \
	src/tab_get_size.c \
	src/tab_ifft.c \
	src/tab_le.c \
	src/tab_le_scalar.c \
	src/tab_lt.c \
	src/tab_lt_scalar.c \
	src/tab_max_index.c \
	src/tab_min_index.c \
	src/tab_min_max.c \
	src/tab_mul.c \
	src/tab_mul_scalar.c \
	src/tab_ne.c \
	src/tab_ne_scalar.c \
	src/tab_powtodb.c \
	src/tab_reverse.c \
	src/tab_rmstodb.c \
	src/tab_rfft.c \
	src/tab_rifft.c \
	src/tab_sqrt.c \
	src/tab_sub.c \
	src/tab_sum.c \
	$(empty)

datafiles = \
	$(wildcard *.txt) \
	$(wildcard *.pdf) \
	$(wildcard *.pd) \
	$(wildcard *.gif) \
	$(wildcard *.bat) \
	$(wildcard *.sh) \
	$(wildcard *.wav) \
	$(empty)


#cflags = -DVERSION=$(shell cat VERSION.txt)

## build a multi-object library
make-lib-executable=yes

## suppress "unused" warnings
#suppress-wunused=yes

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

# This Makefile is based on the Makefile from pd-lib-builder written by
# Katja Vetter. You can get it from:
# https://github.com/pure-data/pd-lib-builder
PDLIBBUILDER_DIR=pd-lib-builder/
include $(firstword $(wildcard $(PDLIBBUILDER_DIR)/Makefile.pdlibbuilder Makefile.pdlibbuilder))
