diff options
Diffstat (limited to 'tools/power/cpupower/Makefile')
-rw-r--r-- | tools/power/cpupower/Makefile | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/tools/power/cpupower/Makefile b/tools/power/cpupower/Makefile index aef1e3b41792..5d30dadbc4e7 100644 --- a/tools/power/cpupower/Makefile +++ b/tools/power/cpupower/Makefile | |||
@@ -24,7 +24,7 @@ | |||
24 | 24 | ||
25 | # Set the following to `true' to make a unstripped, unoptimized | 25 | # Set the following to `true' to make a unstripped, unoptimized |
26 | # binary. Leave this set to `false' for production use. | 26 | # binary. Leave this set to `false' for production use. |
27 | DEBUG ?= true | 27 | DEBUG ?= false |
28 | 28 | ||
29 | # make the build silent. Set this to something else to make it noisy again. | 29 | # make the build silent. Set this to something else to make it noisy again. |
30 | V ?= false | 30 | V ?= false |
@@ -145,12 +145,13 @@ endif | |||
145 | CFLAGS += $(WARNINGS) | 145 | CFLAGS += $(WARNINGS) |
146 | 146 | ||
147 | ifeq ($(strip $(V)),false) | 147 | ifeq ($(strip $(V)),false) |
148 | QUIET=@$(PWD)/build/ccdv | 148 | QUIET=@ |
149 | HOST_PROGS=build/ccdv | 149 | ECHO=@echo |
150 | else | 150 | else |
151 | QUIET= | 151 | QUIET= |
152 | HOST_PROGS= | 152 | ECHO=@\# |
153 | endif | 153 | endif |
154 | export QUIET ECHO | ||
154 | 155 | ||
155 | # if DEBUG is enabled, then we do not strip or optimize | 156 | # if DEBUG is enabled, then we do not strip or optimize |
156 | ifeq ($(strip $(DEBUG)),true) | 157 | ifeq ($(strip $(DEBUG)),true) |
@@ -165,17 +166,14 @@ endif | |||
165 | 166 | ||
166 | # the actual make rules | 167 | # the actual make rules |
167 | 168 | ||
168 | all: ccdv libcpufreq cpupower $(COMPILE_NLS) $(COMPILE_BENCH) | 169 | all: libcpufreq cpupower $(COMPILE_NLS) $(COMPILE_BENCH) |
169 | 170 | ||
170 | ccdv: build/ccdv | 171 | lib/%.o: $(LIB_SRC) $(LIB_HEADERS) |
171 | build/ccdv: build/ccdv.c | 172 | $(ECHO) " CC " $@ |
172 | @echo "Building ccdv" | ||
173 | @$(HOSTCC) -O1 $< -o $@ | ||
174 | |||
175 | lib/%.o: $(LIB_SRC) $(LIB_HEADERS) build/ccdv | ||
176 | $(QUIET) $(CC) $(CPPFLAGS) $(CFLAGS) -fPIC -o $@ -c lib/$*.c | 173 | $(QUIET) $(CC) $(CPPFLAGS) $(CFLAGS) -fPIC -o $@ -c lib/$*.c |
177 | 174 | ||
178 | libcpufreq.so.$(LIB_MAJ): $(LIB_OBJS) | 175 | libcpufreq.so.$(LIB_MAJ): $(LIB_OBJS) |
176 | $(ECHO) " LD " $@ | ||
179 | $(QUIET) $(CC) -shared $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ \ | 177 | $(QUIET) $(CC) -shared $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ \ |
180 | -Wl,-soname,libcpufreq.so.$(LIB_MIN) $(LIB_OBJS) | 178 | -Wl,-soname,libcpufreq.so.$(LIB_MIN) $(LIB_OBJS) |
181 | @ln -sf $@ libcpufreq.so | 179 | @ln -sf $@ libcpufreq.so |
@@ -188,11 +186,13 @@ libcpufreq: libcpufreq.so.$(LIB_MAJ) | |||
188 | $(UTIL_OBJS): $(UTIL_HEADERS) | 186 | $(UTIL_OBJS): $(UTIL_HEADERS) |
189 | 187 | ||
190 | .c.o: | 188 | .c.o: |
189 | $(ECHO) " CC " $@ | ||
191 | $(QUIET) $(CC) $(CFLAGS) $(CPPFLAGS) -I./lib -I ./utils -o $@ -c $*.c | 190 | $(QUIET) $(CC) $(CFLAGS) $(CPPFLAGS) -I./lib -I ./utils -o $@ -c $*.c |
192 | 191 | ||
193 | cpupower: $(UTIL_OBJS) libcpufreq | 192 | cpupower: $(UTIL_OBJS) libcpufreq.so.$(LIB_MAJ) |
193 | $(ECHO) " CC " $@ | ||
194 | $(QUIET) $(CC) $(CFLAGS) $(LDFLAGS) -lcpufreq -lrt -lpci -L. -o $@ $(UTIL_OBJS) | 194 | $(QUIET) $(CC) $(CFLAGS) $(LDFLAGS) -lcpufreq -lrt -lpci -L. -o $@ $(UTIL_OBJS) |
195 | $(STRIPCMD) $@ | 195 | $(QUIET) $(STRIPCMD) $@ |
196 | 196 | ||
197 | po/$(PACKAGE).pot: $(UTIL_SRC) | 197 | po/$(PACKAGE).pot: $(UTIL_SRC) |
198 | @xgettext --default-domain=$(PACKAGE) --add-comments \ | 198 | @xgettext --default-domain=$(PACKAGE) --add-comments \ |
@@ -223,7 +223,6 @@ clean: | |||
223 | -rm -f $(IDLE_OBJS) | 223 | -rm -f $(IDLE_OBJS) |
224 | -rm -f cpupower | 224 | -rm -f cpupower |
225 | -rm -f libcpufreq.so* | 225 | -rm -f libcpufreq.so* |
226 | -rm -f build/ccdv | ||
227 | -rm -rf po/*.gmo po/*.pot | 226 | -rm -rf po/*.gmo po/*.pot |
228 | $(MAKE) -C bench clean | 227 | $(MAKE) -C bench clean |
229 | 228 | ||
@@ -256,7 +255,7 @@ install-gmo: | |||
256 | install-bench: | 255 | install-bench: |
257 | @#DESTDIR must be set from outside to survive | 256 | @#DESTDIR must be set from outside to survive |
258 | @sbindir=$(sbindir) bindir=$(bindir) docdir=$(docdir) confdir=$(confdir) $(MAKE) -C bench install | 257 | @sbindir=$(sbindir) bindir=$(bindir) docdir=$(docdir) confdir=$(confdir) $(MAKE) -C bench install |
259 | 258 | ||
260 | install: all install-lib install-tools install-man $(INSTALL_NLS) $(INSTALL_BENCH) | 259 | install: all install-lib install-tools install-man $(INSTALL_NLS) $(INSTALL_BENCH) |
261 | 260 | ||
262 | uninstall: | 261 | uninstall: |
@@ -269,5 +268,5 @@ uninstall: | |||
269 | rm -f $(DESTDIR)${localedir}/$$HLANG/LC_MESSAGES/cpupowerutils.mo; \ | 268 | rm -f $(DESTDIR)${localedir}/$$HLANG/LC_MESSAGES/cpupowerutils.mo; \ |
270 | done; | 269 | done; |
271 | 270 | ||
272 | .PHONY: all utils libcpufreq ccdv update-po update-gmo install-lib install-tools install-man install-gmo install uninstall \ | 271 | .PHONY: all utils libcpufreq update-po update-gmo install-lib install-tools install-man install-gmo install uninstall \ |
273 | clean | 272 | clean |