tests/Makefile

Thu, 23 May 2024 20:43:04 +0200

author
Mike Becker <universe@uap-core.de>
date
Thu, 23 May 2024 20:43:04 +0200
changeset 856
6bbbf219251d
parent 854
fe0d69d72bcd
permissions
-rw-r--r--

fix name of collection base member (to avoid base.base)

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@814 26 CFLAGS += -I../src
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@850 31 test_compare.c test_string.c test_buffer.c test_iterator.c \
universe@850 32 test_list.c test_tree.c test_hash_map.c \
universe@850 33 test_printf.c test_mempool.c ucxtest.c
universe@753 34
universe@766 35 OBJ_EXT=.o
universe@766 36 OBJ=$(SRC:%.c=$(TEST_DIR)/%$(OBJ_EXT))
universe@766 37
universe@766 38 all: $(TEST_DIR) $(TEST_DIR)/ucxtest
universe@766 39
universe@767 40 $(TEST_DIR)/ucxtest: $(OBJ) $(build_dir)/libucx_static.a
universe@773 41 $(CC) -o $@ $(LDFLAGS) $+
universe@766 42
universe@766 43 $(build_dir)/libucx_static.a:
universe@766 44 test -f "$@"
universe@753 45
universe@753 46 $(TEST_DIR):
universe@766 47 $(MKDIR) $@
universe@766 48
universe@766 49 FORCE:
universe@766 50
universe@782 51 $(TEST_DIR)/test_allocator$(OBJ_EXT): test_allocator.c ../src/cx/test.h \
universe@782 52 ../src/cx/allocator.h ../src/cx/common.h
universe@782 53 @echo "Compiling $<"
universe@782 54 $(CC) -o $@ $(CFLAGS) -c $<
universe@782 55
universe@789 56 $(TEST_DIR)/test_buffer$(OBJ_EXT): test_buffer.c ../src/cx/test.h \
universe@798 57 util_allocator.h ../src/cx/allocator.h ../src/cx/common.h \
universe@798 58 ../src/cx/buffer.h ../src/cx/allocator.h
universe@789 59 @echo "Compiling $<"
universe@789 60 $(CC) -o $@ $(CFLAGS) -c $<
universe@789 61
universe@787 62 $(TEST_DIR)/test_compare$(OBJ_EXT): test_compare.c ../src/cx/test.h \
universe@787 63 ../src/cx/compare.h ../src/cx/common.h
universe@787 64 @echo "Compiling $<"
universe@787 65 $(CC) -o $@ $(CFLAGS) -c $<
universe@787 66
universe@768 67 $(TEST_DIR)/test_hash_key$(OBJ_EXT): test_hash_key.c ../src/cx/test.h \
universe@768 68 ../src/cx/hash_key.h ../src/cx/common.h ../src/cx/string.h \
universe@768 69 ../src/cx/allocator.h
universe@768 70 @echo "Compiling $<"
universe@768 71 $(CC) -o $@ $(CFLAGS) -c $<
universe@768 72
universe@785 73 $(TEST_DIR)/test_hash_map$(OBJ_EXT): test_hash_map.c ../src/cx/test.h \
universe@785 74 util_allocator.h ../src/cx/allocator.h ../src/cx/common.h \
universe@785 75 ../src/cx/hash_map.h ../src/cx/map.h ../src/cx/collection.h \
universe@854 76 ../src/cx/allocator.h ../src/cx/iterator.h ../src/cx/compare.h \
universe@854 77 ../src/cx/string.h ../src/cx/hash_key.h
universe@766 78 @echo "Compiling $<"
universe@766 79 $(CC) -o $@ $(CFLAGS) -c $<
universe@766 80
universe@850 81 $(TEST_DIR)/test_iterator$(OBJ_EXT): test_iterator.c ../src/cx/test.h \
universe@850 82 ../src/cx/iterator.h ../src/cx/common.h
universe@850 83 @echo "Compiling $<"
universe@850 84 $(CC) -o $@ $(CFLAGS) -c $<
universe@850 85
universe@798 86 $(TEST_DIR)/test_list$(OBJ_EXT): test_list.c ../src/cx/test.h \
universe@798 87 util_allocator.h ../src/cx/allocator.h ../src/cx/common.h \
universe@816 88 ../src/cx/compare.h ../src/cx/utils.h ../src/cx/array_list.h \
universe@816 89 ../src/cx/list.h ../src/cx/collection.h ../src/cx/allocator.h \
universe@854 90 ../src/cx/iterator.h ../src/cx/compare.h ../src/cx/linked_list.h
universe@798 91 @echo "Compiling $<"
universe@798 92 $(CC) -o $@ $(CFLAGS) -c $<
universe@798 93
universe@781 94 $(TEST_DIR)/test_mempool$(OBJ_EXT): test_mempool.c ../src/cx/test.h \
universe@781 95 util_allocator.h ../src/cx/allocator.h ../src/cx/common.h \
universe@781 96 ../src/cx/mempool.h ../src/cx/allocator.h
universe@781 97 @echo "Compiling $<"
universe@781 98 $(CC) -o $@ $(CFLAGS) -c $<
universe@781 99
universe@780 100 $(TEST_DIR)/test_printf$(OBJ_EXT): test_printf.c ../src/cx/test.h \
universe@780 101 util_allocator.h ../src/cx/allocator.h ../src/cx/common.h \
universe@780 102 ../src/cx/printf.h ../src/cx/string.h ../src/cx/allocator.h \
universe@780 103 ../src/cx/buffer.h
universe@780 104 @echo "Compiling $<"
universe@780 105 $(CC) -o $@ $(CFLAGS) -c $<
universe@780 106
universe@778 107 $(TEST_DIR)/test_string$(OBJ_EXT): test_string.c ../src/cx/test.h \
universe@778 108 util_allocator.h ../src/cx/allocator.h ../src/cx/common.h \
universe@778 109 ../src/cx/string.h ../src/cx/allocator.h
universe@777 110 @echo "Compiling $<"
universe@777 111 $(CC) -o $@ $(CFLAGS) -c $<
universe@777 112
universe@816 113 $(TEST_DIR)/test_tree$(OBJ_EXT): test_tree.c ../src/cx/tree.h \
universe@846 114 ../src/cx/common.h ../src/cx/iterator.h ../src/cx/test.h \
universe@846 115 util_allocator.h ../src/cx/allocator.h
universe@816 116 @echo "Compiling $<"
universe@816 117 $(CC) -o $@ $(CFLAGS) -c $<
universe@816 118
universe@767 119 $(TEST_DIR)/test_utils$(OBJ_EXT): test_utils.c ../src/cx/test.h \
universe@767 120 ../src/cx/utils.h ../src/cx/common.h ../src/cx/buffer.h \
universe@767 121 ../src/cx/allocator.h ../src/szmul.c
universe@766 122 @echo "Compiling $<"
universe@766 123 $(CC) -o $@ $(CFLAGS) -c $<
universe@766 124
universe@767 125 $(TEST_DIR)/ucxtest$(OBJ_EXT): ucxtest.c ../src/cx/test.h
universe@766 126 @echo "Compiling $<"
universe@766 127 $(CC) -o $@ $(CFLAGS) -c $<
universe@766 128
universe@770 129 $(TEST_DIR)/util_allocator$(OBJ_EXT): util_allocator.c util_allocator.h \
universe@770 130 ../src/cx/allocator.h ../src/cx/common.h ../src/cx/test.h
universe@770 131 @echo "Compiling $<"
universe@770 132 $(CC) -o $@ $(CFLAGS) -c $<
universe@770 133

mercurial