cpupower: mperf monitor - Use TSC to calculate max frequency if possible
[firefly-linux-kernel-4.4.55.git] / tools / power / cpupower / Makefile
index fea0e6a0a37a5e5539a2031cc1ff5c18e8ae1bd7..11521d2f0a4ce32f1b27b10b5bf261e1fe9e1d9d 100644 (file)
@@ -1,4 +1,4 @@
-# Makefile for cpupowerutils
+# Makefile for cpupower
 #
 # Copyright (C) 2005,2006 Dominik Brodowski <linux@dominikbrodowski.net>
 #
@@ -24,7 +24,7 @@
 
 # Set the following to `true' to make a unstripped, unoptimized
 # binary. Leave this set to `false' for production use.
-DEBUG ?=       false
+DEBUG ?=       true
 
 # make the build silent. Set this to something else to make it noisy again.
 V ?=           false
@@ -38,7 +38,7 @@ NLS ?=                true
 CPUFRQ_BENCH ?= true
 
 # Prefix to the directories we're installing to
-DESTDIR ?=     
+DESTDIR ?=
 
 # --- CONFIGURATION END ---
 
@@ -47,11 +47,11 @@ DESTDIR ?=
 # Package-related definitions. Distributions can modify the version
 # and _should_ modify the PACKAGE_BUGREPORT definition
 
-VERSION =                      009p1
+VERSION=                       $(shell ./utils/version-gen.sh)
 LIB_MAJ=                       0.0.0
 LIB_MIN=                       0
 
-PACKAGE =                      cpupowerutils
+PACKAGE =                      cpupower
 PACKAGE_BUGREPORT =            cpufreq@vger.kernel.org
 LANGUAGES =                    de fr it cs pt
 
@@ -66,7 +66,7 @@ mandir ?=     /usr/man
 includedir ?=  /usr/include
 libdir ?=      /usr/lib
 localedir ?=   /usr/share/locale
-docdir ?=       /usr/share/doc/packages/cpupowerutils
+docdir ?=       /usr/share/doc/packages/cpupower
 confdir ?=      /etc/
 
 # Toolchain: what tools do we use, and what options do they need:
@@ -110,7 +110,7 @@ WARNINGS += $(call cc-supports,-Wno-pointer-sign)
 WARNINGS += $(call cc-supports,-Wdeclaration-after-statement)
 WARNINGS += -Wshadow
 
-CPPFLAGS += -DVERSION=\"$(VERSION)\" -DPACKAGE=\"$(PACKAGE)\" \
+CFLAGS += -DVERSION=\"$(VERSION)\" -DPACKAGE=\"$(PACKAGE)\" \
                -DPACKAGE_BUGREPORT=\"$(PACKAGE_BUGREPORT)\" -D_GNU_SOURCE
 
 UTIL_OBJS =  utils/helpers/amd.o utils/helpers/topology.o utils/helpers/msr.o \
@@ -157,8 +157,7 @@ export QUIET ECHO
 
 # if DEBUG is enabled, then we do not strip or optimize
 ifeq ($(strip $(DEBUG)),true)
-       CFLAGS += -O1 -g
-       CPPFLAGS += -DDEBUG
+       CFLAGS += -O1 -g -DDEBUG
        STRIPCMD = /bin/true -Since_we_are_debugging
 else
        CFLAGS += $(OPTIMIZATION) -fomit-frame-pointer
@@ -168,20 +167,20 @@ endif
 
 # the actual make rules
 
-all: libcpufreq cpupower $(COMPILE_NLS) $(COMPILE_BENCH)
+all: libcpupower cpupower $(COMPILE_NLS) $(COMPILE_BENCH)
 
 lib/%.o: $(LIB_SRC) $(LIB_HEADERS)
        $(ECHO) "  CC      " $@
-       $(QUIET) $(CC) $(CPPFLAGS) $(CFLAGS) -fPIC -o $@ -c lib/$*.c
+       $(QUIET) $(CC) $(CFLAGS) -fPIC -o $@ -c lib/$*.c
 
-libcpufreq.so.$(LIB_MAJ): $(LIB_OBJS)
+libcpupower.so.$(LIB_MAJ): $(LIB_OBJS)
        $(ECHO) "  LD      " $@
-       $(QUIET) $(CC) -shared $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ \
-               -Wl,-soname,libcpufreq.so.$(LIB_MIN) $(LIB_OBJS)
-       @ln -sf $@ libcpufreq.so
-       @ln -sf $@ libcpufreq.so.$(LIB_MIN)
+       $(QUIET) $(CC) -shared $(CFLAGS) $(LDFLAGS) -o $@ \
+               -Wl,-soname,libcpupower.so.$(LIB_MIN) $(LIB_OBJS)
+       @ln -sf $@ libcpupower.so
+       @ln -sf $@ libcpupower.so.$(LIB_MIN)
 
