summaryrefslogtreecommitdiffhomepage
path: root/auto/make
diff options
context:
space:
mode:
Diffstat (limited to 'auto/make')
-rw-r--r--auto/make29
1 files changed, 27 insertions, 2 deletions
diff --git a/auto/make b/auto/make
index 9af63c97..121d575b 100644
--- a/auto/make
+++ b/auto/make
@@ -54,6 +54,18 @@ done
$echo >> $NXT_MAKEFILE
+$echo "NXT_LIB_UNIT_OBJS = \\" >> $NXT_MAKEFILE
+$echo " $NXT_BUILD_DIR/src/nxt_lvlhsh.o \\" >> $NXT_MAKEFILE
+$echo " $NXT_BUILD_DIR/src/nxt_murmur_hash.o \\" >> $NXT_MAKEFILE
+
+for nxt_src in $NXT_LIB_UNIT_SRCS
+do
+ nxt_obj=${nxt_src%.c}.o
+ $echo " $NXT_BUILD_DIR/$nxt_obj \\" >> $NXT_MAKEFILE
+done
+
+$echo >> $NXT_MAKEFILE
+
# Shared and static library.
@@ -70,12 +82,17 @@ $NXT_BUILD_DIR/$NXT_LIB_STATIC: \$(NXT_LIB_OBJS)
$NXT_STATIC_LINK $NXT_BUILD_DIR/$NXT_LIB_STATIC \\
\$(NXT_LIB_OBJS)
+$NXT_BUILD_DIR/$NXT_LIB_UNIT_STATIC: \$(NXT_LIB_UNIT_OBJS)
+ $NXT_STATIC_LINK $NXT_BUILD_DIR/$NXT_LIB_UNIT_STATIC \\
+ \$(NXT_LIB_UNIT_OBJS)
+
END
# Object files.
-for nxt_src in $NXT_LIB_SRCS $NXT_TEST_SRCS
+for nxt_src in $NXT_LIB_SRCS $NXT_TEST_SRCS $NXT_LIB_UNIT_SRCS \
+ src/test/nxt_unit_app_test.c
do
nxt_obj=${nxt_src%.c}.o
nxt_dep=${nxt_src%.c}.dep
@@ -129,6 +146,13 @@ $NXT_BUILD_DIR/utf8_file_name_test: $NXT_LIB_UTF8_FILE_NAME_TEST_SRCS \\
$NXT_BUILD_DIR/$NXT_LIB_STATIC \\
$NXT_LD_OPT $NXT_LIBM $NXT_LIBS
+$NXT_BUILD_DIR/unit_app_test: $NXT_BUILD_DIR/src/test/nxt_unit_app_test.o \\
+ $NXT_BUILD_DIR/$NXT_LIB_UNIT_STATIC
+ \$(NXT_EXEC_LINK) -o $NXT_BUILD_DIR/unit_app_test \\
+ \$(CFLAGS) $NXT_BUILD_DIR/src/test/nxt_unit_app_test.o \\
+ $NXT_BUILD_DIR/$NXT_LIB_UNIT_STATIC \\
+ $NXT_LD_OPT $NXT_LIBM $NXT_LIBS $NXT_LIB_AUX_LIBS
+
END
@@ -241,7 +265,8 @@ cat << END > Makefile
include $NXT_MAKEFILE
.PHONY: tests
-tests: $NXT_BUILD_DIR/tests $NXT_BUILD_DIR/utf8_file_name_test
+tests: $NXT_BUILD_DIR/tests $NXT_BUILD_DIR/utf8_file_name_test \\
+ $NXT_BUILD_DIR/unit_app_test
.PHONY: clean
clean: