1PACKAGES       =  clouds/dsp clouds/dsp/pvoc clouds/test stmlib/utils stmlib/dsp clouds
2
3VPATH          = $(PACKAGES)
4
5TARGET         = clouds_test
6BUILD_ROOT     = build/
7BUILD_DIR      = $(BUILD_ROOT)$(TARGET)/
8CC_FILES       = 		atan.cc \
9		clouds_test.cc \
10		correlator.cc \
11		granular_processor.cc \
12		mu_law.cc \
13		random.cc \
14		resources.cc \
15		frame_transformation.cc \
16		phase_vocoder.cc \
17		stft.cc \
18		units.cc
19OBJ_FILES      = $(CC_FILES:.cc=.o)
20OBJS           = $(patsubst %,$(BUILD_DIR)%,$(OBJ_FILES)) $(STARTUP_OBJ)
21DEPS           = $(OBJS:.o=.d)
22DEP_FILE       = $(BUILD_DIR)depends.mk
23
24all:  clouds_test
25
26$(BUILD_DIR):
27	mkdir -p $(BUILD_DIR)
28
29$(BUILD_DIR)%.o: %.cc
30	g++ -c -DTEST -g -Wall -Werror -I. $< -o $@
31
32$(BUILD_DIR)%.d: %.cc
33	g++ -MM -DTEST -I. $< -MF $@ -MT $(@:.d=.o)
34
35clouds_test:  $(OBJS)
36	g++ -o $(TARGET) $(OBJS)
37
38depends:  $(DEPS)
39	cat $(DEPS) > $(DEP_FILE)
40
41$(DEP_FILE):  $(BUILD_DIR) $(DEPS)
42	cat $(DEPS) > $(DEP_FILE)
43
44include $(DEP_FILE)
45