src/Makefile

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

mercurial