tests/Makefile

Wed, 20 Dec 2023 16:46:14 +0100

author
Mike Becker <universe@uap-core.de>
date
Wed, 20 Dec 2023 16:46:14 +0100
changeset 766
e59b76889f00
parent 756
0b635553b86a
child 767
d31f4d4075dc
permissions
-rw-r--r--

bring back UCX test - fixes #341

     1 # Copyright 2023 Mike Becker. All rights reserved.
     2 #
     3 # Redistribution and use in source and binary forms, with or without
     4 # modification, are permitted provided that the following conditions are met:
     5 #
     6 # 1. Redistributions of source code must retain the above copyright
     7 # notice, this list of conditions and the following disclaimer.
     8 #
     9 # 2. Redistributions in binary form must reproduce the above copyright
    10 # notice, this list of conditions and the following disclaimer in the
    11 # documentation and/or other materials provided with the distribution.
    12 #
    13 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    14 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    15 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    16 # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
    17 # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
    18 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
    19 # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
    20 # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    21 # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    22 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    24 include ../config.mk
    26 CFLAGS += -I../src
    28 TEST_DIR=$(build_dir)/tests
    30 SRC = test_utils.c ucxtest.o
    32 OBJ_EXT=.o
    33 OBJ=$(SRC:%.c=$(TEST_DIR)/%$(OBJ_EXT))
    35 all: $(TEST_DIR) $(TEST_DIR)/ucxtest
    37 $(TEST_DIR)/ucxtest: $(build_dir)/libucx_static.a $(OBJ)
    38 	$(CC) -o $@ $+
    40 $(build_dir)/libucx_static.a:
    41 	test -f "$@"
    43 $(TEST_DIR):
    44 	$(MKDIR) $@
    46 FORCE:
    48 $(TEST_DIR)/test_map_generics$(OBJ_EXT): test_map_generics.c \
    49  test_map_generics.h ../src/cx/map.h ../src/cx/common.h \
    50  ../src/cx/collection.h ../src/cx/allocator.h ../src/cx/iterator.h \
    51  ../src/cx/string.h ../src/cx/hash_key.h ../src/cx/hash_map.h \
    52  ../src/cx/map.h
    53 	@echo "Compiling $<"
    54 	$(CC) -o $@ $(CFLAGS) -c $<
    56 $(TEST_DIR)/test_utils$(OBJ_EXT): test_utils.c test_utils.h \
    57  ../src/cx/test.h
    58 	@echo "Compiling $<"
    59 	$(CC) -o $@ $(CFLAGS) -c $<
    61 $(TEST_DIR)/ucxtest$(OBJ_EXT): ucxtest.c test_utils.h ../src/cx/test.h
    62 	@echo "Compiling $<"
    63 	$(CC) -o $@ $(CFLAGS) -c $<

mercurial