summaryrefslogtreecommitdiff
path: root/test/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'test/Makefile')
-rw-r--r--test/Makefile16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/Makefile b/test/Makefile
new file mode 100644
index 0000000..7a37dfe
--- /dev/null
+++ b/test/Makefile
@@ -0,0 +1,16 @@
+SRCS := $(wildcard *_test.c)
+OBJS := $(patsubst %_test.c, %_test.o, $(SRCS))
+CFLAGS := -I../src
+TESTS := $(patsubst %_test.c, %_test, $(SRCS))
+EXEC_TESTS := $(patsubst %_test, ./%_test, $(TESTS))
+
+.PHONY: all
+all: munit.o $(TESTS)
+ $(EXEC_TESTS)
+
+.PHONY: clean
+clean:
+ $(RM) *.o *_test
+
+string_view_test: munit.o string_view_test.o ../build/string_view.o
+ $(CC) $? $(CFLAGS) -o $@