Skip to content

Commit fffadbd

Browse files
watologo1Shuah Khan
authored andcommitted
cpupower: Make lib versioning scheme more obvious and fix version link
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/[email protected] Signed-off-by: Thomas Renninger <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
1 parent f89cb9c commit fffadbd

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

tools/power/cpupower/Makefile

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,11 @@ DESTDIR ?=
5252
# and _should_ modify the PACKAGE_BUGREPORT definition
5353

5454
VERSION:= $(shell ./utils/version-gen.sh)
55-
LIB_MAJ= 0.0.1
56-
LIB_MIN= 1
55+
LIB_FIX= 1
56+
LIB_MIN= 0
57+
LIB_MAJ= 1
58+
LIB_VER= $(LIB_MAJ).$(LIB_MIN).$(LIB_FIX)
59+
5760

5861
PACKAGE = cpupower
5962
PACKAGE_BUGREPORT = [email protected]
@@ -200,14 +203,14 @@ $(OUTPUT)lib/%.o: $(LIB_SRC) $(LIB_HEADERS)
200203
$(ECHO) " CC " $@
201204
$(QUIET) $(CC) $(CFLAGS) -fPIC -o $@ -c lib/$*.c
202205

203-
$(OUTPUT)libcpupower.so.$(LIB_MAJ): $(LIB_OBJS)
206+
$(OUTPUT)libcpupower.so.$(LIB_VER): $(LIB_OBJS)
204207
$(ECHO) " LD " $@
205208
$(QUIET) $(CC) -shared $(CFLAGS) $(LDFLAGS) -o $@ \
206-
-Wl,-soname,libcpupower.so.$(LIB_MIN) $(LIB_OBJS)
209+
-Wl,-soname,libcpupower.so.$(LIB_MAJ) $(LIB_OBJS)
207210
@ln -sf $(@F) $(OUTPUT)libcpupower.so
208-
@ln -sf $(@F) $(OUTPUT)libcpupower.so.$(LIB_MIN)
211+
@ln -sf $(@F) $(OUTPUT)libcpupower.so.$(LIB_MAJ)
209212

210-
libcpupower: $(OUTPUT)libcpupower.so.$(LIB_MAJ)
213+
libcpupower: $(OUTPUT)libcpupower.so.$(LIB_VER)
211214

212215
# Let all .o files depend on its .c file and all headers
213216
# Might be worth to put this into utils/Makefile at some point of time
@@ -217,7 +220,7 @@ $(OUTPUT)%.o: %.c
217220
$(ECHO) " CC " $@
218221
$(QUIET) $(CC) $(CFLAGS) -I./lib -I ./utils -o $@ -c $*.c
219222

220-
$(OUTPUT)cpupower: $(UTIL_OBJS) $(OUTPUT)libcpupower.so.$(LIB_MAJ)
223+
$(OUTPUT)cpupower: $(UTIL_OBJS) $(OUTPUT)libcpupower.so.$(LIB_VER)
221224
$(ECHO) " CC " $@
222225
ifeq ($(strip $(STATIC)),true)
223226
$(QUIET) $(CC) $(CFLAGS) $(LDFLAGS) $(UTIL_OBJS) -lrt -lpci -L$(OUTPUT) -o $@
@@ -262,7 +265,7 @@ update-po: $(OUTPUT)po/$(PACKAGE).pot
262265
done;
263266
endif
264267

265-
compile-bench: $(OUTPUT)libcpupower.so.$(LIB_MAJ)
268+
compile-bench: $(OUTPUT)libcpupower.so.$(LIB_VER)
266269
@V=$(V) confdir=$(confdir) $(MAKE) -C bench O=$(OUTPUT)
267270

268271
# we compile into subdirectories. if the target directory is not the

0 commit comments

Comments
 (0)