~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/tools/power/cpupower/Makefile

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /tools/power/cpupower/Makefile (Version linux-6.12-rc7) and /tools/power/cpupower/Makefile (Version linux-5.1.21)


  1 # SPDX-License-Identifier: GPL-2.0-only        << 
  2 # Makefile for cpupower                             1 # Makefile for cpupower
  3 #                                                   2 #
  4 # Copyright (C) 2005,2006 Dominik Brodowski <li      3 # Copyright (C) 2005,2006 Dominik Brodowski <linux@dominikbrodowski.net>
  5 #                                                   4 #
  6 # Based largely on the Makefile for udev by:        5 # Based largely on the Makefile for udev by:
  7 #                                                   6 #
  8 # Copyright (C) 2003,2004 Greg Kroah-Hartman <g      7 # Copyright (C) 2003,2004 Greg Kroah-Hartman <greg@kroah.com>
  9 #                                                   8 #
                                                   >>   9 # This program is free software; you can redistribute it and/or modify
                                                   >>  10 # it under the terms of the GNU General Public License as published by
                                                   >>  11 # the Free Software Foundation; version 2 of the License.
                                                   >>  12 #
                                                   >>  13 # This program is distributed in the hope that it will be useful,
                                                   >>  14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
                                                   >>  15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
                                                   >>  16 # General Public License for more details.
                                                   >>  17 #
                                                   >>  18 # You should have received a copy of the GNU General Public License
                                                   >>  19 # along with this program; if not, write to the Free Software
                                                   >>  20 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
                                                   >>  21 #
 10 OUTPUT=./                                          22 OUTPUT=./
 11 ifeq ("$(origin O)", "command line")               23 ifeq ("$(origin O)", "command line")
 12         OUTPUT := $(O)/                            24         OUTPUT := $(O)/
 13 endif                                              25 endif
 14                                                    26 
 15 ifneq ($(OUTPUT),)                                 27 ifneq ($(OUTPUT),)
 16 # check that the output directory actually exi     28 # check that the output directory actually exists
 17 OUTDIR := $(shell cd $(OUTPUT) && pwd)             29 OUTDIR := $(shell cd $(OUTPUT) && pwd)
 18 $(if $(OUTDIR),, $(error output directory "$(O     30 $(if $(OUTDIR),, $(error output directory "$(OUTPUT)" does not exist))
 19 endif                                              31 endif
 20                                                    32 
                                                   >>  33 include ../../scripts/Makefile.arch
 21                                                    34 
 22 # --- CONFIGURATION BEGIN ---                      35 # --- CONFIGURATION BEGIN ---
 23                                                    36 
 24 # Set the following to `true' to make a unstri     37 # Set the following to `true' to make a unstripped, unoptimized
 25 # binary. Leave this set to `false' for produc     38 # binary. Leave this set to `false' for production use.
 26 DEBUG ?=        true                               39 DEBUG ?=        true
 27                                                    40 
 28 # make the build silent. Set this to something     41 # make the build silent. Set this to something else to make it noisy again.
 29 V ?=            false                              42 V ?=            false
 30                                                    43 
 31 # Internationalization support (output in diff     44 # Internationalization support (output in different languages).
 32 # Requires gettext.                                45 # Requires gettext.
 33 NLS ?=          true                               46 NLS ?=          true
 34                                                    47 
 35 # Set the following to 'true' to build/install     48 # Set the following to 'true' to build/install the
 36 # cpufreq-bench benchmarking tool                  49 # cpufreq-bench benchmarking tool
 37 CPUFREQ_BENCH ?= true                              50 CPUFREQ_BENCH ?= true
 38                                                    51 
 39 # Do not build libraries, but build the code i     52 # Do not build libraries, but build the code in statically
 40 # Libraries are still built, otherwise the Mak     53 # Libraries are still built, otherwise the Makefile code would
 41 # be rather ugly.                                  54 # be rather ugly.
 42 export STATIC ?= false                             55 export STATIC ?= false
 43                                                    56 
 44 # Prefix to the directories we're installing t     57 # Prefix to the directories we're installing to
 45 DESTDIR ?=                                         58 DESTDIR ?=
 46                                                    59 
 47 # --- CONFIGURATION END ---                        60 # --- CONFIGURATION END ---
 48                                                    61 
 49                                                    62 
 50                                                    63 
 51 # Package-related definitions. Distributions c     64 # Package-related definitions. Distributions can modify the version
 52 # and _should_ modify the PACKAGE_BUGREPORT de     65 # and _should_ modify the PACKAGE_BUGREPORT definition
 53                                                    66 
 54 VERSION:=                       $(shell ./util !!  67 VERSION=                        $(shell ./utils/version-gen.sh)
 55 LIB_MAJ=                        0.0.1              68 LIB_MAJ=                        0.0.1
 56 LIB_MIN=                        1              !!  69 LIB_MIN=                        0
 57                                                    70 
 58 PACKAGE =                       cpupower           71 PACKAGE =                       cpupower
 59 PACKAGE_BUGREPORT =             linux-pm@vger.     72 PACKAGE_BUGREPORT =             linux-pm@vger.kernel.org
 60 LANGUAGES =                     de fr it cs pt !!  73 LANGUAGES =                     de fr it cs pt
 61                                                    74 
 62                                                    75 
 63 # Directory definitions. These are default and     76 # Directory definitions. These are default and most probably
 64 # do not need to be changed. Please note that      77 # do not need to be changed. Please note that DESTDIR is
 65 # added in front of any of them                    78 # added in front of any of them
 66                                                    79 
 67 bindir ?=       /usr/bin                           80 bindir ?=       /usr/bin
 68 sbindir ?=      /usr/sbin                          81 sbindir ?=      /usr/sbin
 69 mandir ?=       /usr/man                           82 mandir ?=       /usr/man
 70 libdir ?=       /usr/lib                       << 
 71 includedir ?=   /usr/include                       83 includedir ?=   /usr/include
                                                   >>  84 ifeq ($(IS_64_BIT), 1)
                                                   >>  85 libdir ?=       /usr/lib64
                                                   >>  86 else
                                                   >>  87 libdir ?=       /usr/lib
                                                   >>  88 endif
 72 localedir ?=    /usr/share/locale                  89 localedir ?=    /usr/share/locale
 73 docdir ?=       /usr/share/doc/packages/cpupow     90 docdir ?=       /usr/share/doc/packages/cpupower
 74 confdir ?=      /etc/                              91 confdir ?=      /etc/
 75 bash_completion_dir ?= /usr/share/bash-complet     92 bash_completion_dir ?= /usr/share/bash-completion/completions
 76                                                    93 
 77 # Toolchain: what tools do we use, and what op     94 # Toolchain: what tools do we use, and what options do they need:
 78                                                    95 
 79 CP = cp -fpR                                       96 CP = cp -fpR
 80 INSTALL = /usr/bin/install -c                      97 INSTALL = /usr/bin/install -c
 81 INSTALL_PROGRAM = ${INSTALL}                       98 INSTALL_PROGRAM = ${INSTALL}
 82 INSTALL_DATA  = ${INSTALL} -m 644                  99 INSTALL_DATA  = ${INSTALL} -m 644
 83 #bash completion scripts get sourced and so th    100 #bash completion scripts get sourced and so they should be rw only.
 84 INSTALL_SCRIPT = ${INSTALL} -m 644                101 INSTALL_SCRIPT = ${INSTALL} -m 644
 85                                                   102 
 86 # If you are running a cross compiler, you may    103 # If you are running a cross compiler, you may want to set this
 87 # to something more interesting, like "arm-lin    104 # to something more interesting, like "arm-linux-".  If you want
 88 # to compile vs uClibc, that can be done here     105 # to compile vs uClibc, that can be done here as well.
 89 CROSS = #/usr/i386-linux-uclibc/usr/bin/i386-u    106 CROSS = #/usr/i386-linux-uclibc/usr/bin/i386-uclibc-
 90 CC = $(CROSS)gcc                                  107 CC = $(CROSS)gcc
 91 LD = $(CROSS)gcc                                  108 LD = $(CROSS)gcc
 92 AR = $(CROSS)ar                                   109 AR = $(CROSS)ar
 93 STRIP = $(CROSS)strip                             110 STRIP = $(CROSS)strip
 94 RANLIB = $(CROSS)ranlib                           111 RANLIB = $(CROSS)ranlib
 95 HOSTCC = gcc                                      112 HOSTCC = gcc
 96 MKDIR = mkdir                                     113 MKDIR = mkdir
 97                                                   114 
                                                   >> 115 
 98 # Now we set up the build system                  116 # Now we set up the build system
 99 #                                                 117 #
100                                                   118 
101 GMO_FILES = ${shell for HLANG in ${LANGUAGES};    119 GMO_FILES = ${shell for HLANG in ${LANGUAGES}; do echo $(OUTPUT)po/$$HLANG.gmo; done;}
102                                                   120 
103 export CROSS CC AR STRIP RANLIB CFLAGS LDFLAGS    121 export CROSS CC AR STRIP RANLIB CFLAGS LDFLAGS LIB_OBJS
104                                                   122 
105 # check if compiler option is supported           123 # check if compiler option is supported
106 cc-supports = ${shell if $(CC) ${1} -S -o /dev    124 cc-supports = ${shell if $(CC) ${1} -S -o /dev/null -x c /dev/null > /dev/null 2>&1; then echo "$(1)"; fi;}
107                                                   125 
108 # use '-Os' optimization if available, else us    126 # use '-Os' optimization if available, else use -O2
109 OPTIMIZATION := $(call cc-supports,-Os,-O2)       127 OPTIMIZATION := $(call cc-supports,-Os,-O2)
110                                                   128 
111 WARNINGS := -Wall -Wchar-subscripts -Wpointer-    129 WARNINGS := -Wall -Wchar-subscripts -Wpointer-arith -Wsign-compare
112 WARNINGS += $(call cc-supports,-Wno-pointer-si    130 WARNINGS += $(call cc-supports,-Wno-pointer-sign)
113 WARNINGS += $(call cc-supports,-Wdeclaration-a    131 WARNINGS += $(call cc-supports,-Wdeclaration-after-statement)
114 WARNINGS += -Wshadow                              132 WARNINGS += -Wshadow
115                                                   133 
116 override CFLAGS += -DVERSION=\"$(VERSION)\" -D    134 override CFLAGS += -DVERSION=\"$(VERSION)\" -DPACKAGE=\"$(PACKAGE)\" \
117                 -DPACKAGE_BUGREPORT=\"$(PACKAG    135                 -DPACKAGE_BUGREPORT=\"$(PACKAGE_BUGREPORT)\" -D_GNU_SOURCE
118                                                   136 
119 UTIL_OBJS =  utils/helpers/amd.o utils/helpers    137 UTIL_OBJS =  utils/helpers/amd.o utils/helpers/msr.o \
120         utils/helpers/sysfs.o utils/helpers/mi    138         utils/helpers/sysfs.o utils/helpers/misc.o utils/helpers/cpuid.o \
121         utils/helpers/pci.o utils/helpers/bitm    139         utils/helpers/pci.o utils/helpers/bitmask.o \
122         utils/idle_monitor/nhm_idle.o utils/id    140         utils/idle_monitor/nhm_idle.o utils/idle_monitor/snb_idle.o \
123         utils/idle_monitor/hsw_ext_idle.o \       141         utils/idle_monitor/hsw_ext_idle.o \
124         utils/idle_monitor/amd_fam14h_idle.o u    142         utils/idle_monitor/amd_fam14h_idle.o utils/idle_monitor/cpuidle_sysfs.o \
125         utils/idle_monitor/mperf_monitor.o uti    143         utils/idle_monitor/mperf_monitor.o utils/idle_monitor/cpupower-monitor.o \
126         utils/idle_monitor/rapl_monitor.o \    << 
127         utils/cpupower.o utils/cpufreq-info.o     144         utils/cpupower.o utils/cpufreq-info.o utils/cpufreq-set.o \
128         utils/cpupower-set.o utils/cpupower-in    145         utils/cpupower-set.o utils/cpupower-info.o utils/cpuidle-info.o \
129         utils/cpuidle-set.o utils/powercap-inf !! 146         utils/cpuidle-set.o
130                                                   147 
131 UTIL_SRC := $(UTIL_OBJS:.o=.c)                    148 UTIL_SRC := $(UTIL_OBJS:.o=.c)
132                                                   149 
133 UTIL_OBJS := $(addprefix $(OUTPUT),$(UTIL_OBJS    150 UTIL_OBJS := $(addprefix $(OUTPUT),$(UTIL_OBJS))
134                                                   151 
135 UTIL_HEADERS = utils/helpers/helpers.h utils/i    152 UTIL_HEADERS = utils/helpers/helpers.h utils/idle_monitor/cpupower-monitor.h \
136         utils/helpers/bitmask.h \                 153         utils/helpers/bitmask.h \
137         utils/idle_monitor/idle_monitors.h uti    154         utils/idle_monitor/idle_monitors.h utils/idle_monitor/idle_monitors.def
138                                                   155 
139 LIB_HEADERS =   lib/cpufreq.h lib/cpupower.h l !! 156 LIB_HEADERS =   lib/cpufreq.h lib/cpupower.h lib/cpuidle.h
140         lib/powercap.h                         !! 157 LIB_SRC =       lib/cpufreq.c lib/cpupower.c lib/cpuidle.c
141 LIB_SRC =       lib/cpufreq.c lib/cpupower.c l !! 158 LIB_OBJS =      lib/cpufreq.o lib/cpupower.o lib/cpuidle.o
142         lib/powercap.c                         << 
143 LIB_OBJS =      lib/cpufreq.o lib/cpupower.o l << 
144         lib/powercap.o                         << 
145 LIB_OBJS :=     $(addprefix $(OUTPUT),$(LIB_OB    159 LIB_OBJS :=     $(addprefix $(OUTPUT),$(LIB_OBJS))
146                                                   160 
147 override CFLAGS +=      -pipe                     161 override CFLAGS +=      -pipe
148                                                   162 
149 ifeq ($(strip $(NLS)),true)                       163 ifeq ($(strip $(NLS)),true)
150         INSTALL_NLS += install-gmo                164         INSTALL_NLS += install-gmo
151         COMPILE_NLS += create-gmo                 165         COMPILE_NLS += create-gmo
152         override CFLAGS += -DNLS                  166         override CFLAGS += -DNLS
153 endif                                             167 endif
154                                                   168 
155 ifeq ($(strip $(CPUFREQ_BENCH)),true)             169 ifeq ($(strip $(CPUFREQ_BENCH)),true)
156         INSTALL_BENCH += install-bench            170         INSTALL_BENCH += install-bench
157         COMPILE_BENCH += compile-bench            171         COMPILE_BENCH += compile-bench
158 endif                                             172 endif
159                                                   173 
160 ifeq ($(strip $(STATIC)),true)                    174 ifeq ($(strip $(STATIC)),true)
161         UTIL_OBJS += $(LIB_OBJS)                  175         UTIL_OBJS += $(LIB_OBJS)
162         UTIL_HEADERS += $(LIB_HEADERS)            176         UTIL_HEADERS += $(LIB_HEADERS)
163         UTIL_SRC += $(LIB_SRC)                    177         UTIL_SRC += $(LIB_SRC)
164 endif                                             178 endif
165                                                   179 
166 override CFLAGS += $(WARNINGS)                    180 override CFLAGS += $(WARNINGS)
167                                                   181 
168 ifeq ($(strip $(V)),false)                        182 ifeq ($(strip $(V)),false)
169         QUIET=@                                   183         QUIET=@
170         ECHO=@echo                                184         ECHO=@echo
171 else                                              185 else
172         QUIET=                                    186         QUIET=
173         ECHO=@\#                                  187         ECHO=@\#
174 endif                                             188 endif
175 export QUIET ECHO                                 189 export QUIET ECHO
176                                                   190 
177 # if DEBUG is enabled, then we do not strip or    191 # if DEBUG is enabled, then we do not strip or optimize
178 ifeq ($(strip $(DEBUG)),true)                     192 ifeq ($(strip $(DEBUG)),true)
179         override CFLAGS += -O1 -g -DDEBUG         193         override CFLAGS += -O1 -g -DDEBUG
180         STRIPCMD = /bin/true -Since_we_are_deb    194         STRIPCMD = /bin/true -Since_we_are_debugging
181 else                                              195 else
182         override CFLAGS += $(OPTIMIZATION) -fo    196         override CFLAGS += $(OPTIMIZATION) -fomit-frame-pointer
183         STRIPCMD = $(STRIP) -s --remove-sectio    197         STRIPCMD = $(STRIP) -s --remove-section=.note --remove-section=.comment
184 endif                                             198 endif
185                                                   199 
186                                                   200 
187 # the actual make rules                           201 # the actual make rules
188                                                   202 
189 all: libcpupower $(OUTPUT)cpupower $(COMPILE_N    203 all: libcpupower $(OUTPUT)cpupower $(COMPILE_NLS) $(COMPILE_BENCH)
190                                                   204 
191 $(OUTPUT)lib/%.o: $(LIB_SRC) $(LIB_HEADERS)       205 $(OUTPUT)lib/%.o: $(LIB_SRC) $(LIB_HEADERS)
192         $(ECHO) "  CC      " $@                   206         $(ECHO) "  CC      " $@
193         $(QUIET) $(CC) $(CFLAGS) -fPIC -o $@ -    207         $(QUIET) $(CC) $(CFLAGS) -fPIC -o $@ -c lib/$*.c
194                                                   208 
195 $(OUTPUT)libcpupower.so.$(LIB_MAJ): $(LIB_OBJS    209 $(OUTPUT)libcpupower.so.$(LIB_MAJ): $(LIB_OBJS)
196         $(ECHO) "  LD      " $@                   210         $(ECHO) "  LD      " $@
197         $(QUIET) $(CC) -shared $(CFLAGS) $(LDF    211         $(QUIET) $(CC) -shared $(CFLAGS) $(LDFLAGS) -o $@ \
198                 -Wl,-soname,libcpupower.so.$(L    212                 -Wl,-soname,libcpupower.so.$(LIB_MIN) $(LIB_OBJS)
199         @ln -sf $(@F) $(OUTPUT)libcpupower.so     213         @ln -sf $(@F) $(OUTPUT)libcpupower.so
200         @ln -sf $(@F) $(OUTPUT)libcpupower.so.    214         @ln -sf $(@F) $(OUTPUT)libcpupower.so.$(LIB_MIN)
201                                                   215 
202 libcpupower: $(OUTPUT)libcpupower.so.$(LIB_MAJ    216 libcpupower: $(OUTPUT)libcpupower.so.$(LIB_MAJ)
203                                                   217 
204 # Let all .o files depend on its .c file and a    218 # Let all .o files depend on its .c file and all headers
205 # Might be worth to put this into utils/Makefi    219 # Might be worth to put this into utils/Makefile at some point of time
206 $(UTIL_OBJS): $(UTIL_HEADERS)                     220 $(UTIL_OBJS): $(UTIL_HEADERS)
207                                                   221 
208 $(OUTPUT)%.o: %.c                                 222 $(OUTPUT)%.o: %.c
209         $(ECHO) "  CC      " $@                   223         $(ECHO) "  CC      " $@
210         $(QUIET) $(CC) $(CFLAGS) -I./lib -I ./    224         $(QUIET) $(CC) $(CFLAGS) -I./lib -I ./utils -o $@ -c $*.c
211                                                   225 
212 $(OUTPUT)cpupower: $(UTIL_OBJS) $(OUTPUT)libcp    226 $(OUTPUT)cpupower: $(UTIL_OBJS) $(OUTPUT)libcpupower.so.$(LIB_MAJ)
213         $(ECHO) "  CC      " $@                   227         $(ECHO) "  CC      " $@
214 ifeq ($(strip $(STATIC)),true)                    228 ifeq ($(strip $(STATIC)),true)
215         $(QUIET) $(CC) $(CFLAGS) $(LDFLAGS) $(    229         $(QUIET) $(CC) $(CFLAGS) $(LDFLAGS) $(UTIL_OBJS) -lrt -lpci -L$(OUTPUT) -o $@
216 else                                              230 else
217         $(QUIET) $(CC) $(CFLAGS) $(LDFLAGS) $(    231         $(QUIET) $(CC) $(CFLAGS) $(LDFLAGS) $(UTIL_OBJS) -lcpupower -lrt -lpci -L$(OUTPUT) -o $@
218 endif                                             232 endif
219         $(QUIET) $(STRIPCMD) $@                   233         $(QUIET) $(STRIPCMD) $@
220                                                   234 
221 $(OUTPUT)po/$(PACKAGE).pot: $(UTIL_SRC)           235 $(OUTPUT)po/$(PACKAGE).pot: $(UTIL_SRC)
222         $(ECHO) "  GETTEXT " $@                   236         $(ECHO) "  GETTEXT " $@
223         $(QUIET) xgettext --default-domain=$(P    237         $(QUIET) xgettext --default-domain=$(PACKAGE) --add-comments \
224                 --keyword=_ --keyword=N_ $(UTI    238                 --keyword=_ --keyword=N_ $(UTIL_SRC) -p $(@D) -o $(@F)
225                                                   239 
226 $(OUTPUT)po/%.gmo: po/%.po                        240 $(OUTPUT)po/%.gmo: po/%.po
227         $(ECHO) "  MSGFMT  " $@                   241         $(ECHO) "  MSGFMT  " $@
228         $(QUIET) msgfmt -o $@ po/$*.po            242         $(QUIET) msgfmt -o $@ po/$*.po
229                                                   243 
230 create-gmo: ${GMO_FILES}                          244 create-gmo: ${GMO_FILES}
231                                                   245 
232 update-po: $(OUTPUT)po/$(PACKAGE).pot             246 update-po: $(OUTPUT)po/$(PACKAGE).pot
233         $(ECHO) "  MSGMRG  " $@                   247         $(ECHO) "  MSGMRG  " $@
234         $(QUIET) @for HLANG in $(LANGUAGES); d    248         $(QUIET) @for HLANG in $(LANGUAGES); do \
235                 echo -n "Updating $$HLANG "; \    249                 echo -n "Updating $$HLANG "; \
236                 if msgmerge po/$$HLANG.po $< -    250                 if msgmerge po/$$HLANG.po $< -o \
237                    $(OUTPUT)po/$$HLANG.new.po;    251                    $(OUTPUT)po/$$HLANG.new.po; then \
238                         mv -f $(OUTPUT)po/$$HL    252                         mv -f $(OUTPUT)po/$$HLANG.new.po $(OUTPUT)po/$$HLANG.po; \
239                 else \                            253                 else \
240                         echo "msgmerge for $$H    254                         echo "msgmerge for $$HLANG failed!"; \
241                         rm -f $(OUTPUT)po/$$HL    255                         rm -f $(OUTPUT)po/$$HLANG.new.po; \
242                 fi; \                             256                 fi; \
243         done;                                     257         done;
244                                                   258 
245 compile-bench: $(OUTPUT)libcpupower.so.$(LIB_M    259 compile-bench: $(OUTPUT)libcpupower.so.$(LIB_MAJ)
246         @V=$(V) confdir=$(confdir) $(MAKE) -C     260         @V=$(V) confdir=$(confdir) $(MAKE) -C bench O=$(OUTPUT)
247                                                   261 
248 # we compile into subdirectories. if the targe    262 # we compile into subdirectories. if the target directory is not the
249 # source directory, they might not exists. So     263 # source directory, they might not exists. So we depend the various
250 # files onto their directories.                   264 # files onto their directories.
251 DIRECTORY_DEPS = $(LIB_OBJS) $(UTIL_OBJS) $(GM    265 DIRECTORY_DEPS = $(LIB_OBJS) $(UTIL_OBJS) $(GMO_FILES)
252 $(DIRECTORY_DEPS): | $(sort $(dir $(DIRECTORY_    266 $(DIRECTORY_DEPS): | $(sort $(dir $(DIRECTORY_DEPS)))
253                                                   267 
254 # In the second step, we make a rule to actual    268 # In the second step, we make a rule to actually create these directories
255 $(sort $(dir $(DIRECTORY_DEPS))):                 269 $(sort $(dir $(DIRECTORY_DEPS))):
256         $(ECHO) "  MKDIR      " $@                270         $(ECHO) "  MKDIR      " $@
257         $(QUIET) $(MKDIR) -p $@ 2>/dev/null       271         $(QUIET) $(MKDIR) -p $@ 2>/dev/null
258                                                   272 
259 clean:                                            273 clean:
260         -find $(OUTPUT) \( -not -type d \) -an    274         -find $(OUTPUT) \( -not -type d \) -and \( -name '*~' -o -name '*.[oas]' \) -type f -print \
261          | xargs rm -f                            275          | xargs rm -f
262         -rm -f $(OUTPUT)cpupower                  276         -rm -f $(OUTPUT)cpupower
263         -rm -f $(OUTPUT)libcpupower.so*           277         -rm -f $(OUTPUT)libcpupower.so*
264         -rm -rf $(OUTPUT)po/*.gmo                 278         -rm -rf $(OUTPUT)po/*.gmo
265         -rm -rf $(OUTPUT)po/*.pot                 279         -rm -rf $(OUTPUT)po/*.pot
266         $(MAKE) -C bench O=$(OUTPUT) clean        280         $(MAKE) -C bench O=$(OUTPUT) clean
267                                                   281 
268                                                   282 
269 install-lib: libcpupower                       !! 283 install-lib:
270         $(INSTALL) -d $(DESTDIR)${libdir}         284         $(INSTALL) -d $(DESTDIR)${libdir}
271         $(CP) $(OUTPUT)libcpupower.so* $(DESTD    285         $(CP) $(OUTPUT)libcpupower.so* $(DESTDIR)${libdir}/
272         $(INSTALL) -d $(DESTDIR)${includedir}     286         $(INSTALL) -d $(DESTDIR)${includedir}
273         $(INSTALL_DATA) lib/cpufreq.h $(DESTDI    287         $(INSTALL_DATA) lib/cpufreq.h $(DESTDIR)${includedir}/cpufreq.h
274         $(INSTALL_DATA) lib/cpuidle.h $(DESTDI    288         $(INSTALL_DATA) lib/cpuidle.h $(DESTDIR)${includedir}/cpuidle.h
275         $(INSTALL_DATA) lib/powercap.h $(DESTD << 
276                                                   289 
277 install-tools: $(OUTPUT)cpupower               !! 290 install-tools:
278         $(INSTALL) -d $(DESTDIR)${bindir}         291         $(INSTALL) -d $(DESTDIR)${bindir}
279         $(INSTALL_PROGRAM) $(OUTPUT)cpupower $    292         $(INSTALL_PROGRAM) $(OUTPUT)cpupower $(DESTDIR)${bindir}
280         $(INSTALL) -d $(DESTDIR)${bash_complet    293         $(INSTALL) -d $(DESTDIR)${bash_completion_dir}
281         $(INSTALL_SCRIPT) cpupower-completion.    294         $(INSTALL_SCRIPT) cpupower-completion.sh '$(DESTDIR)${bash_completion_dir}/cpupower'
282                                                   295 
283 install-man:                                      296 install-man:
284         $(INSTALL_DATA) -D man/cpupower.1 $(DE    297         $(INSTALL_DATA) -D man/cpupower.1 $(DESTDIR)${mandir}/man1/cpupower.1
285         $(INSTALL_DATA) -D man/cpupower-freque    298         $(INSTALL_DATA) -D man/cpupower-frequency-set.1 $(DESTDIR)${mandir}/man1/cpupower-frequency-set.1
286         $(INSTALL_DATA) -D man/cpupower-freque    299         $(INSTALL_DATA) -D man/cpupower-frequency-info.1 $(DESTDIR)${mandir}/man1/cpupower-frequency-info.1
287         $(INSTALL_DATA) -D man/cpupower-idle-s    300         $(INSTALL_DATA) -D man/cpupower-idle-set.1 $(DESTDIR)${mandir}/man1/cpupower-idle-set.1
288         $(INSTALL_DATA) -D man/cpupower-idle-i    301         $(INSTALL_DATA) -D man/cpupower-idle-info.1 $(DESTDIR)${mandir}/man1/cpupower-idle-info.1
289         $(INSTALL_DATA) -D man/cpupower-set.1     302         $(INSTALL_DATA) -D man/cpupower-set.1 $(DESTDIR)${mandir}/man1/cpupower-set.1
290         $(INSTALL_DATA) -D man/cpupower-info.1    303         $(INSTALL_DATA) -D man/cpupower-info.1 $(DESTDIR)${mandir}/man1/cpupower-info.1
291         $(INSTALL_DATA) -D man/cpupower-monito    304         $(INSTALL_DATA) -D man/cpupower-monitor.1 $(DESTDIR)${mandir}/man1/cpupower-monitor.1
292         $(INSTALL_DATA) -D man/cpupower-powerc << 
293                                                   305 
294 install-gmo: create-gmo                        !! 306 install-gmo:
295         $(INSTALL) -d $(DESTDIR)${localedir}      307         $(INSTALL) -d $(DESTDIR)${localedir}
296         for HLANG in $(LANGUAGES); do \           308         for HLANG in $(LANGUAGES); do \
297                 echo '$(INSTALL_DATA) -D $(OUT    309                 echo '$(INSTALL_DATA) -D $(OUTPUT)po/$$HLANG.gmo $(DESTDIR)${localedir}/$$HLANG/LC_MESSAGES/cpupower.mo'; \
298                 $(INSTALL_DATA) -D $(OUTPUT)po    310                 $(INSTALL_DATA) -D $(OUTPUT)po/$$HLANG.gmo $(DESTDIR)${localedir}/$$HLANG/LC_MESSAGES/cpupower.mo; \
299         done;                                     311         done;
300                                                   312 
301 install-bench: compile-bench                   !! 313 install-bench:
302         @#DESTDIR must be set from outside to     314         @#DESTDIR must be set from outside to survive
303         @sbindir=$(sbindir) bindir=$(bindir) d    315         @sbindir=$(sbindir) bindir=$(bindir) docdir=$(docdir) confdir=$(confdir) $(MAKE) -C bench O=$(OUTPUT) install
304                                                   316 
305 ifeq ($(strip $(STATIC)),true)                    317 ifeq ($(strip $(STATIC)),true)
306 install: all install-tools install-man $(INSTA    318 install: all install-tools install-man $(INSTALL_NLS) $(INSTALL_BENCH)
307 else                                              319 else
308 install: all install-lib install-tools install    320 install: all install-lib install-tools install-man $(INSTALL_NLS) $(INSTALL_BENCH)
309 endif                                             321 endif
310                                                   322 
311 uninstall:                                        323 uninstall:
312         - rm -f $(DESTDIR)${libdir}/libcpupowe    324         - rm -f $(DESTDIR)${libdir}/libcpupower.*
313         - rm -f $(DESTDIR)${includedir}/cpufre    325         - rm -f $(DESTDIR)${includedir}/cpufreq.h
314         - rm -f $(DESTDIR)${includedir}/cpuidl    326         - rm -f $(DESTDIR)${includedir}/cpuidle.h
315         - rm -f $(DESTDIR)${bindir}/utils/cpup    327         - rm -f $(DESTDIR)${bindir}/utils/cpupower
316         - rm -f $(DESTDIR)${mandir}/man1/cpupo    328         - rm -f $(DESTDIR)${mandir}/man1/cpupower.1
317         - rm -f $(DESTDIR)${mandir}/man1/cpupo    329         - rm -f $(DESTDIR)${mandir}/man1/cpupower-frequency-set.1
318         - rm -f $(DESTDIR)${mandir}/man1/cpupo    330         - rm -f $(DESTDIR)${mandir}/man1/cpupower-frequency-info.1
319         - rm -f $(DESTDIR)${mandir}/man1/cpupo    331         - rm -f $(DESTDIR)${mandir}/man1/cpupower-set.1
320         - rm -f $(DESTDIR)${mandir}/man1/cpupo    332         - rm -f $(DESTDIR)${mandir}/man1/cpupower-info.1
321         - rm -f $(DESTDIR)${mandir}/man1/cpupo    333         - rm -f $(DESTDIR)${mandir}/man1/cpupower-monitor.1
322         - rm -f $(DESTDIR)${mandir}/man1/cpupo << 
323         - for HLANG in $(LANGUAGES); do \         334         - for HLANG in $(LANGUAGES); do \
324                 rm -f $(DESTDIR)${localedir}/$    335                 rm -f $(DESTDIR)${localedir}/$$HLANG/LC_MESSAGES/cpupower.mo; \
325           done;                                   336           done;
326                                                   337 
327 help:                                          !! 338 .PHONY: all utils libcpupower update-po create-gmo install-lib install-tools install-man install-gmo install uninstall clean
328         @echo  'Building targets:'             << 
329         @echo  '  all             - Default ta << 
330         @echo  '                    to "O" cmd << 
331         @echo  '  install         - Install pr << 
332         @echo  '                    dir define << 
333         @echo  '                    to the ins << 
334         @echo  '                    Makefile c << 
335         @echo  '  install-lib     - Install pr << 
336         @echo  '                    dir define << 
337         @echo  '                    and librar << 
338         @echo  '                    dir  defin << 
339         @echo  '  install-tools   - Install pr << 
340         @echo  '                    dir define << 
341         @echo  '                    "cpupower- << 
342         @echo  '                    install di << 
343         @echo  '                    config blo << 
344         @echo  '  install-man     - Install ma << 
345         @echo  '                    install di << 
346         @echo  '                    config blo << 
347         @echo  '  install-gmo     - Install pr << 
348         @echo  '                    dir define << 
349         @echo  '                    to the ins << 
350         @echo  '                    config blo << 
351         @echo  '  install-bench   - Install pr << 
352         @echo  '                    output dir << 
353         @echo  '                    to the ins << 
354         @echo  '                    config blo << 
355         @echo  ''                              << 
356         @echo  'Cleaning targets:'             << 
357         @echo  '  clean           - Clean buil << 
358         @echo  '                    option (de << 
359         @echo  '  uninstall       - Remove pre << 
360         @echo  '                    cmdline or << 
361                                                << 
362 .PHONY: all utils libcpupower update-po create << 
                                                      

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php