1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/Makefile Thu Oct 12 00:00:35 2023 +0200 1.3 @@ -0,0 +1,107 @@ 1.4 +# Copyright 2023 Mike Becker. All rights reserved. 1.5 +# 1.6 +# Redistribution and use in source and binary forms, with or without 1.7 +# modification, are permitted provided that the following conditions are met: 1.8 +# 1.9 +# 1. Redistributions of source code must retain the above copyright 1.10 +# notice, this list of conditions and the following disclaimer. 1.11 +# 1.12 +# 2. Redistributions in binary form must reproduce the above copyright 1.13 +# notice, this list of conditions and the following disclaimer in the 1.14 +# documentation and/or other materials provided with the distribution. 1.15 +# 1.16 +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 1.17 +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1.18 +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 1.19 +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 1.20 +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 1.21 +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 1.22 +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 1.23 +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 1.24 +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 1.25 +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 1.26 + 1.27 +include ../config.mk 1.28 + 1.29 +SRC = allocator.c array_list.c buffer.c compare.c hash_key.c hash_map.c \ 1.30 + linked_list.c list.c map.c mempool.c printf.c string.c utils.c 1.31 + 1.32 +OBJ_EXT=.o 1.33 +OBJ=$(SRC:%.c=$(BUILD_DIR)/%$(OBJ_EXT)) 1.34 + 1.35 +static: $(BUILD_DIR)/libucx$(STLIB_EXT) 1.36 + 1.37 +shared: $(BUILD_DIR)/libucx$(SHLIB_EXT) 1.38 + 1.39 +$(BUILD_DIR)/libucx$(STLIB_EXT): $(OBJ) 1.40 + $(AR) $(ARFLAGS) $@ $^ 1.41 + 1.42 +$(BUILD_DIR)/libucx$(SHLIB_EXT): $(OBJ) 1.43 + $(CC) $(LDFLAGS) -o $@ $^ 1.44 + 1.45 +install: 1.46 + @echo "[ not supported yet ]" 1.47 + 1.48 + 1.49 +$(BUILD_DIR)/allocator$(OBJ_EXT): allocator.c cx/allocator.h cx/common.h 1.50 + echo "Compiling $<" 1.51 + $(CC) -o $@ $(CFLAGS) -c $< 1.52 + 1.53 +$(BUILD_DIR)/array_list$(OBJ_EXT): array_list.c cx/array_list.h cx/list.h \ 1.54 + cx/common.h cx/collection.h cx/allocator.h cx/iterator.h 1.55 + echo "Compiling $<" 1.56 + $(CC) -o $@ $(CFLAGS) -c $< 1.57 + 1.58 +$(BUILD_DIR)/buffer$(OBJ_EXT): buffer.c cx/buffer.h cx/common.h cx/allocator.h \ 1.59 + cx/utils.h 1.60 + echo "Compiling $<" 1.61 + $(CC) -o $@ $(CFLAGS) -c $< 1.62 + 1.63 +$(BUILD_DIR)/compare$(OBJ_EXT): compare.c cx/compare.h cx/common.h 1.64 + echo "Compiling $<" 1.65 + $(CC) -o $@ $(CFLAGS) -c $< 1.66 + 1.67 +$(BUILD_DIR)/hash_key$(OBJ_EXT): hash_key.c cx/hash_key.h cx/common.h 1.68 + echo "Compiling $<" 1.69 + $(CC) -o $@ $(CFLAGS) -c $< 1.70 + 1.71 +$(BUILD_DIR)/hash_map$(OBJ_EXT): hash_map.c cx/hash_map.h cx/map.h cx/common.h \ 1.72 + cx/collection.h cx/allocator.h cx/iterator.h cx/string.h cx/hash_key.h \ 1.73 + cx/utils.h 1.74 + echo "Compiling $<" 1.75 + $(CC) -o $@ $(CFLAGS) -c $< 1.76 + 1.77 +$(BUILD_DIR)/linked_list$(OBJ_EXT): linked_list.c cx/linked_list.h cx/common.h \ 1.78 + cx/list.h cx/collection.h cx/allocator.h cx/iterator.h cx/utils.h 1.79 + echo "Compiling $<" 1.80 + $(CC) -o $@ $(CFLAGS) -c $< 1.81 + 1.82 +$(BUILD_DIR)/list$(OBJ_EXT): list.c cx/list.h cx/common.h cx/collection.h \ 1.83 + cx/allocator.h cx/iterator.h 1.84 + echo "Compiling $<" 1.85 + $(CC) -o $@ $(CFLAGS) -c $< 1.86 + 1.87 +$(BUILD_DIR)/map$(OBJ_EXT): map.c cx/map.h cx/common.h cx/collection.h \ 1.88 + cx/allocator.h cx/iterator.h cx/string.h cx/hash_key.h 1.89 + echo "Compiling $<" 1.90 + $(CC) -o $@ $(CFLAGS) -c $< 1.91 + 1.92 +$(BUILD_DIR)/mempool$(OBJ_EXT): mempool.c cx/mempool.h cx/common.h cx/allocator.h \ 1.93 + cx/utils.h 1.94 + echo "Compiling $<" 1.95 + $(CC) -o $@ $(CFLAGS) -c $< 1.96 + 1.97 +$(BUILD_DIR)/printf$(OBJ_EXT): printf.c cx/printf.h cx/common.h cx/string.h \ 1.98 + cx/allocator.h 1.99 + echo "Compiling $<" 1.100 + $(CC) -o $@ $(CFLAGS) -c $< 1.101 + 1.102 +$(BUILD_DIR)/string$(OBJ_EXT): string.c cx/string.h cx/common.h cx/allocator.h \ 1.103 + cx/utils.h 1.104 + echo "Compiling $<" 1.105 + $(CC) -o $@ $(CFLAGS) -c $< 1.106 + 1.107 +$(BUILD_DIR)/utils$(OBJ_EXT): utils.c cx/utils.h cx/common.h 1.108 + echo "Compiling $<" 1.109 + $(CC) -o $@ $(CFLAGS) -c $< 1.110 +