tests/Makefile

Sat, 30 Dec 2023 18:48:25 +0100

author
Mike Becker <universe@uap-core.de>
date
Sat, 30 Dec 2023 18:48:25 +0100
changeset 785
bb18daa62d5f
parent 782
74d777455e96
child 787
d0f02310aa47
permissions
-rw-r--r--

migrate map 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@785 31 test_string.c test_printf.c test_mempool.c test_hash_map.c ucxtest.c
universe@753 32
universe@766 33 OBJ_EXT=.o
universe@766 34 OBJ=$(SRC:%.c=$(TEST_DIR)/%$(OBJ_EXT))
universe@766 35
universe@766 36 all: $(TEST_DIR) $(TEST_DIR)/ucxtest
universe@766 37
universe@767 38 $(TEST_DIR)/ucxtest: $(OBJ) $(build_dir)/libucx_static.a
universe@773 39 $(CC) -o $@ $(LDFLAGS) $+
universe@766 40
universe@766 41 $(build_dir)/libucx_static.a:
universe@766 42 test -f "$@"
universe@753 43
universe@753 44 $(TEST_DIR):
universe@766 45 $(MKDIR) $@
universe@766 46
universe@766 47 FORCE:
universe@766 48
universe@782 49 $(TEST_DIR)/test_allocator$(OBJ_EXT): test_allocator.c ../src/cx/test.h \
universe@782 50 ../src/cx/allocator.h ../src/cx/common.h
universe@782 51 @echo "Compiling $<"
universe@782 52 $(CC) -o $@ $(CFLAGS) -c $<
universe@782 53
universe@768 54 $(TEST_DIR)/test_hash_key$(OBJ_EXT): test_hash_key.c ../src/cx/test.h \
universe@768 55 ../src/cx/hash_key.h ../src/cx/common.h ../src/cx/string.h \
universe@768 56 ../src/cx/allocator.h
universe@768 57 @echo "Compiling $<"
universe@768 58 $(CC) -o $@ $(CFLAGS) -c $<
universe@768 59
universe@785 60 $(TEST_DIR)/test_hash_map$(OBJ_EXT): test_hash_map.c ../src/cx/test.h \
universe@785 61 util_allocator.h ../src/cx/allocator.h ../src/cx/common.h \
universe@785 62 ../src/cx/hash_map.h ../src/cx/map.h ../src/cx/collection.h \
universe@785 63 ../src/cx/allocator.h ../src/cx/iterator.h ../src/cx/string.h \
universe@785 64 ../src/cx/hash_key.h
universe@766 65 @echo "Compiling $<"
universe@766 66 $(CC) -o $@ $(CFLAGS) -c $<
universe@766 67
universe@781 68 $(TEST_DIR)/test_mempool$(OBJ_EXT): test_mempool.c ../src/cx/test.h \
universe@781 69 util_allocator.h ../src/cx/allocator.h ../src/cx/common.h \
universe@781 70 ../src/cx/mempool.h ../src/cx/allocator.h
universe@781 71 @echo "Compiling $<"
universe@781 72 $(CC) -o $@ $(CFLAGS) -c $<
universe@781 73
universe@780 74 $(TEST_DIR)/test_printf$(OBJ_EXT): test_printf.c ../src/cx/test.h \
universe@780 75 util_allocator.h ../src/cx/allocator.h ../src/cx/common.h \
universe@780 76 ../src/cx/printf.h ../src/cx/string.h ../src/cx/allocator.h \
universe@780 77 ../src/cx/buffer.h
universe@780 78 @echo "Compiling $<"
universe@780 79 $(CC) -o $@ $(CFLAGS) -c $<
universe@780 80
universe@778 81 $(TEST_DIR)/test_string$(OBJ_EXT): test_string.c ../src/cx/test.h \
universe@778 82 util_allocator.h ../src/cx/allocator.h ../src/cx/common.h \
universe@778 83 ../src/cx/string.h ../src/cx/allocator.h
universe@777 84 @echo "Compiling $<"
universe@777 85 $(CC) -o $@ $(CFLAGS) -c $<
universe@777 86
universe@767 87 $(TEST_DIR)/test_utils$(OBJ_EXT): test_utils.c ../src/cx/test.h \
universe@767 88 ../src/cx/utils.h ../src/cx/common.h ../src/cx/buffer.h \
universe@767 89 ../src/cx/allocator.h ../src/szmul.c
universe@766 90 @echo "Compiling $<"
universe@766 91 $(CC) -o $@ $(CFLAGS) -c $<
universe@766 92
universe@767 93 $(TEST_DIR)/ucxtest$(OBJ_EXT): ucxtest.c ../src/cx/test.h
universe@766 94 @echo "Compiling $<"
universe@766 95 $(CC) -o $@ $(CFLAGS) -c $<
universe@766 96
universe@770 97 $(TEST_DIR)/util_allocator$(OBJ_EXT): util_allocator.c util_allocator.h \
universe@770 98 ../src/cx/allocator.h ../src/cx/common.h ../src/cx/test.h
universe@770 99 @echo "Compiling $<"
universe@770 100 $(CC) -o $@ $(CFLAGS) -c $<
universe@770 101

mercurial