]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
cpupower: Make lib versioning scheme more obvious and fix version link
authorThomas Renninger <trenn@suse.de>
Fri, 7 Mar 2025 09:43:34 +0000 (10:43 +0100)
committerShuah Khan <shuah@kernel.org>
Fri, 7 Mar 2025 20:58:10 +0000 (13:58 -0700)
library versioning was broken:
libcpupower.so.0.0.1
libcpupower.so -> libcpupower.so.0.0.1
libcpupower.so.1 -> libcpupower.so.0.0.1

and is fixed by this patch to:
libcpupower.so.1.0.1
libcpupower.so -> libcpupower.so.1.0.1
libcpupower.so.1 -> libcpupower.so.1.0.1

Link: https://lore.kernel.org/r/20250307094334.39587-1-trenn@suse.de
Signed-off-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Shuah Khan <shuah@kernel.org>
tools/power/cpupower/Makefile

index 51a95239fe0631a5ec2d0c4f4497cdc043be36b4..835123add0ed1a1988e7e9c1791450fc881ef31c 100644 (file)
@@ -52,8 +52,11 @@ DESTDIR ?=
 # and _should_ modify the PACKAGE_BUGREPORT definition
 
 VERSION:=                      $(shell ./utils/version-gen.sh)
-LIB_MAJ=                       0.0.1
-LIB_MIN=                       1
+LIB_FIX=                       1
+LIB_MIN=                       0
+LIB_MAJ=                       1
+LIB_VER=                       $(LIB_MAJ).$(LIB_MIN).$(LIB_FIX)
+
 
 PACKAGE =                      cpupower
 PACKAGE_BUGREPORT =            linux-pm@vger.kernel.org
@@ -200,14 +203,14 @@ $(OUTPUT)lib/%.o: $(LIB_SRC) $(LIB_HEADERS)
        $(ECHO) "  CC      " $@
        $(QUIET) $(CC) $(CFLAGS) -fPIC -o $@ -c lib/$*.c
 
-$(OUTPUT)libcpupower.so.$(LIB_MAJ): $(LIB_OBJS)
+$(OUTPUT)libcpupower.so.$(LIB_VER): $(LIB_OBJS)
        $(ECHO) "  LD      " $@
        $(QUIET) $(CC) -shared $(CFLAGS) $(LDFLAGS) -o $@ \
-               -Wl,-soname,libcpupower.so.$(LIB_MIN) $(LIB_OBJS)
+               -Wl,-soname,libcpupower.so.$(LIB_MAJ) $(LIB_OBJS)
        @ln -sf $(@F) $(OUTPUT)libcpupower.so
-       @ln -sf $(@F) $(OUTPUT)libcpupower.so.$(LIB_MIN)
+       @ln -sf $(@F) $(OUTPUT)libcpupower.so.$(LIB_MAJ)
 
-libcpupower: $(OUTPUT)libcpupower.so.$(LIB_MAJ)
+libcpupower: $(OUTPUT)libcpupower.so.$(LIB_VER)
 
 # Let all .o files depend on its .c file and all headers
 # Might be worth to put this into utils/Makefile at some point of time
@@ -217,7 +220,7 @@ $(OUTPUT)%.o: %.c
        $(ECHO) "  CC      " $@
        $(QUIET) $(CC) $(CFLAGS) -I./lib -I ./utils -o $@ -c $*.c
 
-$(OUTPUT)cpupower: $(UTIL_OBJS) $(OUTPUT)libcpupower.so.$(LIB_MAJ)
+$(OUTPUT)cpupower: $(UTIL_OBJS) $(OUTPUT)libcpupower.so.$(LIB_VER)
        $(ECHO) "  CC      " $@
 ifeq ($(strip $(STATIC)),true)
        $(QUIET) $(CC) $(CFLAGS) $(LDFLAGS) $(UTIL_OBJS) -lrt -lpci -L$(OUTPUT) -o $@
@@ -262,7 +265,7 @@ update-po: $(OUTPUT)po/$(PACKAGE).pot
        done;
 endif
 
-compile-bench: $(OUTPUT)libcpupower.so.$(LIB_MAJ)
+compile-bench: $(OUTPUT)libcpupower.so.$(LIB_VER)
        @V=$(V) confdir=$(confdir) $(MAKE) -C bench O=$(OUTPUT)
 
 # we compile into subdirectories. if the target directory is not the