src/Makefile

changeset 754
4bc7d966c9db
parent 753
24dc84788dee
child 755
255ee4abf2ec
--- a/src/Makefile	Thu Oct 12 00:00:35 2023 +0200
+++ b/src/Makefile	Wed Oct 18 21:07:02 2023 +0200
@@ -27,81 +27,87 @@
   linked_list.c list.c map.c mempool.c printf.c string.c utils.c
 
 OBJ_EXT=.o
-OBJ=$(SRC:%.c=$(BUILD_DIR)/%$(OBJ_EXT))
+OBJ=$(SRC:%.c=$(build_dir)/%$(OBJ_EXT))
 
-static: $(BUILD_DIR)/libucx$(STLIB_EXT)
+static: $(build_dir)/libucx_static$(STLIB_EXT)
 
-shared: $(BUILD_DIR)/libucx$(SHLIB_EXT)
+shared: $(build_dir)/libucx$(SHLIB_EXT)
 
-$(BUILD_DIR)/libucx$(STLIB_EXT): $(OBJ)
+$(build_dir)/libucx_static$(STLIB_EXT): $(OBJ)
 	$(AR) $(ARFLAGS) $@ $^
 
-$(BUILD_DIR)/libucx$(SHLIB_EXT): $(OBJ)
+$(build_dir)/libucx$(SHLIB_EXT): $(OBJ)
 	$(CC) $(LDFLAGS) -o $@ $^
 
-install:
-	@echo "[ not supported yet ]"
+install: $(build_dir)/libucx_static$(STLIB_EXT) $(build_dir)/libucx$(SHLIB_EXT)
+	$(MKDIR) $(libdir) $(includedir)
+	$(RMFILE) $(libdir)/libucx$(SHLIB_EXT).$(LIBVERSION_MAJOR)
+	$(RMFILE) $(libdir)/libucx$(SHLIB_EXT)
+	$(COPYFILE) $(build_dir)/libucx_static$(STLIB_EXT) $(libdir)/libucx_static$(STLIB_EXT)
+	$(COPYFILE) $(build_dir)/libucx$(SHLIB_EXT) $(libdir)/libucx$(SHLIB_EXT).$(LIBVERSION)
+	$(COPYALL) $(src_dir)/src/cx $(includedir)/cx
+	$(SYMLINK) $(libdir)/libucx$(SHLIB_EXT).$(LIBVERSION) $(libdir)/libucx$(SHLIB_EXT).$(LIBVERSION_MAJOR)
+	$(SYMLINK) $(libdir)/libucx$(SHLIB_EXT).$(LIBVERSION_MAJOR) $(libdir)/libucx$(SHLIB_EXT)
 
-
-$(BUILD_DIR)/allocator$(OBJ_EXT): allocator.c cx/allocator.h cx/common.h
+$(build_dir)/allocator$(OBJ_EXT): allocator.c cx/allocator.h cx/common.h
 	echo "Compiling $<"
 	$(CC) -o $@ $(CFLAGS) -c $<
 
-$(BUILD_DIR)/array_list$(OBJ_EXT): array_list.c cx/array_list.h cx/list.h \
+$(build_dir)/array_list$(OBJ_EXT): array_list.c cx/array_list.h cx/list.h \
  cx/common.h cx/collection.h cx/allocator.h cx/iterator.h
 	echo "Compiling $<"
 	$(CC) -o $@ $(CFLAGS) -c $<
 
-$(BUILD_DIR)/buffer$(OBJ_EXT): buffer.c cx/buffer.h cx/common.h cx/allocator.h \
+$(build_dir)/buffer$(OBJ_EXT): buffer.c cx/buffer.h cx/common.h cx/allocator.h \
  cx/utils.h
 	echo "Compiling $<"
 	$(CC) -o $@ $(CFLAGS) -c $<
 
-$(BUILD_DIR)/compare$(OBJ_EXT): compare.c cx/compare.h cx/common.h
+$(build_dir)/compare$(OBJ_EXT): compare.c cx/compare.h cx/common.h
 	echo "Compiling $<"
 	$(CC) -o $@ $(CFLAGS) -c $<
 
-$(BUILD_DIR)/hash_key$(OBJ_EXT): hash_key.c cx/hash_key.h cx/common.h
+$(build_dir)/hash_key$(OBJ_EXT): hash_key.c cx/hash_key.h cx/common.h
 	echo "Compiling $<"
 	$(CC) -o $@ $(CFLAGS) -c $<
 
-$(BUILD_DIR)/hash_map$(OBJ_EXT): hash_map.c cx/hash_map.h cx/map.h cx/common.h \
+$(build_dir)/hash_map$(OBJ_EXT): hash_map.c cx/hash_map.h cx/map.h cx/common.h \
  cx/collection.h cx/allocator.h cx/iterator.h cx/string.h cx/hash_key.h \
  cx/utils.h
 	echo "Compiling $<"
 	$(CC) -o $@ $(CFLAGS) -c $<
 
-$(BUILD_DIR)/linked_list$(OBJ_EXT): linked_list.c cx/linked_list.h cx/common.h \
+$(build_dir)/linked_list$(OBJ_EXT): linked_list.c cx/linked_list.h cx/common.h \
  cx/list.h cx/collection.h cx/allocator.h cx/iterator.h cx/utils.h
 	echo "Compiling $<"
 	$(CC) -o $@ $(CFLAGS) -c $<
 
-$(BUILD_DIR)/list$(OBJ_EXT): list.c cx/list.h cx/common.h cx/collection.h \
+$(build_dir)/list$(OBJ_EXT): list.c cx/list.h cx/common.h cx/collection.h \
  cx/allocator.h cx/iterator.h
 	echo "Compiling $<"
 	$(CC) -o $@ $(CFLAGS) -c $<
 
-$(BUILD_DIR)/map$(OBJ_EXT): map.c cx/map.h cx/common.h cx/collection.h \
+$(build_dir)/map$(OBJ_EXT): map.c cx/map.h cx/common.h cx/collection.h \
  cx/allocator.h cx/iterator.h cx/string.h cx/hash_key.h
 	echo "Compiling $<"
 	$(CC) -o $@ $(CFLAGS) -c $<
 
-$(BUILD_DIR)/mempool$(OBJ_EXT): mempool.c cx/mempool.h cx/common.h cx/allocator.h \
+$(build_dir)/mempool$(OBJ_EXT): mempool.c cx/mempool.h cx/common.h cx/allocator.h \
  cx/utils.h
 	echo "Compiling $<"
 	$(CC) -o $@ $(CFLAGS) -c $<
 
-$(BUILD_DIR)/printf$(OBJ_EXT): printf.c cx/printf.h cx/common.h cx/string.h \
+$(build_dir)/printf$(OBJ_EXT): printf.c cx/printf.h cx/common.h cx/string.h \
  cx/allocator.h
 	echo "Compiling $<"
 	$(CC) -o $@ $(CFLAGS) -c $<
 
-$(BUILD_DIR)/string$(OBJ_EXT): string.c cx/string.h cx/common.h cx/allocator.h \
+$(build_dir)/string$(OBJ_EXT): string.c cx/string.h cx/common.h cx/allocator.h \
  cx/utils.h
 	echo "Compiling $<"
 	$(CC) -o $@ $(CFLAGS) -c $<
 
-$(BUILD_DIR)/utils$(OBJ_EXT): utils.c cx/utils.h cx/common.h
+$(build_dir)/utils$(OBJ_EXT): utils.c cx/utils.h cx/common.h
 	echo "Compiling $<"
 	$(CC) -o $@ $(CFLAGS) -c $<
 

mercurial