Wed, 18 Oct 2023 21:07:02 +0200
add an uwproj based install target
1 # Copyright 2023 Mike Becker. All rights reserved.
2 #
3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions are met:
5 #
6 # 1. Redistributions of source code must retain the above copyright
7 # notice, this list of conditions and the following disclaimer.
8 #
9 # 2. Redistributions in binary form must reproduce the above copyright
10 # notice, this list of conditions and the following disclaimer in the
11 # documentation and/or other materials provided with the distribution.
12 #
13 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
14 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
16 # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
17 # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
19 # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
20 # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
21 # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
22 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 include ../config.mk
26 SRC = allocator.c array_list.c buffer.c compare.c hash_key.c hash_map.c \
27 linked_list.c list.c map.c mempool.c printf.c string.c utils.c
29 OBJ_EXT=.o
30 OBJ=$(SRC:%.c=$(build_dir)/%$(OBJ_EXT))
32 static: $(build_dir)/libucx_static$(STLIB_EXT)
34 shared: $(build_dir)/libucx$(SHLIB_EXT)
36 $(build_dir)/libucx_static$(STLIB_EXT): $(OBJ)
37 $(AR) $(ARFLAGS) $@ $^
39 $(build_dir)/libucx$(SHLIB_EXT): $(OBJ)
40 $(CC) $(LDFLAGS) -o $@ $^
42 install: $(build_dir)/libucx_static$(STLIB_EXT) $(build_dir)/libucx$(SHLIB_EXT)
43 $(MKDIR) $(libdir) $(includedir)
44 $(RMFILE) $(libdir)/libucx$(SHLIB_EXT).$(LIBVERSION_MAJOR)
45 $(RMFILE) $(libdir)/libucx$(SHLIB_EXT)
46 $(COPYFILE) $(build_dir)/libucx_static$(STLIB_EXT) $(libdir)/libucx_static$(STLIB_EXT)
47 $(COPYFILE) $(build_dir)/libucx$(SHLIB_EXT) $(libdir)/libucx$(SHLIB_EXT).$(LIBVERSION)
48 $(COPYALL) $(src_dir)/src/cx $(includedir)/cx
49 $(SYMLINK) $(libdir)/libucx$(SHLIB_EXT).$(LIBVERSION) $(libdir)/libucx$(SHLIB_EXT).$(LIBVERSION_MAJOR)
50 $(SYMLINK) $(libdir)/libucx$(SHLIB_EXT).$(LIBVERSION_MAJOR) $(libdir)/libucx$(SHLIB_EXT)
52 $(build_dir)/allocator$(OBJ_EXT): allocator.c cx/allocator.h cx/common.h
53 echo "Compiling $<"
54 $(CC) -o $@ $(CFLAGS) -c $<
56 $(build_dir)/array_list$(OBJ_EXT): array_list.c cx/array_list.h cx/list.h \
57 cx/common.h cx/collection.h cx/allocator.h cx/iterator.h
58 echo "Compiling $<"
59 $(CC) -o $@ $(CFLAGS) -c $<
61 $(build_dir)/buffer$(OBJ_EXT): buffer.c cx/buffer.h cx/common.h cx/allocator.h \
62 cx/utils.h
63 echo "Compiling $<"
64 $(CC) -o $@ $(CFLAGS) -c $<
66 $(build_dir)/compare$(OBJ_EXT): compare.c cx/compare.h cx/common.h
67 echo "Compiling $<"
68 $(CC) -o $@ $(CFLAGS) -c $<
70 $(build_dir)/hash_key$(OBJ_EXT): hash_key.c cx/hash_key.h cx/common.h
71 echo "Compiling $<"
72 $(CC) -o $@ $(CFLAGS) -c $<
74 $(build_dir)/hash_map$(OBJ_EXT): hash_map.c cx/hash_map.h cx/map.h cx/common.h \
75 cx/collection.h cx/allocator.h cx/iterator.h cx/string.h cx/hash_key.h \
76 cx/utils.h
77 echo "Compiling $<"
78 $(CC) -o $@ $(CFLAGS) -c $<
80 $(build_dir)/linked_list$(OBJ_EXT): linked_list.c cx/linked_list.h cx/common.h \
81 cx/list.h cx/collection.h cx/allocator.h cx/iterator.h cx/utils.h
82 echo "Compiling $<"
83 $(CC) -o $@ $(CFLAGS) -c $<
85 $(build_dir)/list$(OBJ_EXT): list.c cx/list.h cx/common.h cx/collection.h \
86 cx/allocator.h cx/iterator.h
87 echo "Compiling $<"
88 $(CC) -o $@ $(CFLAGS) -c $<
90 $(build_dir)/map$(OBJ_EXT): map.c cx/map.h cx/common.h cx/collection.h \
91 cx/allocator.h cx/iterator.h cx/string.h cx/hash_key.h
92 echo "Compiling $<"
93 $(CC) -o $@ $(CFLAGS) -c $<
95 $(build_dir)/mempool$(OBJ_EXT): mempool.c cx/mempool.h cx/common.h cx/allocator.h \
96 cx/utils.h
97 echo "Compiling $<"
98 $(CC) -o $@ $(CFLAGS) -c $<
100 $(build_dir)/printf$(OBJ_EXT): printf.c cx/printf.h cx/common.h cx/string.h \
101 cx/allocator.h
102 echo "Compiling $<"
103 $(CC) -o $@ $(CFLAGS) -c $<
105 $(build_dir)/string$(OBJ_EXT): string.c cx/string.h cx/common.h cx/allocator.h \
106 cx/utils.h
107 echo "Compiling $<"
108 $(CC) -o $@ $(CFLAGS) -c $<
110 $(build_dir)/utils$(OBJ_EXT): utils.c cx/utils.h cx/common.h
111 echo "Compiling $<"
112 $(CC) -o $@ $(CFLAGS) -c $<