Tue, 02 Jun 2026 19:30:34 +0200
add build dependencies and a script for generating them
# # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. # # Copyright 2013 Olaf Wintermann. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # include ../config.mk # list of source files SRC = allocator.c SRC += array_list.c SRC += mempool.c SRC += buffer.c SRC += compare.c SRC += hash_key.c SRC += hash_map.c SRC += iterator.c SRC += linked_list.c SRC += kv_list.c SRC += list.c SRC += map.c SRC += printf.c SRC += string.c SRC += tree.c SRC += streams.c SRC += properties.c SRC += json.c OBJ = $(SRC:%.c=../build/ucx/%$(OBJ_EXT)) UCX_LIB = ../build/$(BUILD_LIB_DIR)/$(LIB_PREFIX)ucx$(LIB_EXT) UCX_SHLIB = ../build/$(BUILD_LIB_DIR)/$(LIB_PREFIX)ucx$(SHLIB_EXT) all: $(UCX_LIB) $(UCX_SHLIB) $(UCX_LIB): $(OBJ) $(AR) $(ARFLAGS) $@ $(OBJ) $(UCX_SHLIB): $(OBJ) $(CC) -o $@ $(LDFLAGS) $(SHLIB_LDFLAGS) $(OBJ) ../build/ucx: mkdir -p ../build/ucx FORCE: ../build/ucx/allocator$(OBJ_EXT): allocator.c cx/allocator.h cx/common.h $(CC) -o $@ $(CFLAGS) $(SHLIB_CFLAGS) -c $< ../build/ucx/array_list$(OBJ_EXT): array_list.c cx/array_list.h cx/list.h \ cx/common.h cx/collection.h cx/allocator.h cx/iterator.h cx/compare.h \ cx/compare.h $(CC) -o $@ $(CFLAGS) $(SHLIB_CFLAGS) -c $< ../build/ucx/buffer$(OBJ_EXT): buffer.c cx/buffer.h cx/common.h \ cx/allocator.h cx/string.h $(CC) -o $@ $(CFLAGS) $(SHLIB_CFLAGS) -c $< ../build/ucx/compare$(OBJ_EXT): compare.c cx/compare.h cx/common.h $(CC) -o $@ $(CFLAGS) $(SHLIB_CFLAGS) -c $< ../build/ucx/hash_key$(OBJ_EXT): hash_key.c cx/hash_key.h cx/common.h \ cx/string.h cx/allocator.h cx/compare.h $(CC) -o $@ $(CFLAGS) $(SHLIB_CFLAGS) -c $< ../build/ucx/hash_map$(OBJ_EXT): hash_map.c cx/hash_map.h cx/map.h \ cx/common.h cx/collection.h cx/allocator.h cx/iterator.h cx/compare.h \ cx/string.h cx/hash_key.h $(CC) -o $@ $(CFLAGS) $(SHLIB_CFLAGS) -c $< ../build/ucx/iterator$(OBJ_EXT): iterator.c cx/iterator.h cx/common.h $(CC) -o $@ $(CFLAGS) $(SHLIB_CFLAGS) -c $< ../build/ucx/json$(OBJ_EXT): json.c cx/json.h cx/common.h cx/allocator.h \ cx/string.h cx/buffer.h cx/array_list.h cx/list.h cx/collection.h \ cx/iterator.h cx/compare.h cx/map.h cx/hash_key.h cx/kv_list.h $(CC) -o $@ $(CFLAGS) $(SHLIB_CFLAGS) -c $< ../build/ucx/kv_list$(OBJ_EXT): kv_list.c cx/kv_list.h cx/common.h \ cx/list.h cx/collection.h cx/allocator.h cx/iterator.h cx/compare.h \ cx/map.h cx/string.h cx/hash_key.h cx/hash_map.h cx/linked_list.h $(CC) -o $@ $(CFLAGS) $(SHLIB_CFLAGS) -c $< ../build/ucx/linked_list$(OBJ_EXT): linked_list.c cx/linked_list.h \ cx/common.h cx/list.h cx/collection.h cx/allocator.h cx/iterator.h \ cx/compare.h cx/compare.h $(CC) -o $@ $(CFLAGS) $(SHLIB_CFLAGS) -c $< ../build/ucx/list$(OBJ_EXT): list.c cx/list.h cx/common.h cx/collection.h \ cx/allocator.h cx/iterator.h cx/compare.h $(CC) -o $@ $(CFLAGS) $(SHLIB_CFLAGS) -c $< ../build/ucx/map$(OBJ_EXT): map.c cx/map.h cx/common.h cx/collection.h \ cx/allocator.h cx/iterator.h cx/compare.h cx/string.h cx/hash_key.h \ cx/list.h $(CC) -o $@ $(CFLAGS) $(SHLIB_CFLAGS) -c $< ../build/ucx/mempool$(OBJ_EXT): mempool.c cx/mempool.h cx/common.h \ cx/allocator.h $(CC) -o $@ $(CFLAGS) $(SHLIB_CFLAGS) -c $< ../build/ucx/printf$(OBJ_EXT): printf.c cx/printf.h cx/common.h \ cx/string.h cx/allocator.h $(CC) -o $@ $(CFLAGS) $(SHLIB_CFLAGS) -c $< ../build/ucx/properties$(OBJ_EXT): properties.c cx/properties.h \ cx/common.h cx/string.h cx/allocator.h cx/map.h cx/collection.h \ cx/iterator.h cx/compare.h cx/hash_key.h cx/buffer.h $(CC) -o $@ $(CFLAGS) $(SHLIB_CFLAGS) -c $< ../build/ucx/streams$(OBJ_EXT): streams.c cx/streams.h cx/common.h \ cx/allocator.h $(CC) -o $@ $(CFLAGS) $(SHLIB_CFLAGS) -c $< ../build/ucx/string$(OBJ_EXT): string.c cx/string.h cx/common.h \ cx/allocator.h $(CC) -o $@ $(CFLAGS) $(SHLIB_CFLAGS) -c $< ../build/ucx/szmul$(OBJ_EXT): szmul.c cx/common.h $(CC) -o $@ $(CFLAGS) $(SHLIB_CFLAGS) -c $< ../build/ucx/tree$(OBJ_EXT): tree.c cx/tree.h cx/common.h cx/collection.h \ cx/allocator.h cx/iterator.h cx/compare.h $(CC) -o $@ $(CFLAGS) $(SHLIB_CFLAGS) -c $<