diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2011-04-20 14:01:39 -0400 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2011-07-29 12:35:39 -0400 |
commit | af594f0ceb73c5bd984c89f3386bd7e8ecc471f5 (patch) | |
tree | 9960b1ff6d27cf096961f0c8012ec0489bc6301e /tools/power/cpupower/Makefile | |
parent | a1ce5ba2b7d08ab6347dc254f86f70e91c5f1a44 (diff) |
cpupowerutils: use kernel version-derived version string
As cpupowerutils is intended to be included into the kernel sources,
use the kernel versioning instead of a custom version.
The script utils/version-gen.sh is largely based on the script already
found in tools/perf/util/PERF-VERSION-GEN .
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'tools/power/cpupower/Makefile')
-rw-r--r-- | tools/power/cpupower/Makefile | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/tools/power/cpupower/Makefile b/tools/power/cpupower/Makefile index 62c2716a9588..90d079e0e48d 100644 --- a/tools/power/cpupower/Makefile +++ b/tools/power/cpupower/Makefile | |||
@@ -47,7 +47,7 @@ DESTDIR ?= | |||
47 | # Package-related definitions. Distributions can modify the version | 47 | # Package-related definitions. Distributions can modify the version |
48 | # and _should_ modify the PACKAGE_BUGREPORT definition | 48 | # and _should_ modify the PACKAGE_BUGREPORT definition |
49 | 49 | ||
50 | VERSION = 009p1 | 50 | VERSION= $(shell ./utils/version-gen.sh) |
51 | LIB_MAJ= 0.0.0 | 51 | LIB_MAJ= 0.0.0 |
52 | LIB_MIN= 0 | 52 | LIB_MIN= 0 |
53 | 53 | ||
@@ -110,7 +110,7 @@ WARNINGS += $(call cc-supports,-Wno-pointer-sign) | |||
110 | WARNINGS += $(call cc-supports,-Wdeclaration-after-statement) | 110 | WARNINGS += $(call cc-supports,-Wdeclaration-after-statement) |
111 | WARNINGS += -Wshadow | 111 | WARNINGS += -Wshadow |
112 | 112 | ||
113 | CPPFLAGS += -DVERSION=\"$(VERSION)\" -DPACKAGE=\"$(PACKAGE)\" \ | 113 | CFLAGS += -DVERSION=\"$(VERSION)\" -DPACKAGE=\"$(PACKAGE)\" \ |
114 | -DPACKAGE_BUGREPORT=\"$(PACKAGE_BUGREPORT)\" -D_GNU_SOURCE | 114 | -DPACKAGE_BUGREPORT=\"$(PACKAGE_BUGREPORT)\" -D_GNU_SOURCE |
115 | 115 | ||
116 | UTIL_OBJS = utils/helpers/amd.o utils/helpers/topology.o utils/helpers/msr.o \ | 116 | UTIL_OBJS = utils/helpers/amd.o utils/helpers/topology.o utils/helpers/msr.o \ |
@@ -157,8 +157,7 @@ export QUIET ECHO | |||
157 | 157 | ||
158 | # if DEBUG is enabled, then we do not strip or optimize | 158 | # if DEBUG is enabled, then we do not strip or optimize |
159 | ifeq ($(strip $(DEBUG)),true) | 159 | ifeq ($(strip $(DEBUG)),true) |
160 | CFLAGS += -O1 -g | 160 | CFLAGS += -O1 -g -DDEBUG |
161 | CPPFLAGS += -DDEBUG | ||
162 | STRIPCMD = /bin/true -Since_we_are_debugging | 161 | STRIPCMD = /bin/true -Since_we_are_debugging |
163 | else | 162 | else |
164 | CFLAGS += $(OPTIMIZATION) -fomit-frame-pointer | 163 | CFLAGS += $(OPTIMIZATION) -fomit-frame-pointer |
@@ -172,11 +171,11 @@ all: libcpufreq cpupower $(COMPILE_NLS) $(COMPILE_BENCH) | |||
172 | 171 | ||
173 | lib/%.o: $(LIB_SRC) $(LIB_HEADERS) | 172 | lib/%.o: $(LIB_SRC) $(LIB_HEADERS) |
174 | $(ECHO) " CC " $@ | 173 | $(ECHO) " CC " $@ |
175 | $(QUIET) $(CC) $(CPPFLAGS) $(CFLAGS) -fPIC -o $@ -c lib/$*.c | 174 | $(QUIET) $(CC) $(CFLAGS) -fPIC -o $@ -c lib/$*.c |
176 | 175 | ||
177 | libcpufreq.so.$(LIB_MAJ): $(LIB_OBJS) | 176 | libcpufreq.so.$(LIB_MAJ): $(LIB_OBJS) |
178 | $(ECHO) " LD " $@ | 177 | $(ECHO) " LD " $@ |
179 | $(QUIET) $(CC) -shared $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ \ | 178 | $(QUIET) $(CC) -shared $(CFLAGS) $(LDFLAGS) -o $@ \ |
180 | -Wl,-soname,libcpufreq.so.$(LIB_MIN) $(LIB_OBJS) | 179 | -Wl,-soname,libcpufreq.so.$(LIB_MIN) $(LIB_OBJS) |
181 | @ln -sf $@ libcpufreq.so | 180 | @ln -sf $@ libcpufreq.so |
182 | @ln -sf $@ libcpufreq.so.$(LIB_MIN) | 181 | @ln -sf $@ libcpufreq.so.$(LIB_MIN) |
@@ -189,7 +188,7 @@ $(UTIL_OBJS): $(UTIL_HEADERS) | |||
189 | 188 | ||
190 | .c.o: | 189 | .c.o: |
191 | $(ECHO) " CC " $@ | 190 | $(ECHO) " CC " $@ |
192 | $(QUIET) $(CC) $(CFLAGS) $(CPPFLAGS) -I./lib -I ./utils -o $@ -c $*.c | 191 | $(QUIET) $(CC) $(CFLAGS) -I./lib -I ./utils -o $@ -c $*.c |
193 | 192 | ||
194 | cpupower: $(UTIL_OBJS) libcpufreq.so.$(LIB_MAJ) | 193 | cpupower: $(UTIL_OBJS) libcpufreq.so.$(LIB_MAJ) |
195 | $(ECHO) " CC " $@ | 194 | $(ECHO) " CC " $@ |