aboutsummaryrefslogtreecommitdiff
path: root/Makefile.unix
diff options
context:
space:
mode:
authorflim <flim@google.com>2016-01-26 14:33:44 +0100
committerflim <flim@google.com>2016-03-04 17:40:32 +0100
commitc91ee5b5642fcc4969150f73d5f6848f88bf1638 (patch)
tree900cb39b975dfed729e37e5810fef61fd92d7a70 /Makefile.unix
parent1391dbf0ccd121ce7a49d30e2142d36c8d404990 (diff)
downloadlibopus-c91ee5b5642fcc4969150f73d5f6848f88bf1638.tar.gz
Change-Id: I8211751bab026ab236a612c6e0873f8bdbcd6c98
Diffstat (limited to 'Makefile.unix')
-rw-r--r--Makefile.unix38
1 files changed, 35 insertions, 3 deletions
diff --git a/Makefile.unix b/Makefile.unix
index 36fd3372..b13230e8 100644
--- a/Makefile.unix
+++ b/Makefile.unix
@@ -91,20 +91,49 @@ OBJS := $(patsubst %.c,%$(OBJSUFFIX),$(SRCS_C))
OPUSDEMO_SRCS_C = src/opus_demo.c
OPUSDEMO_OBJS := $(patsubst %.c,%$(OBJSUFFIX),$(OPUSDEMO_SRCS_C))
+TESTOPUSAPI_SRCS_C = tests/test_opus_api.c
+TESTOPUSAPI_OBJS := $(patsubst %.c,%$(OBJSUFFIX),$(TESTOPUSAPI_SRCS_C))
+
+TESTOPUSDECODE_SRCS_C = tests/test_opus_decode.c
+TESTOPUSDECODE_OBJS := $(patsubst %.c,%$(OBJSUFFIX),$(TESTOPUSDECODE_SRCS_C))
+
+TESTOPUSENCODE_SRCS_C = tests/test_opus_encode.c
+TESTOPUSENCODE_OBJS := $(patsubst %.c,%$(OBJSUFFIX),$(TESTOPUSENCODE_SRCS_C))
+
+TESTOPUSPADDING_SRCS_C = tests/test_opus_padding.c
+TESTOPUSPADDING_OBJS := $(patsubst %.c,%$(OBJSUFFIX),$(TESTOPUSPADDING_SRCS_C))
+
OPUSCOMPARE_SRCS_C = src/opus_compare.c
OPUSCOMPARE_OBJS := $(patsubst %.c,%$(OBJSUFFIX),$(OPUSCOMPARE_SRCS_C))
+TESTS := test_opus_api test_opus_decode test_opus_encode test_opus_padding
+
# Rules
-all: lib opus_demo opus_compare
+all: lib opus_demo opus_compare $(TESTS)
lib: $(TARGET)
+check: all
+ for test in $(TESTS); do ./$$test; done
+
$(TARGET): $(OBJS)
$(ARCHIVE.cmdline)
opus_demo$(EXESUFFIX): $(OPUSDEMO_OBJS) $(TARGET)
$(LINK.o.cmdline)
+test_opus_api$(EXESUFFIX): $(TESTOPUSAPI_OBJS) $(TARGET)
+ $(LINK.o.cmdline)
+
+test_opus_decode$(EXESUFFIX): $(TESTOPUSDECODE_OBJS) $(TARGET)
+ $(LINK.o.cmdline)
+
+test_opus_encode$(EXESUFFIX): $(TESTOPUSENCODE_OBJS) $(TARGET)
+ $(LINK.o.cmdline)
+
+test_opus_padding$(EXESUFFIX): $(TESTOPUSPADDING_OBJS) $(TARGET)
+ $(LINK.o.cmdline)
+
opus_compare$(EXESUFFIX): $(OPUSCOMPARE_OBJS)
$(LINK.o.cmdline)
@@ -122,6 +151,9 @@ force:
clean:
rm -f opus_demo$(EXESUFFIX) opus_compare$(EXESUFFIX) $(TARGET) \
- $(OBJS) $(OPUSDEMO_OBJS) $(OPUSCOMPARE_OBJS)
+ test_opus_api$(EXESUFFIX) test_opus_decode$(EXESUFFIX) \
+ test_opus_encode$(EXESUFFIX) test_opus_padding$(EXESUFFIX) \
+ $(OBJS) $(OPUSDEMO_OBJS) $(OPUSCOMPARE_OBJS) $(TESTOPUSAPI_OBJS) \
+ $(TESTOPUSDECODE_OBJS) $(TESTOPUSENCODE_OBJS) $(TESTOPUSPADDING_OBJS)
-.PHONY: all lib clean
+.PHONY: all lib clean force check