-libcpufreq: libcpufreq.so.$(LIB_MAJ)
+libcpupower: libcpupower.so.$(LIB_MAJ)
 
 # 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
@@ -189,11 +188,11 @@ $(UTIL_OBJS): $(UTIL_HEADERS)
 
 .c.o:
        $(ECHO) "  CC      " $@
-       $(QUIET) $(CC) $(CFLAGS) $(CPPFLAGS) -I./lib -I ./utils -o $@ -c $*.c
+       $(QUIET) $(CC) $(CFLAGS) -I./lib -I ./utils -o $@ -c $*.c
 
-cpupower: $(UTIL_OBJS) libcpufreq.so.$(LIB_MAJ)
+cpupower: $(UTIL_OBJS) libcpupower.so.$(LIB_MAJ)
        $(ECHO) "  CC      " $@
-       $(QUIET) $(CC) $(CFLAGS) $(LDFLAGS) -lcpufreq -lrt -lpci -L. -o $@ $(UTIL_OBJS)
+       $(QUIET) $(CC) $(CFLAGS) $(LDFLAGS) -lcpupower -lrt -lpci -L. -o $@ $(UTIL_OBJS)
        $(QUIET) $(STRIPCMD) $@
 
 po/$(PACKAGE).pot: $(UTIL_SRC)
@@ -222,7 +221,7 @@ update-po: po/$(PACKAGE).pot
                fi; \
        done;
 
-compile-bench: libcpufreq.so.$(LIB_MAJ)
+compile-bench: libcpupower.so.$(LIB_MAJ)
        @V=$(V) confdir=$(confdir) $(MAKE) -C bench
 
 clean:
@@ -231,14 +230,14 @@ clean:
        -rm -f $(UTIL_BINS)
        -rm -f $(IDLE_OBJS)
        -rm -f cpupower
-       -rm -f libcpufreq.so*
+       -rm -f libcpupower.so*
        -rm -rf po/*.gmo po/*.pot
        $(MAKE) -C bench clean
 
 
 install-lib:
        $(INSTALL) -d $(DESTDIR)${libdir}
-       $(CP) libcpufreq.so* $(DESTDIR)${libdir}/
+       $(CP) libcpupower.so* $(DESTDIR)${libdir}/
        $(INSTALL) -d $(DESTDIR)${includedir}
        $(INSTALL_DATA) lib/cpufreq.h $(DESTDIR)${includedir}/cpufreq.h
 
@@ -257,8 +256,8 @@ install-man:
 install-gmo:
        $(INSTALL) -d $(DESTDIR)${localedir}
        for HLANG in $(LANGUAGES); do \
-               echo '$(INSTALL_DATA) -D po/$$HLANG.gmo $(DESTDIR)${localedir}/$$HLANG/LC_MESSAGES/cpupowerutils.mo'; \
-               $(INSTALL_DATA) -D po/$$HLANG.gmo $(DESTDIR)${localedir}/$$HLANG/LC_MESSAGES/cpupowerutils.mo; \
+               echo '$(INSTALL_DATA) -D po/$$HLANG.gmo $(DESTDIR)${localedir}/$$HLANG/LC_MESSAGES/cpupower.mo'; \
+               $(INSTALL_DATA) -D po/$$HLANG.gmo $(DESTDIR)${localedir}/$$HLANG/LC_MESSAGES/cpupower.mo; \
        done;
 
 install-bench:
@@ -268,14 +267,13 @@ install-bench:
 install: all install-lib install-tools install-man $(INSTALL_NLS) $(INSTALL_BENCH)
 
 uninstall:
-       - rm -f $(DESTDIR)${libdir}/libcpufreq.*
+       - rm -f $(DESTDIR)${libdir}/libcpupower.*
        - rm -f $(DESTDIR)${includedir}/cpufreq.h
        - rm -f $(DESTDIR)${bindir}/utils/cpupower
        - rm -f $(DESTDIR)${mandir}/man1/cpufreq-set.1
        - rm -f $(DESTDIR)${mandir}/man1/cpufreq-info.1
        - for HLANG in $(LANGUAGES); do \
-               rm -f $(DESTDIR)${localedir}/$$HLANG/LC_MESSAGES/cpupowerutils.mo; \
+               rm -f $(DESTDIR)${localedir}/$$HLANG/LC_MESSAGES/cpupower.mo; \
          done;
 
-.PHONY: all utils libcpufreq update-po create-gmo install-lib install-tools install-man install-gmo install uninstall \
-       clean 
+.PHONY: all utils libcpupower update-po create-gmo install-lib install-tools install-man install-gmo install uninstall clean