tests/Makefile

Mon, 01 Jan 2024 16:42:37 +0100

author
Mike Becker <universe@uap-core.de>
date
Mon, 01 Jan 2024 16:42:37 +0100
changeset 789
9b2f5661bebd
parent 787
d0f02310aa47
child 798
7644da6e2d35
permissions
-rw-r--r--

begin migration of buffer tests - relates to #342

universe@753 1 # Copyright 2023 Mike Becker. All rights reserved.
universe@753 2 #
universe@753 3 # Redistribution and use in source and binary forms, with or without
universe@753 4 # modification, are permitted provided that the following conditions are met:
universe@753 5 #
universe@753 6 # 1. Redistributions of source code must retain the above copyright
universe@753 7 # notice, this list of conditions and the following disclaimer.
universe@753 8 #
universe@753 9 # 2. Redistributions in binary form must reproduce the above copyright
universe@753 10 # notice, this list of conditions and the following disclaimer in the
universe@753 11 # documentation and/or other materials provided with the distribution.
universe@753 12 #
universe@753 13 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
universe@753 14 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
universe@753 15 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
universe@753 16 # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
universe@753 17 # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
universe@753 18 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
universe@753 19 # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
universe@753 20 # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
universe@753 21 # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
universe@753 22 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
universe@753 23
universe@753 24 include ../config.mk
universe@753 25
universe@777 26 CFLAGS += -I../src -Wno-clobbered
universe@766 27
universe@754 28 TEST_DIR=$(build_dir)/tests
universe@753 29
universe@782 30 SRC = util_allocator.c test_utils.c test_hash_key.c test_allocator.c \
universe@789 31 test_compare.c test_string.c test_buffer.c \
universe@789 32 test_printf.c test_mempool.c test_hash_map.c ucxtest.c
universe@753 33
universe@766 34 OBJ_EXT=.o
universe@766 35 OBJ=$(SRC:%.c=$(TEST_DIR)/%$(OBJ_EXT))
universe@766 36
universe@766 37 all: $(TEST_DIR) $(TEST_DIR)/ucxtest
universe@766 38
universe@767 39 $(TEST_DIR)/ucxtest: $(OBJ) $(build_dir)/libucx_static.a
universe@773 40 $(CC) -o $@ $(LDFLAGS) $+
universe@766 41
universe@766 42 $(build_dir)/libucx_static.a:
universe@766 43 test -f "$@"
universe@753 44
universe@753 45 $(TEST_DIR):
universe@766 46 $(MKDIR) $@
universe@766 47
universe@766 48 FORCE:
universe@766 49
universe@782 50 $(TEST_DIR)/test_allocator$(OBJ_EXT): test_allocator.c ../src/cx/test.h \
universe@782 51 ../src/cx/allocator.h ../src/cx/common.h
universe@782 52 @echo "Compiling $<"
universe@782 53 $(CC) -o $@ $(CFLAGS) -c $<
universe@782 54
universe@789 55 $(TEST_DIR)/test_buffer$(OBJ_EXT): test_buffer.c ../src/cx/test.h \
universe@789 56 ../src/cx/buffer.h ../src/cx/common.h ../src/cx/allocator.h
universe@789 57 @echo "Compiling $<"
universe@789 58 $(CC) -o $@ $(CFLAGS) -c $<
universe@789 59
universe@787 60 $(TEST_DIR)/test_compare$(OBJ_EXT): test_compare.c ../src/cx/test.h \
universe@787 61 ../src/cx/compare.h ../src/cx/common.h
universe@787 62 @echo "Compiling $<"
universe@787 63 $(CC) -o $@ $(CFLAGS) -c $<
universe@787 64
universe@768 65 $(TEST_DIR)/test_hash_key$(OBJ_EXT): test_hash_key.c ../src/cx/test.h \
universe@768 66 ../src/cx/hash_key.h ../src/cx/common.h ../src/cx/string.h \
universe@768 67 ../src/cx/allocator.h
universe@768 68 @echo "Compiling $<"
universe@768 69 $(CC) -o $@ $(CFLAGS) -c $<
universe@768 70
universe@785 71 $(TEST_DIR)/test_hash_map$(OBJ_EXT): test_hash_map.c ../src/cx/test.h \
universe@785 72 util_allocator.h ../src/cx/allocator.h ../src/cx/common.h \
universe@785 73 ../src/cx/hash_map.h ../src/cx/map.h ../src/cx/collection.h \
universe@785 74 ../src/cx/allocator.h ../src/cx/iterator.h ../src/cx/string.h \
universe@785 75 ../src/cx/hash_key.h
universe@766 76 @echo "Compiling $<"
universe@766 77 $(CC) -o $@ $(CFLAGS) -c $<
universe@766 78
universe@781 79 $(TEST_DIR)/test_mempool$(OBJ_EXT): test_mempool.c ../src/cx/test.h \
universe@781 80 util_allocator.h ../src/cx/allocator.h ../src/cx/common.h \
universe@781 81 ../src/cx/mempool.h ../src/cx/allocator.h
universe@781 82 @echo "Compiling $<"
universe@781 83 $(CC) -o $@ $(CFLAGS) -c $<
universe@781 84
universe@780 85 $(TEST_DIR)/test_printf$(OBJ_EXT): test_printf.c ../src/cx/test.h \
universe@780 86 util_allocator.h ../src/cx/allocator.h ../src/cx/common.h \
universe@780 87 ../src/cx/printf.h ../src/cx/string.h ../src/cx/allocator.h \
universe@780 88 ../src/cx/buffer.h
universe@780 89 @echo "Compiling $<"
universe@780 90 $(CC) -o $@ $(CFLAGS) -c $<
universe@780 91
universe@778 92 $(TEST_DIR)/test_string$(OBJ_EXT): test_string.c ../src/cx/test.h \
universe@778 93 util_allocator.h ../src/cx/allocator.h ../src/cx/common.h \
universe@778 94 ../src/cx/string.h ../src/cx/allocator.h
universe@777 95 @echo "Compiling $<"
universe@777 96 $(CC) -o $@ $(CFLAGS) -c $<
universe@777 97
universe@767 98 $(TEST_DIR)/test_utils$(OBJ_EXT): test_utils.c ../src/cx/test.h \
universe@767 99 ../src/cx/utils.h ../src/cx/common.h ../src/cx/buffer.h \
universe@767 100 ../src/cx/allocator.h ../src/szmul.c
universe@766 101 @echo "Compiling $<"
universe@766 102 $(CC) -o $@ $(CFLAGS) -c $<
universe@766 103
universe@767 104 $(TEST_DIR)/ucxtest$(OBJ_EXT): ucxtest.c ../src/cx/test.h
universe@766 105 @echo "Compiling $<"
universe@766 106 $(CC) -o $@ $(CFLAGS) -c $<
universe@766 107
universe@770 108 $(TEST_DIR)/util_allocator$(OBJ_EXT): util_allocator.c util_allocator.h \
universe@770 109 ../src/cx/allocator.h ../src/cx/common.h ../src/cx/test.h
universe@770 110 @echo "Compiling $<"
universe@770 111 $(CC) -o $@ $(CFLAGS) -c $<
universe@770 112

mercurial