src/Makefile

Thu, 12 Oct 2023 00:00:35 +0200

author
Mike Becker <universe@uap-core.de>
date
Thu, 12 Oct 2023 00:00:35 +0200
changeset 753
24dc84788dee
child 754
4bc7d966c9db
permissions
-rw-r--r--

replace most of the build system with uwproj

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@753 26 SRC = allocator.c array_list.c buffer.c compare.c hash_key.c hash_map.c \
universe@753 27 linked_list.c list.c map.c mempool.c printf.c string.c utils.c
universe@753 28
universe@753 29 OBJ_EXT=.o
universe@753 30 OBJ=$(SRC:%.c=$(BUILD_DIR)/%$(OBJ_EXT))
universe@753 31
universe@753 32 static: $(BUILD_DIR)/libucx$(STLIB_EXT)
universe@753 33
universe@753 34 shared: $(BUILD_DIR)/libucx$(SHLIB_EXT)
universe@753 35
universe@753 36 $(BUILD_DIR)/libucx$(STLIB_EXT): $(OBJ)
universe@753 37 $(AR) $(ARFLAGS) $@ $^
universe@753 38
universe@753 39 $(BUILD_DIR)/libucx$(SHLIB_EXT): $(OBJ)
universe@753 40 $(CC) $(LDFLAGS) -o $@ $^
universe@753 41
universe@753 42 install:
universe@753 43 @echo "[ not supported yet ]"
universe@753 44
universe@753 45
universe@753 46 $(BUILD_DIR)/allocator$(OBJ_EXT): allocator.c cx/allocator.h cx/common.h
universe@753 47 echo "Compiling $<"
universe@753 48 $(CC) -o $@ $(CFLAGS) -c $<
universe@753 49
universe@753 50 $(BUILD_DIR)/array_list$(OBJ_EXT): array_list.c cx/array_list.h cx/list.h \
universe@753 51 cx/common.h cx/collection.h cx/allocator.h cx/iterator.h
universe@753 52 echo "Compiling $<"
universe@753 53 $(CC) -o $@ $(CFLAGS) -c $<
universe@753 54
universe@753 55 $(BUILD_DIR)/buffer$(OBJ_EXT): buffer.c cx/buffer.h cx/common.h cx/allocator.h \
universe@753 56 cx/utils.h
universe@753 57 echo "Compiling $<"
universe@753 58 $(CC) -o $@ $(CFLAGS) -c $<
universe@753 59
universe@753 60 $(BUILD_DIR)/compare$(OBJ_EXT): compare.c cx/compare.h cx/common.h
universe@753 61 echo "Compiling $<"
universe@753 62 $(CC) -o $@ $(CFLAGS) -c $<
universe@753 63
universe@753 64 $(BUILD_DIR)/hash_key$(OBJ_EXT): hash_key.c cx/hash_key.h cx/common.h
universe@753 65 echo "Compiling $<"
universe@753 66 $(CC) -o $@ $(CFLAGS) -c $<
universe@753 67
universe@753 68 $(BUILD_DIR)/hash_map$(OBJ_EXT): hash_map.c cx/hash_map.h cx/map.h cx/common.h \
universe@753 69 cx/collection.h cx/allocator.h cx/iterator.h cx/string.h cx/hash_key.h \
universe@753 70 cx/utils.h
universe@753 71 echo "Compiling $<"
universe@753 72 $(CC) -o $@ $(CFLAGS) -c $<
universe@753 73
universe@753 74 $(BUILD_DIR)/linked_list$(OBJ_EXT): linked_list.c cx/linked_list.h cx/common.h \
universe@753 75 cx/list.h cx/collection.h cx/allocator.h cx/iterator.h cx/utils.h
universe@753 76 echo "Compiling $<"
universe@753 77 $(CC) -o $@ $(CFLAGS) -c $<
universe@753 78
universe@753 79 $(BUILD_DIR)/list$(OBJ_EXT): list.c cx/list.h cx/common.h cx/collection.h \
universe@753 80 cx/allocator.h cx/iterator.h
universe@753 81 echo "Compiling $<"
universe@753 82 $(CC) -o $@ $(CFLAGS) -c $<
universe@753 83
universe@753 84 $(BUILD_DIR)/map$(OBJ_EXT): map.c cx/map.h cx/common.h cx/collection.h \
universe@753 85 cx/allocator.h cx/iterator.h cx/string.h cx/hash_key.h
universe@753 86 echo "Compiling $<"
universe@753 87 $(CC) -o $@ $(CFLAGS) -c $<
universe@753 88
universe@753 89 $(BUILD_DIR)/mempool$(OBJ_EXT): mempool.c cx/mempool.h cx/common.h cx/allocator.h \
universe@753 90 cx/utils.h
universe@753 91 echo "Compiling $<"
universe@753 92 $(CC) -o $@ $(CFLAGS) -c $<
universe@753 93
universe@753 94 $(BUILD_DIR)/printf$(OBJ_EXT): printf.c cx/printf.h cx/common.h cx/string.h \
universe@753 95 cx/allocator.h
universe@753 96 echo "Compiling $<"
universe@753 97 $(CC) -o $@ $(CFLAGS) -c $<
universe@753 98
universe@753 99 $(BUILD_DIR)/string$(OBJ_EXT): string.c cx/string.h cx/common.h cx/allocator.h \
universe@753 100 cx/utils.h
universe@753 101 echo "Compiling $<"
universe@753 102 $(CC) -o $@ $(CFLAGS) -c $<
universe@753 103
universe@753 104 $(BUILD_DIR)/utils$(OBJ_EXT): utils.c cx/utils.h cx/common.h
universe@753 105 echo "Compiling $<"
universe@753 106 $(CC) -o $@ $(CFLAGS) -c $<
universe@753 107

mercurial