universe@753: # Copyright 2023 Mike Becker. All rights reserved. universe@753: # universe@753: # Redistribution and use in source and binary forms, with or without universe@753: # modification, are permitted provided that the following conditions are met: universe@753: # universe@753: # 1. Redistributions of source code must retain the above copyright universe@753: # notice, this list of conditions and the following disclaimer. universe@753: # universe@753: # 2. Redistributions in binary form must reproduce the above copyright universe@753: # notice, this list of conditions and the following disclaimer in the universe@753: # documentation and/or other materials provided with the distribution. universe@753: # universe@753: # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" universe@753: # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE universe@753: # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE universe@753: # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE universe@753: # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL universe@753: # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR universe@753: # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER universe@753: # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, universe@753: # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE universe@753: # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. universe@753: universe@753: include ../config.mk universe@753: universe@777: CFLAGS += -I../src -Wno-clobbered universe@766: universe@754: TEST_DIR=$(build_dir)/tests universe@753: universe@782: SRC = util_allocator.c test_utils.c test_hash_key.c test_allocator.c \ universe@789: test_compare.c test_string.c test_buffer.c \ universe@789: test_printf.c test_mempool.c test_hash_map.c ucxtest.c universe@753: universe@766: OBJ_EXT=.o universe@766: OBJ=$(SRC:%.c=$(TEST_DIR)/%$(OBJ_EXT)) universe@766: universe@766: all: $(TEST_DIR) $(TEST_DIR)/ucxtest universe@766: universe@767: $(TEST_DIR)/ucxtest: $(OBJ) $(build_dir)/libucx_static.a universe@773: $(CC) -o $@ $(LDFLAGS) $+ universe@766: universe@766: $(build_dir)/libucx_static.a: universe@766: test -f "$@" universe@753: universe@753: $(TEST_DIR): universe@766: $(MKDIR) $@ universe@766: universe@766: FORCE: universe@766: universe@782: $(TEST_DIR)/test_allocator$(OBJ_EXT): test_allocator.c ../src/cx/test.h \ universe@782: ../src/cx/allocator.h ../src/cx/common.h universe@782: @echo "Compiling $<" universe@782: $(CC) -o $@ $(CFLAGS) -c $< universe@782: universe@789: $(TEST_DIR)/test_buffer$(OBJ_EXT): test_buffer.c ../src/cx/test.h \ universe@789: ../src/cx/buffer.h ../src/cx/common.h ../src/cx/allocator.h universe@789: @echo "Compiling $<" universe@789: $(CC) -o $@ $(CFLAGS) -c $< universe@789: universe@787: $(TEST_DIR)/test_compare$(OBJ_EXT): test_compare.c ../src/cx/test.h \ universe@787: ../src/cx/compare.h ../src/cx/common.h universe@787: @echo "Compiling $<" universe@787: $(CC) -o $@ $(CFLAGS) -c $< universe@787: universe@768: $(TEST_DIR)/test_hash_key$(OBJ_EXT): test_hash_key.c ../src/cx/test.h \ universe@768: ../src/cx/hash_key.h ../src/cx/common.h ../src/cx/string.h \ universe@768: ../src/cx/allocator.h universe@768: @echo "Compiling $<" universe@768: $(CC) -o $@ $(CFLAGS) -c $< universe@768: universe@785: $(TEST_DIR)/test_hash_map$(OBJ_EXT): test_hash_map.c ../src/cx/test.h \ universe@785: util_allocator.h ../src/cx/allocator.h ../src/cx/common.h \ universe@785: ../src/cx/hash_map.h ../src/cx/map.h ../src/cx/collection.h \ universe@785: ../src/cx/allocator.h ../src/cx/iterator.h ../src/cx/string.h \ universe@785: ../src/cx/hash_key.h universe@766: @echo "Compiling $<" universe@766: $(CC) -o $@ $(CFLAGS) -c $< universe@766: universe@781: $(TEST_DIR)/test_mempool$(OBJ_EXT): test_mempool.c ../src/cx/test.h \ universe@781: util_allocator.h ../src/cx/allocator.h ../src/cx/common.h \ universe@781: ../src/cx/mempool.h ../src/cx/allocator.h universe@781: @echo "Compiling $<" universe@781: $(CC) -o $@ $(CFLAGS) -c $< universe@781: universe@780: $(TEST_DIR)/test_printf$(OBJ_EXT): test_printf.c ../src/cx/test.h \ universe@780: util_allocator.h ../src/cx/allocator.h ../src/cx/common.h \ universe@780: ../src/cx/printf.h ../src/cx/string.h ../src/cx/allocator.h \ universe@780: ../src/cx/buffer.h universe@780: @echo "Compiling $<" universe@780: $(CC) -o $@ $(CFLAGS) -c $< universe@780: universe@778: $(TEST_DIR)/test_string$(OBJ_EXT): test_string.c ../src/cx/test.h \ universe@778: util_allocator.h ../src/cx/allocator.h ../src/cx/common.h \ universe@778: ../src/cx/string.h ../src/cx/allocator.h universe@777: @echo "Compiling $<" universe@777: $(CC) -o $@ $(CFLAGS) -c $< universe@777: universe@767: $(TEST_DIR)/test_utils$(OBJ_EXT): test_utils.c ../src/cx/test.h \ universe@767: ../src/cx/utils.h ../src/cx/common.h ../src/cx/buffer.h \ universe@767: ../src/cx/allocator.h ../src/szmul.c universe@766: @echo "Compiling $<" universe@766: $(CC) -o $@ $(CFLAGS) -c $< universe@766: universe@767: $(TEST_DIR)/ucxtest$(OBJ_EXT): ucxtest.c ../src/cx/test.h universe@766: @echo "Compiling $<" universe@766: $(CC) -o $@ $(CFLAGS) -c $< universe@766: universe@770: $(TEST_DIR)/util_allocator$(OBJ_EXT): util_allocator.c util_allocator.h \ universe@770: ../src/cx/allocator.h ../src/cx/common.h ../src/cx/test.h universe@770: @echo "Compiling $<" universe@770: $(CC) -o $@ $(CFLAGS) -c $< universe@770: