current: all

.SUFFIXES: .d_fat

# PDSOURCE = "/Applications/Pd.app/Contents/Resources/src"
PDSOURCE = "../../../Pd-0.48-1.app/Contents/Resources/src"

PD_INCLUDES = -I. -I$(PDSOURCE)

PD_DEFINES = -DPD

CFLAGS =-O2 -Wall -W -Wshadow -Wstrict-prototypes \
        -Wno-unused -Wno-parentheses -Wno-switch -fPIC

LFLAGS = -bundle -undefined suppress -flat_namespace

ARCH_FLAGS=-arch i386 -arch x86_64

# the sources

SRC =	early_reflections_3d.c \
	early_reflections_2d.c \
	cart2del_damp_2d.c \
	cart2del_damp_3d.c \
	xy_2_del_damp_phi.c \
	xyz_3_del_damp_theta_phi.c \
	n_delay1p_line~.c \
	n_delay2p_line~.c \
	nz~.c \
	block_delay~.c \
	block_lp1~.c \
	block_peak_env~.c \
	iem_roomsim.c



TARGET = iem_roomsim.d_fat


OBJ = $(SRC:.c=.o) 

#
#  ------------------ targets ------------------------------------
#

clean:
	rm -f ../$(TARGET)
	rm -f *.o

all: $(OBJ)
	@echo :: $(OBJ)
	$(CC) $(ARCH_FLAGS) $(LFLAGS) -o $(TARGET) *.o
	strip -S -x $(TARGET)
	mv $(TARGET) ..

$(OBJ) : %.o : %.c
	$(CC) $(ARCH_FLAGS) $(PD_DEFINES) $(CFLAGS) $(PD_INCLUDES) -c -o $*.o $*.c


