aboutsummaryrefslogtreecommitdiff
path: root/test/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'test/Makefile')
-rw-r--r--test/Makefile35
1 files changed, 35 insertions, 0 deletions
diff --git a/test/Makefile b/test/Makefile
new file mode 100644
index 0000000..fec56d9
--- /dev/null
+++ b/test/Makefile
@@ -0,0 +1,35 @@
+# See LICENSE file for copyright and license details.
+
+CC = cc
+SRC != find * -name '*.c'
+OBJ = ${SRC:.c=.o}
+
+LIBNAME = str2
+SHARED = ../lib${LIBNAME}.so
+
+#WARNINGS = -Wall -Werror -pedantic
+STANDARD = -std=c99
+CFLAGS = ${WARNINGS} -I../src/
+LFLAGS = -l${LIBNAME} -L../ -Wl,-rpath=../
+
+NAME = test1
+
+all: ${SHARED} ${NAME}
+ @echo
+ @echo '+-----------------+'
+ @echo '| Executing tests |'
+ @echo '+-----------------+'
+ @echo
+ ./${NAME}
+
+${SHARED}:
+ @make -C ..
+
+.c.o:
+ ${CC} ${CFLAGS} -c $< -o $@
+
+${NAME}: ${OBJ}
+ ${CC} ${LFLAGS} -o $@ ${OBJ}
+
+clean:
+ rm -f ${OBJ} ${NAME} *.core