src/Makefile

Fri, 12 Apr 2024 21:48:12 +0200

author
Mike Becker <universe@uap-core.de>
date
Fri, 12 Apr 2024 21:48:12 +0200
changeset 849
edb9f875b7f9
parent 833
5c926801f052
permissions
-rw-r--r--

improves interface of cx_sprintf() variants

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@816 27 linked_list.c list.c map.c tree.c mempool.c printf.c string.c utils.c
universe@753 28
universe@753 29 OBJ_EXT=.o
universe@754 30 OBJ=$(SRC:%.c=$(build_dir)/%$(OBJ_EXT))
universe@774 31 GCOV=$(SRC:%.c=%.c.gcov)
universe@753 32
universe@754 33 static: $(build_dir)/libucx_static$(STLIB_EXT)
universe@753 34
universe@754 35 shared: $(build_dir)/libucx$(SHLIB_EXT)
universe@753 36
universe@774 37 check-coverage: $(GCOV)
universe@774 38 mv *.gcov "$(build_dir)"
universe@774 39
universe@774 40 %.c.gcov: %.c $(build_dir)/%.gcno
universe@794 41 @printf '%16s - %s\n' "$<" "`gcov -Ho "$(build_dir)" $< | grep --max-count=1 -i 'lines executed'`"
universe@774 42
universe@774 43 $(build_dir)/%.gcno:
universe@774 44 test -f "$@"
universe@774 45
universe@754 46 $(build_dir)/libucx_static$(STLIB_EXT): $(OBJ)
universe@753 47 $(AR) $(ARFLAGS) $@ $^
universe@753 48
universe@754 49 $(build_dir)/libucx$(SHLIB_EXT): $(OBJ)
universe@753 50 $(CC) $(LDFLAGS) -o $@ $^
universe@753 51
universe@754 52 install: $(build_dir)/libucx_static$(STLIB_EXT) $(build_dir)/libucx$(SHLIB_EXT)
universe@765 53 $(MKDIR) $(libdir) $(includedir)/cx
universe@754 54 $(RMFILE) $(libdir)/libucx$(SHLIB_EXT).$(LIBVERSION_MAJOR)
universe@754 55 $(RMFILE) $(libdir)/libucx$(SHLIB_EXT)
universe@754 56 $(COPYFILE) $(build_dir)/libucx_static$(STLIB_EXT) $(libdir)/libucx_static$(STLIB_EXT)
universe@754 57 $(COPYFILE) $(build_dir)/libucx$(SHLIB_EXT) $(libdir)/libucx$(SHLIB_EXT).$(LIBVERSION)
universe@765 58 $(COPYALL) $(src_dir)/src/cx $(includedir)
universe@754 59 $(SYMLINK) $(libdir)/libucx$(SHLIB_EXT).$(LIBVERSION) $(libdir)/libucx$(SHLIB_EXT).$(LIBVERSION_MAJOR)
universe@754 60 $(SYMLINK) $(libdir)/libucx$(SHLIB_EXT).$(LIBVERSION_MAJOR) $(libdir)/libucx$(SHLIB_EXT)
universe@753 61
universe@755 62 FORCE:
universe@755 63
universe@754 64 $(build_dir)/allocator$(OBJ_EXT): allocator.c cx/allocator.h cx/common.h
universe@755 65 @echo "Compiling $<"
universe@753 66 $(CC) -o $@ $(CFLAGS) -c $<
universe@753 67
universe@754 68 $(build_dir)/array_list$(OBJ_EXT): array_list.c cx/array_list.h cx/list.h \
universe@766 69 cx/common.h cx/collection.h cx/allocator.h cx/iterator.h cx/compare.h
universe@755 70 @echo "Compiling $<"
universe@753 71 $(CC) -o $@ $(CFLAGS) -c $<
universe@753 72
universe@755 73 $(build_dir)/buffer$(OBJ_EXT): buffer.c cx/buffer.h cx/common.h \
universe@755 74 cx/allocator.h cx/utils.h
universe@755 75 @echo "Compiling $<"
universe@753 76 $(CC) -o $@ $(CFLAGS) -c $<
universe@753 77
universe@754 78 $(build_dir)/compare$(OBJ_EXT): compare.c cx/compare.h cx/common.h
universe@755 79 @echo "Compiling $<"
universe@753 80 $(CC) -o $@ $(CFLAGS) -c $<
universe@753 81
universe@754 82 $(build_dir)/hash_key$(OBJ_EXT): hash_key.c cx/hash_key.h cx/common.h
universe@755 83 @echo "Compiling $<"
universe@753 84 $(CC) -o $@ $(CFLAGS) -c $<
universe@753 85
universe@755 86 $(build_dir)/hash_map$(OBJ_EXT): hash_map.c cx/hash_map.h cx/map.h \
universe@755 87 cx/common.h cx/collection.h cx/allocator.h cx/iterator.h cx/string.h \
universe@755 88 cx/hash_key.h cx/utils.h
universe@755 89 @echo "Compiling $<"
universe@753 90 $(CC) -o $@ $(CFLAGS) -c $<
universe@753 91
universe@755 92 $(build_dir)/linked_list$(OBJ_EXT): linked_list.c cx/linked_list.h \
universe@755 93 cx/common.h cx/list.h cx/collection.h cx/allocator.h cx/iterator.h \
universe@766 94 cx/utils.h cx/compare.h
universe@755 95 @echo "Compiling $<"
universe@753 96 $(CC) -o $@ $(CFLAGS) -c $<
universe@753 97
universe@754 98 $(build_dir)/list$(OBJ_EXT): list.c cx/list.h cx/common.h cx/collection.h \
universe@753 99 cx/allocator.h cx/iterator.h
universe@755 100 @echo "Compiling $<"
universe@753 101 $(CC) -o $@ $(CFLAGS) -c $<
universe@753 102
universe@754 103 $(build_dir)/map$(OBJ_EXT): map.c cx/map.h cx/common.h cx/collection.h \
universe@753 104 cx/allocator.h cx/iterator.h cx/string.h cx/hash_key.h
universe@755 105 @echo "Compiling $<"
universe@753 106 $(CC) -o $@ $(CFLAGS) -c $<
universe@753 107
universe@755 108 $(build_dir)/mempool$(OBJ_EXT): mempool.c cx/mempool.h cx/common.h \
universe@755 109 cx/allocator.h cx/utils.h
universe@755 110 @echo "Compiling $<"
universe@753 111 $(CC) -o $@ $(CFLAGS) -c $<
universe@753 112
universe@755 113 $(build_dir)/printf$(OBJ_EXT): printf.c cx/printf.h cx/common.h \
universe@755 114 cx/string.h cx/allocator.h
universe@755 115 @echo "Compiling $<"
universe@753 116 $(CC) -o $@ $(CFLAGS) -c $<
universe@753 117
universe@755 118 $(build_dir)/string$(OBJ_EXT): string.c cx/string.h cx/common.h \
universe@755 119 cx/allocator.h cx/utils.h
universe@755 120 @echo "Compiling $<"
universe@755 121 $(CC) -o $@ $(CFLAGS) -c $<
universe@755 122
universe@755 123 $(build_dir)/szmul$(OBJ_EXT): szmul.c
universe@755 124 @echo "Compiling $<"
universe@753 125 $(CC) -o $@ $(CFLAGS) -c $<
universe@753 126
universe@833 127 $(build_dir)/tree$(OBJ_EXT): tree.c cx/tree.h cx/common.h cx/iterator.h \
universe@833 128 cx/array_list.h cx/list.h cx/collection.h cx/allocator.h
universe@816 129 @echo "Compiling $<"
universe@816 130 $(CC) -o $@ $(CFLAGS) -c $<
universe@816 131
universe@754 132 $(build_dir)/utils$(OBJ_EXT): utils.c cx/utils.h cx/common.h
universe@755 133 @echo "Compiling $<"
universe@753 134 $(CC) -o $@ $(CFLAGS) -c $<
universe@753 135

mercurial