src/Makefile

changeset 754
4bc7d966c9db
parent 753
24dc84788dee
child 755
255ee4abf2ec
     1.1 --- a/src/Makefile	Thu Oct 12 00:00:35 2023 +0200
     1.2 +++ b/src/Makefile	Wed Oct 18 21:07:02 2023 +0200
     1.3 @@ -27,81 +27,87 @@
     1.4    linked_list.c list.c map.c mempool.c printf.c string.c utils.c
     1.5  
     1.6  OBJ_EXT=.o
     1.7 -OBJ=$(SRC:%.c=$(BUILD_DIR)/%$(OBJ_EXT))
     1.8 +OBJ=$(SRC:%.c=$(build_dir)/%$(OBJ_EXT))
     1.9  
    1.10 -static: $(BUILD_DIR)/libucx$(STLIB_EXT)
    1.11 +static: $(build_dir)/libucx_static$(STLIB_EXT)
    1.12  
    1.13 -shared: $(BUILD_DIR)/libucx$(SHLIB_EXT)
    1.14 +shared: $(build_dir)/libucx$(SHLIB_EXT)
    1.15  
    1.16 -$(BUILD_DIR)/libucx$(STLIB_EXT): $(OBJ)
    1.17 +$(build_dir)/libucx_static$(STLIB_EXT): $(OBJ)
    1.18  	$(AR) $(ARFLAGS) $@ $^
    1.19  
    1.20 -$(BUILD_DIR)/libucx$(SHLIB_EXT): $(OBJ)
    1.21 +$(build_dir)/libucx$(SHLIB_EXT): $(OBJ)
    1.22  	$(CC) $(LDFLAGS) -o $@ $^
    1.23  
    1.24 -install:
    1.25 -	@echo "[ not supported yet ]"
    1.26 +install: $(build_dir)/libucx_static$(STLIB_EXT) $(build_dir)/libucx$(SHLIB_EXT)
    1.27 +	$(MKDIR) $(libdir) $(includedir)
    1.28 +	$(RMFILE) $(libdir)/libucx$(SHLIB_EXT).$(LIBVERSION_MAJOR)
    1.29 +	$(RMFILE) $(libdir)/libucx$(SHLIB_EXT)
    1.30 +	$(COPYFILE) $(build_dir)/libucx_static$(STLIB_EXT) $(libdir)/libucx_static$(STLIB_EXT)
    1.31 +	$(COPYFILE) $(build_dir)/libucx$(SHLIB_EXT) $(libdir)/libucx$(SHLIB_EXT).$(LIBVERSION)
    1.32 +	$(COPYALL) $(src_dir)/src/cx $(includedir)/cx
    1.33 +	$(SYMLINK) $(libdir)/libucx$(SHLIB_EXT).$(LIBVERSION) $(libdir)/libucx$(SHLIB_EXT).$(LIBVERSION_MAJOR)
    1.34 +	$(SYMLINK) $(libdir)/libucx$(SHLIB_EXT).$(LIBVERSION_MAJOR) $(libdir)/libucx$(SHLIB_EXT)
    1.35  
    1.36 -
    1.37 -$(BUILD_DIR)/allocator$(OBJ_EXT): allocator.c cx/allocator.h cx/common.h
    1.38 +$(build_dir)/allocator$(OBJ_EXT): allocator.c cx/allocator.h cx/common.h
    1.39  	echo "Compiling $<"
    1.40  	$(CC) -o $@ $(CFLAGS) -c $<
    1.41  
    1.42 -$(BUILD_DIR)/array_list$(OBJ_EXT): array_list.c cx/array_list.h cx/list.h \
    1.43 +$(build_dir)/array_list$(OBJ_EXT): array_list.c cx/array_list.h cx/list.h \
    1.44   cx/common.h cx/collection.h cx/allocator.h cx/iterator.h
    1.45  	echo "Compiling $<"
    1.46  	$(CC) -o $@ $(CFLAGS) -c $<
    1.47  
    1.48 -$(BUILD_DIR)/buffer$(OBJ_EXT): buffer.c cx/buffer.h cx/common.h cx/allocator.h \
    1.49 +$(build_dir)/buffer$(OBJ_EXT): buffer.c cx/buffer.h cx/common.h cx/allocator.h \
    1.50   cx/utils.h
    1.51  	echo "Compiling $<"
    1.52  	$(CC) -o $@ $(CFLAGS) -c $<
    1.53  
    1.54 -$(BUILD_DIR)/compare$(OBJ_EXT): compare.c cx/compare.h cx/common.h
    1.55 +$(build_dir)/compare$(OBJ_EXT): compare.c cx/compare.h cx/common.h
    1.56  	echo "Compiling $<"
    1.57  	$(CC) -o $@ $(CFLAGS) -c $<
    1.58  
    1.59 -$(BUILD_DIR)/hash_key$(OBJ_EXT): hash_key.c cx/hash_key.h cx/common.h
    1.60 +$(build_dir)/hash_key$(OBJ_EXT): hash_key.c cx/hash_key.h cx/common.h
    1.61  	echo "Compiling $<"
    1.62  	$(CC) -o $@ $(CFLAGS) -c $<
    1.63  
    1.64 -$(BUILD_DIR)/hash_map$(OBJ_EXT): hash_map.c cx/hash_map.h cx/map.h cx/common.h \
    1.65 +$(build_dir)/hash_map$(OBJ_EXT): hash_map.c cx/hash_map.h cx/map.h cx/common.h \
    1.66   cx/collection.h cx/allocator.h cx/iterator.h cx/string.h cx/hash_key.h \
    1.67   cx/utils.h
    1.68  	echo "Compiling $<"
    1.69  	$(CC) -o $@ $(CFLAGS) -c $<
    1.70  
    1.71 -$(BUILD_DIR)/linked_list$(OBJ_EXT): linked_list.c cx/linked_list.h cx/common.h \
    1.72 +$(build_dir)/linked_list$(OBJ_EXT): linked_list.c cx/linked_list.h cx/common.h \
    1.73   cx/list.h cx/collection.h cx/allocator.h cx/iterator.h cx/utils.h
    1.74  	echo "Compiling $<"
    1.75  	$(CC) -o $@ $(CFLAGS) -c $<
    1.76  
    1.77 -$(BUILD_DIR)/list$(OBJ_EXT): list.c cx/list.h cx/common.h cx/collection.h \
    1.78 +$(build_dir)/list$(OBJ_EXT): list.c cx/list.h cx/common.h cx/collection.h \
    1.79   cx/allocator.h cx/iterator.h
    1.80  	echo "Compiling $<"
    1.81  	$(CC) -o $@ $(CFLAGS) -c $<
    1.82  
    1.83 -$(BUILD_DIR)/map$(OBJ_EXT): map.c cx/map.h cx/common.h cx/collection.h \
    1.84 +$(build_dir)/map$(OBJ_EXT): map.c cx/map.h cx/common.h cx/collection.h \
    1.85   cx/allocator.h cx/iterator.h cx/string.h cx/hash_key.h
    1.86  	echo "Compiling $<"
    1.87  	$(CC) -o $@ $(CFLAGS) -c $<
    1.88  
    1.89 -$(BUILD_DIR)/mempool$(OBJ_EXT): mempool.c cx/mempool.h cx/common.h cx/allocator.h \
    1.90 +$(build_dir)/mempool$(OBJ_EXT): mempool.c cx/mempool.h cx/common.h cx/allocator.h \
    1.91   cx/utils.h
    1.92  	echo "Compiling $<"
    1.93  	$(CC) -o $@ $(CFLAGS) -c $<
    1.94  
    1.95 -$(BUILD_DIR)/printf$(OBJ_EXT): printf.c cx/printf.h cx/common.h cx/string.h \
    1.96 +$(build_dir)/printf$(OBJ_EXT): printf.c cx/printf.h cx/common.h cx/string.h \
    1.97   cx/allocator.h
    1.98  	echo "Compiling $<"
    1.99  	$(CC) -o $@ $(CFLAGS) -c $<
   1.100  
   1.101 -$(BUILD_DIR)/string$(OBJ_EXT): string.c cx/string.h cx/common.h cx/allocator.h \
   1.102 +$(build_dir)/string$(OBJ_EXT): string.c cx/string.h cx/common.h cx/allocator.h \
   1.103   cx/utils.h
   1.104  	echo "Compiling $<"
   1.105  	$(CC) -o $@ $(CFLAGS) -c $<
   1.106  
   1.107 -$(BUILD_DIR)/utils$(OBJ_EXT): utils.c cx/utils.h cx/common.h
   1.108 +$(build_dir)/utils$(OBJ_EXT): utils.c cx/utils.h cx/common.h
   1.109  	echo "Compiling $<"
   1.110  	$(CC) -o $@ $(CFLAGS) -c $<
   1.111  

mercurial