162306a36Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0-only
262306a36Sopenharmony_ci# Makefile for cpupower
362306a36Sopenharmony_ci#
462306a36Sopenharmony_ci# Copyright (C) 2005,2006 Dominik Brodowski <linux@dominikbrodowski.net>
562306a36Sopenharmony_ci#
662306a36Sopenharmony_ci# Based largely on the Makefile for udev by:
762306a36Sopenharmony_ci#
862306a36Sopenharmony_ci# Copyright (C) 2003,2004 Greg Kroah-Hartman <greg@kroah.com>
962306a36Sopenharmony_ci#
1062306a36Sopenharmony_ciOUTPUT=./
1162306a36Sopenharmony_ciifeq ("$(origin O)", "command line")
1262306a36Sopenharmony_ci	OUTPUT := $(O)/
1362306a36Sopenharmony_ciendif
1462306a36Sopenharmony_ci
1562306a36Sopenharmony_ciifneq ($(OUTPUT),)
1662306a36Sopenharmony_ci# check that the output directory actually exists
1762306a36Sopenharmony_ciOUTDIR := $(shell cd $(OUTPUT) && pwd)
1862306a36Sopenharmony_ci$(if $(OUTDIR),, $(error output directory "$(OUTPUT)" does not exist))
1962306a36Sopenharmony_ciendif
2062306a36Sopenharmony_ci
2162306a36Sopenharmony_ci
2262306a36Sopenharmony_ci# --- CONFIGURATION BEGIN ---
2362306a36Sopenharmony_ci
2462306a36Sopenharmony_ci# Set the following to `true' to make a unstripped, unoptimized
2562306a36Sopenharmony_ci# binary. Leave this set to `false' for production use.
2662306a36Sopenharmony_ciDEBUG ?=	true
2762306a36Sopenharmony_ci
2862306a36Sopenharmony_ci# make the build silent. Set this to something else to make it noisy again.
2962306a36Sopenharmony_ciV ?=		false
3062306a36Sopenharmony_ci
3162306a36Sopenharmony_ci# Internationalization support (output in different languages).
3262306a36Sopenharmony_ci# Requires gettext.
3362306a36Sopenharmony_ciNLS ?=		true
3462306a36Sopenharmony_ci
3562306a36Sopenharmony_ci# Set the following to 'true' to build/install the
3662306a36Sopenharmony_ci# cpufreq-bench benchmarking tool
3762306a36Sopenharmony_ciCPUFREQ_BENCH ?= true
3862306a36Sopenharmony_ci
3962306a36Sopenharmony_ci# Do not build libraries, but build the code in statically
4062306a36Sopenharmony_ci# Libraries are still built, otherwise the Makefile code would
4162306a36Sopenharmony_ci# be rather ugly.
4262306a36Sopenharmony_ciexport STATIC ?= false
4362306a36Sopenharmony_ci
4462306a36Sopenharmony_ci# Prefix to the directories we're installing to
4562306a36Sopenharmony_ciDESTDIR ?=
4662306a36Sopenharmony_ci
4762306a36Sopenharmony_ci# --- CONFIGURATION END ---
4862306a36Sopenharmony_ci
4962306a36Sopenharmony_ci
5062306a36Sopenharmony_ci
5162306a36Sopenharmony_ci# Package-related definitions. Distributions can modify the version
5262306a36Sopenharmony_ci# and _should_ modify the PACKAGE_BUGREPORT definition
5362306a36Sopenharmony_ci
5462306a36Sopenharmony_ciVERSION:=			$(shell ./utils/version-gen.sh)
5562306a36Sopenharmony_ciLIB_MAJ=			0.0.1
5662306a36Sopenharmony_ciLIB_MIN=			1
5762306a36Sopenharmony_ci
5862306a36Sopenharmony_ciPACKAGE =			cpupower
5962306a36Sopenharmony_ciPACKAGE_BUGREPORT =		linux-pm@vger.kernel.org
6062306a36Sopenharmony_ciLANGUAGES = 			de fr it cs pt ka
6162306a36Sopenharmony_ci
6262306a36Sopenharmony_ci
6362306a36Sopenharmony_ci# Directory definitions. These are default and most probably
6462306a36Sopenharmony_ci# do not need to be changed. Please note that DESTDIR is
6562306a36Sopenharmony_ci# added in front of any of them
6662306a36Sopenharmony_ci
6762306a36Sopenharmony_cibindir ?=	/usr/bin
6862306a36Sopenharmony_cisbindir ?=	/usr/sbin
6962306a36Sopenharmony_cimandir ?=	/usr/man
7062306a36Sopenharmony_ciincludedir ?=	/usr/include
7162306a36Sopenharmony_cilocaledir ?=	/usr/share/locale
7262306a36Sopenharmony_cidocdir ?=       /usr/share/doc/packages/cpupower
7362306a36Sopenharmony_ciconfdir ?=      /etc/
7462306a36Sopenharmony_cibash_completion_dir ?= /usr/share/bash-completion/completions
7562306a36Sopenharmony_ci
7662306a36Sopenharmony_ci# Toolchain: what tools do we use, and what options do they need:
7762306a36Sopenharmony_ci
7862306a36Sopenharmony_ciCP = cp -fpR
7962306a36Sopenharmony_ciINSTALL = /usr/bin/install -c
8062306a36Sopenharmony_ciINSTALL_PROGRAM = ${INSTALL}
8162306a36Sopenharmony_ciINSTALL_DATA  = ${INSTALL} -m 644
8262306a36Sopenharmony_ci#bash completion scripts get sourced and so they should be rw only.
8362306a36Sopenharmony_ciINSTALL_SCRIPT = ${INSTALL} -m 644
8462306a36Sopenharmony_ci
8562306a36Sopenharmony_ci# If you are running a cross compiler, you may want to set this
8662306a36Sopenharmony_ci# to something more interesting, like "arm-linux-".  If you want
8762306a36Sopenharmony_ci# to compile vs uClibc, that can be done here as well.
8862306a36Sopenharmony_ciCROSS = #/usr/i386-linux-uclibc/usr/bin/i386-uclibc-
8962306a36Sopenharmony_ciCC = $(CROSS)gcc
9062306a36Sopenharmony_ciLD = $(CROSS)gcc
9162306a36Sopenharmony_ciAR = $(CROSS)ar
9262306a36Sopenharmony_ciSTRIP = $(CROSS)strip
9362306a36Sopenharmony_ciRANLIB = $(CROSS)ranlib
9462306a36Sopenharmony_ciHOSTCC = gcc
9562306a36Sopenharmony_ciMKDIR = mkdir
9662306a36Sopenharmony_ci
9762306a36Sopenharmony_ci# 64bit library detection
9862306a36Sopenharmony_ciinclude ../../scripts/Makefile.arch
9962306a36Sopenharmony_ci
10062306a36Sopenharmony_ciifeq ($(IS_64_BIT), 1)
10162306a36Sopenharmony_cilibdir ?=	/usr/lib64
10262306a36Sopenharmony_cielse
10362306a36Sopenharmony_cilibdir ?=	/usr/lib
10462306a36Sopenharmony_ciendif
10562306a36Sopenharmony_ci
10662306a36Sopenharmony_ci# Now we set up the build system
10762306a36Sopenharmony_ci#
10862306a36Sopenharmony_ci
10962306a36Sopenharmony_ciGMO_FILES = ${shell for HLANG in ${LANGUAGES}; do echo $(OUTPUT)po/$$HLANG.gmo; done;}
11062306a36Sopenharmony_ci
11162306a36Sopenharmony_ciexport CROSS CC AR STRIP RANLIB CFLAGS LDFLAGS LIB_OBJS
11262306a36Sopenharmony_ci
11362306a36Sopenharmony_ci# check if compiler option is supported
11462306a36Sopenharmony_cicc-supports = ${shell if $(CC) ${1} -S -o /dev/null -x c /dev/null > /dev/null 2>&1; then echo "$(1)"; fi;}
11562306a36Sopenharmony_ci
11662306a36Sopenharmony_ci# use '-Os' optimization if available, else use -O2
11762306a36Sopenharmony_ciOPTIMIZATION := $(call cc-supports,-Os,-O2)
11862306a36Sopenharmony_ci
11962306a36Sopenharmony_ciWARNINGS := -Wall -Wchar-subscripts -Wpointer-arith -Wsign-compare
12062306a36Sopenharmony_ciWARNINGS += $(call cc-supports,-Wno-pointer-sign)
12162306a36Sopenharmony_ciWARNINGS += $(call cc-supports,-Wdeclaration-after-statement)
12262306a36Sopenharmony_ciWARNINGS += -Wshadow
12362306a36Sopenharmony_ci
12462306a36Sopenharmony_cioverride CFLAGS += -DVERSION=\"$(VERSION)\" -DPACKAGE=\"$(PACKAGE)\" \
12562306a36Sopenharmony_ci		-DPACKAGE_BUGREPORT=\"$(PACKAGE_BUGREPORT)\" -D_GNU_SOURCE
12662306a36Sopenharmony_ci
12762306a36Sopenharmony_ciUTIL_OBJS =  utils/helpers/amd.o utils/helpers/msr.o \
12862306a36Sopenharmony_ci	utils/helpers/sysfs.o utils/helpers/misc.o utils/helpers/cpuid.o \
12962306a36Sopenharmony_ci	utils/helpers/pci.o utils/helpers/bitmask.o \
13062306a36Sopenharmony_ci	utils/idle_monitor/nhm_idle.o utils/idle_monitor/snb_idle.o \
13162306a36Sopenharmony_ci	utils/idle_monitor/hsw_ext_idle.o \
13262306a36Sopenharmony_ci	utils/idle_monitor/amd_fam14h_idle.o utils/idle_monitor/cpuidle_sysfs.o \
13362306a36Sopenharmony_ci	utils/idle_monitor/mperf_monitor.o utils/idle_monitor/cpupower-monitor.o \
13462306a36Sopenharmony_ci	utils/idle_monitor/rapl_monitor.o \
13562306a36Sopenharmony_ci	utils/cpupower.o utils/cpufreq-info.o utils/cpufreq-set.o \
13662306a36Sopenharmony_ci	utils/cpupower-set.o utils/cpupower-info.o utils/cpuidle-info.o \
13762306a36Sopenharmony_ci	utils/cpuidle-set.o utils/powercap-info.o
13862306a36Sopenharmony_ci
13962306a36Sopenharmony_ciUTIL_SRC := $(UTIL_OBJS:.o=.c)
14062306a36Sopenharmony_ci
14162306a36Sopenharmony_ciUTIL_OBJS := $(addprefix $(OUTPUT),$(UTIL_OBJS))
14262306a36Sopenharmony_ci
14362306a36Sopenharmony_ciUTIL_HEADERS = utils/helpers/helpers.h utils/idle_monitor/cpupower-monitor.h \
14462306a36Sopenharmony_ci	utils/helpers/bitmask.h \
14562306a36Sopenharmony_ci	utils/idle_monitor/idle_monitors.h utils/idle_monitor/idle_monitors.def
14662306a36Sopenharmony_ci
14762306a36Sopenharmony_ciLIB_HEADERS = 	lib/cpufreq.h lib/cpupower.h lib/cpuidle.h lib/acpi_cppc.h \
14862306a36Sopenharmony_ci	lib/powercap.h
14962306a36Sopenharmony_ciLIB_SRC = 	lib/cpufreq.c lib/cpupower.c lib/cpuidle.c lib/acpi_cppc.c \
15062306a36Sopenharmony_ci	lib/powercap.c
15162306a36Sopenharmony_ciLIB_OBJS = 	lib/cpufreq.o lib/cpupower.o lib/cpuidle.o lib/acpi_cppc.o \
15262306a36Sopenharmony_ci	lib/powercap.o
15362306a36Sopenharmony_ciLIB_OBJS :=	$(addprefix $(OUTPUT),$(LIB_OBJS))
15462306a36Sopenharmony_ci
15562306a36Sopenharmony_cioverride CFLAGS +=	-pipe
15662306a36Sopenharmony_ci
15762306a36Sopenharmony_ciifeq ($(strip $(NLS)),true)
15862306a36Sopenharmony_ci	INSTALL_NLS += install-gmo
15962306a36Sopenharmony_ci	COMPILE_NLS += create-gmo
16062306a36Sopenharmony_ci	override CFLAGS += -DNLS
16162306a36Sopenharmony_ciendif
16262306a36Sopenharmony_ci
16362306a36Sopenharmony_ciifeq ($(strip $(CPUFREQ_BENCH)),true)
16462306a36Sopenharmony_ci	INSTALL_BENCH += install-bench
16562306a36Sopenharmony_ci	COMPILE_BENCH += compile-bench
16662306a36Sopenharmony_ciendif
16762306a36Sopenharmony_ci
16862306a36Sopenharmony_ciifeq ($(strip $(STATIC)),true)
16962306a36Sopenharmony_ci        UTIL_OBJS += $(LIB_OBJS)
17062306a36Sopenharmony_ci        UTIL_HEADERS += $(LIB_HEADERS)
17162306a36Sopenharmony_ci        UTIL_SRC += $(LIB_SRC)
17262306a36Sopenharmony_ciendif
17362306a36Sopenharmony_ci
17462306a36Sopenharmony_cioverride CFLAGS += $(WARNINGS)
17562306a36Sopenharmony_ci
17662306a36Sopenharmony_ciifeq ($(strip $(V)),false)
17762306a36Sopenharmony_ci	QUIET=@
17862306a36Sopenharmony_ci	ECHO=@echo
17962306a36Sopenharmony_cielse
18062306a36Sopenharmony_ci	QUIET=
18162306a36Sopenharmony_ci	ECHO=@\#
18262306a36Sopenharmony_ciendif
18362306a36Sopenharmony_ciexport QUIET ECHO
18462306a36Sopenharmony_ci
18562306a36Sopenharmony_ci# if DEBUG is enabled, then we do not strip or optimize
18662306a36Sopenharmony_ciifeq ($(strip $(DEBUG)),true)
18762306a36Sopenharmony_ci	override CFLAGS += -O1 -g -DDEBUG
18862306a36Sopenharmony_ci	STRIPCMD = /bin/true -Since_we_are_debugging
18962306a36Sopenharmony_cielse
19062306a36Sopenharmony_ci	override CFLAGS += $(OPTIMIZATION) -fomit-frame-pointer
19162306a36Sopenharmony_ci	STRIPCMD = $(STRIP) -s --remove-section=.note --remove-section=.comment
19262306a36Sopenharmony_ciendif
19362306a36Sopenharmony_ci
19462306a36Sopenharmony_ci
19562306a36Sopenharmony_ci# the actual make rules
19662306a36Sopenharmony_ci
19762306a36Sopenharmony_ciall: libcpupower $(OUTPUT)cpupower $(COMPILE_NLS) $(COMPILE_BENCH)
19862306a36Sopenharmony_ci
19962306a36Sopenharmony_ci$(OUTPUT)lib/%.o: $(LIB_SRC) $(LIB_HEADERS)
20062306a36Sopenharmony_ci	$(ECHO) "  CC      " $@
20162306a36Sopenharmony_ci	$(QUIET) $(CC) $(CFLAGS) -fPIC -o $@ -c lib/$*.c
20262306a36Sopenharmony_ci
20362306a36Sopenharmony_ci$(OUTPUT)libcpupower.so.$(LIB_MAJ): $(LIB_OBJS)
20462306a36Sopenharmony_ci	$(ECHO) "  LD      " $@
20562306a36Sopenharmony_ci	$(QUIET) $(CC) -shared $(CFLAGS) $(LDFLAGS) -o $@ \
20662306a36Sopenharmony_ci		-Wl,-soname,libcpupower.so.$(LIB_MIN) $(LIB_OBJS)
20762306a36Sopenharmony_ci	@ln -sf $(@F) $(OUTPUT)libcpupower.so
20862306a36Sopenharmony_ci	@ln -sf $(@F) $(OUTPUT)libcpupower.so.$(LIB_MIN)
20962306a36Sopenharmony_ci
21062306a36Sopenharmony_cilibcpupower: $(OUTPUT)libcpupower.so.$(LIB_MAJ)
21162306a36Sopenharmony_ci
21262306a36Sopenharmony_ci# Let all .o files depend on its .c file and all headers
21362306a36Sopenharmony_ci# Might be worth to put this into utils/Makefile at some point of time
21462306a36Sopenharmony_ci$(UTIL_OBJS): $(UTIL_HEADERS)
21562306a36Sopenharmony_ci
21662306a36Sopenharmony_ci$(OUTPUT)%.o: %.c
21762306a36Sopenharmony_ci	$(ECHO) "  CC      " $@
21862306a36Sopenharmony_ci	$(QUIET) $(CC) $(CFLAGS) -I./lib -I ./utils -o $@ -c $*.c
21962306a36Sopenharmony_ci
22062306a36Sopenharmony_ci$(OUTPUT)cpupower: $(UTIL_OBJS) $(OUTPUT)libcpupower.so.$(LIB_MAJ)
22162306a36Sopenharmony_ci	$(ECHO) "  CC      " $@
22262306a36Sopenharmony_ciifeq ($(strip $(STATIC)),true)
22362306a36Sopenharmony_ci	$(QUIET) $(CC) $(CFLAGS) $(LDFLAGS) $(UTIL_OBJS) -lrt -lpci -L$(OUTPUT) -o $@
22462306a36Sopenharmony_cielse
22562306a36Sopenharmony_ci	$(QUIET) $(CC) $(CFLAGS) $(LDFLAGS) $(UTIL_OBJS) -lcpupower -lrt -lpci -L$(OUTPUT) -o $@
22662306a36Sopenharmony_ciendif
22762306a36Sopenharmony_ci	$(QUIET) $(STRIPCMD) $@
22862306a36Sopenharmony_ci
22962306a36Sopenharmony_ci$(OUTPUT)po/$(PACKAGE).pot: $(UTIL_SRC)
23062306a36Sopenharmony_ci	$(ECHO) "  GETTEXT " $@
23162306a36Sopenharmony_ci	$(QUIET) xgettext --default-domain=$(PACKAGE) --add-comments \
23262306a36Sopenharmony_ci		--keyword=_ --keyword=N_ $(UTIL_SRC) -p $(@D) -o $(@F)
23362306a36Sopenharmony_ci
23462306a36Sopenharmony_ci$(OUTPUT)po/%.gmo: po/%.po
23562306a36Sopenharmony_ci	$(ECHO) "  MSGFMT  " $@
23662306a36Sopenharmony_ci	$(QUIET) msgfmt -o $@ po/$*.po
23762306a36Sopenharmony_ci
23862306a36Sopenharmony_cicreate-gmo: ${GMO_FILES}
23962306a36Sopenharmony_ci
24062306a36Sopenharmony_ciupdate-po: $(OUTPUT)po/$(PACKAGE).pot
24162306a36Sopenharmony_ci	$(ECHO) "  MSGMRG  " $@
24262306a36Sopenharmony_ci	$(QUIET) @for HLANG in $(LANGUAGES); do \
24362306a36Sopenharmony_ci		echo -n "Updating $$HLANG "; \
24462306a36Sopenharmony_ci		if msgmerge po/$$HLANG.po $< -o \
24562306a36Sopenharmony_ci		   $(OUTPUT)po/$$HLANG.new.po; then \
24662306a36Sopenharmony_ci			mv -f $(OUTPUT)po/$$HLANG.new.po $(OUTPUT)po/$$HLANG.po; \
24762306a36Sopenharmony_ci		else \
24862306a36Sopenharmony_ci			echo "msgmerge for $$HLANG failed!"; \
24962306a36Sopenharmony_ci			rm -f $(OUTPUT)po/$$HLANG.new.po; \
25062306a36Sopenharmony_ci		fi; \
25162306a36Sopenharmony_ci	done;
25262306a36Sopenharmony_ci
25362306a36Sopenharmony_cicompile-bench: $(OUTPUT)libcpupower.so.$(LIB_MAJ)
25462306a36Sopenharmony_ci	@V=$(V) confdir=$(confdir) $(MAKE) -C bench O=$(OUTPUT)
25562306a36Sopenharmony_ci
25662306a36Sopenharmony_ci# we compile into subdirectories. if the target directory is not the
25762306a36Sopenharmony_ci# source directory, they might not exists. So we depend the various
25862306a36Sopenharmony_ci# files onto their directories.
25962306a36Sopenharmony_ciDIRECTORY_DEPS = $(LIB_OBJS) $(UTIL_OBJS) $(GMO_FILES)
26062306a36Sopenharmony_ci$(DIRECTORY_DEPS): | $(sort $(dir $(DIRECTORY_DEPS)))
26162306a36Sopenharmony_ci
26262306a36Sopenharmony_ci# In the second step, we make a rule to actually create these directories
26362306a36Sopenharmony_ci$(sort $(dir $(DIRECTORY_DEPS))):
26462306a36Sopenharmony_ci	$(ECHO) "  MKDIR      " $@
26562306a36Sopenharmony_ci	$(QUIET) $(MKDIR) -p $@ 2>/dev/null
26662306a36Sopenharmony_ci
26762306a36Sopenharmony_ciclean:
26862306a36Sopenharmony_ci	-find $(OUTPUT) \( -not -type d \) -and \( -name '*~' -o -name '*.[oas]' \) -type f -print \
26962306a36Sopenharmony_ci	 | xargs rm -f
27062306a36Sopenharmony_ci	-rm -f $(OUTPUT)cpupower
27162306a36Sopenharmony_ci	-rm -f $(OUTPUT)libcpupower.so*
27262306a36Sopenharmony_ci	-rm -rf $(OUTPUT)po/*.gmo
27362306a36Sopenharmony_ci	-rm -rf $(OUTPUT)po/*.pot
27462306a36Sopenharmony_ci	$(MAKE) -C bench O=$(OUTPUT) clean
27562306a36Sopenharmony_ci
27662306a36Sopenharmony_ci
27762306a36Sopenharmony_ciinstall-lib: libcpupower
27862306a36Sopenharmony_ci	$(INSTALL) -d $(DESTDIR)${libdir}
27962306a36Sopenharmony_ci	$(CP) $(OUTPUT)libcpupower.so* $(DESTDIR)${libdir}/
28062306a36Sopenharmony_ci	$(INSTALL) -d $(DESTDIR)${includedir}
28162306a36Sopenharmony_ci	$(INSTALL_DATA) lib/cpufreq.h $(DESTDIR)${includedir}/cpufreq.h
28262306a36Sopenharmony_ci	$(INSTALL_DATA) lib/cpuidle.h $(DESTDIR)${includedir}/cpuidle.h
28362306a36Sopenharmony_ci	$(INSTALL_DATA) lib/powercap.h $(DESTDIR)${includedir}/powercap.h
28462306a36Sopenharmony_ci
28562306a36Sopenharmony_ciinstall-tools: $(OUTPUT)cpupower
28662306a36Sopenharmony_ci	$(INSTALL) -d $(DESTDIR)${bindir}
28762306a36Sopenharmony_ci	$(INSTALL_PROGRAM) $(OUTPUT)cpupower $(DESTDIR)${bindir}
28862306a36Sopenharmony_ci	$(INSTALL) -d $(DESTDIR)${bash_completion_dir}
28962306a36Sopenharmony_ci	$(INSTALL_SCRIPT) cpupower-completion.sh '$(DESTDIR)${bash_completion_dir}/cpupower'
29062306a36Sopenharmony_ci
29162306a36Sopenharmony_ciinstall-man:
29262306a36Sopenharmony_ci	$(INSTALL_DATA) -D man/cpupower.1 $(DESTDIR)${mandir}/man1/cpupower.1
29362306a36Sopenharmony_ci	$(INSTALL_DATA) -D man/cpupower-frequency-set.1 $(DESTDIR)${mandir}/man1/cpupower-frequency-set.1
29462306a36Sopenharmony_ci	$(INSTALL_DATA) -D man/cpupower-frequency-info.1 $(DESTDIR)${mandir}/man1/cpupower-frequency-info.1
29562306a36Sopenharmony_ci	$(INSTALL_DATA) -D man/cpupower-idle-set.1 $(DESTDIR)${mandir}/man1/cpupower-idle-set.1
29662306a36Sopenharmony_ci	$(INSTALL_DATA) -D man/cpupower-idle-info.1 $(DESTDIR)${mandir}/man1/cpupower-idle-info.1
29762306a36Sopenharmony_ci	$(INSTALL_DATA) -D man/cpupower-set.1 $(DESTDIR)${mandir}/man1/cpupower-set.1
29862306a36Sopenharmony_ci	$(INSTALL_DATA) -D man/cpupower-info.1 $(DESTDIR)${mandir}/man1/cpupower-info.1
29962306a36Sopenharmony_ci	$(INSTALL_DATA) -D man/cpupower-monitor.1 $(DESTDIR)${mandir}/man1/cpupower-monitor.1
30062306a36Sopenharmony_ci	$(INSTALL_DATA) -D man/cpupower-powercap-info.1 $(DESTDIR)${mandir}/man1/cpupower-powercap-info.1
30162306a36Sopenharmony_ci
30262306a36Sopenharmony_ciinstall-gmo: create-gmo
30362306a36Sopenharmony_ci	$(INSTALL) -d $(DESTDIR)${localedir}
30462306a36Sopenharmony_ci	for HLANG in $(LANGUAGES); do \
30562306a36Sopenharmony_ci		echo '$(INSTALL_DATA) -D $(OUTPUT)po/$$HLANG.gmo $(DESTDIR)${localedir}/$$HLANG/LC_MESSAGES/cpupower.mo'; \
30662306a36Sopenharmony_ci		$(INSTALL_DATA) -D $(OUTPUT)po/$$HLANG.gmo $(DESTDIR)${localedir}/$$HLANG/LC_MESSAGES/cpupower.mo; \
30762306a36Sopenharmony_ci	done;
30862306a36Sopenharmony_ci
30962306a36Sopenharmony_ciinstall-bench: compile-bench
31062306a36Sopenharmony_ci	@#DESTDIR must be set from outside to survive
31162306a36Sopenharmony_ci	@sbindir=$(sbindir) bindir=$(bindir) docdir=$(docdir) confdir=$(confdir) $(MAKE) -C bench O=$(OUTPUT) install
31262306a36Sopenharmony_ci
31362306a36Sopenharmony_ciifeq ($(strip $(STATIC)),true)
31462306a36Sopenharmony_ciinstall: all install-tools install-man $(INSTALL_NLS) $(INSTALL_BENCH)
31562306a36Sopenharmony_cielse
31662306a36Sopenharmony_ciinstall: all install-lib install-tools install-man $(INSTALL_NLS) $(INSTALL_BENCH)
31762306a36Sopenharmony_ciendif
31862306a36Sopenharmony_ci
31962306a36Sopenharmony_ciuninstall:
32062306a36Sopenharmony_ci	- rm -f $(DESTDIR)${libdir}/libcpupower.*
32162306a36Sopenharmony_ci	- rm -f $(DESTDIR)${includedir}/cpufreq.h
32262306a36Sopenharmony_ci	- rm -f $(DESTDIR)${includedir}/cpuidle.h
32362306a36Sopenharmony_ci	- rm -f $(DESTDIR)${bindir}/utils/cpupower
32462306a36Sopenharmony_ci	- rm -f $(DESTDIR)${mandir}/man1/cpupower.1
32562306a36Sopenharmony_ci	- rm -f $(DESTDIR)${mandir}/man1/cpupower-frequency-set.1
32662306a36Sopenharmony_ci	- rm -f $(DESTDIR)${mandir}/man1/cpupower-frequency-info.1
32762306a36Sopenharmony_ci	- rm -f $(DESTDIR)${mandir}/man1/cpupower-set.1
32862306a36Sopenharmony_ci	- rm -f $(DESTDIR)${mandir}/man1/cpupower-info.1
32962306a36Sopenharmony_ci	- rm -f $(DESTDIR)${mandir}/man1/cpupower-monitor.1
33062306a36Sopenharmony_ci	- rm -f $(DESTDIR)${mandir}/man1/cpupower-powercap-info.1
33162306a36Sopenharmony_ci	- for HLANG in $(LANGUAGES); do \
33262306a36Sopenharmony_ci		rm -f $(DESTDIR)${localedir}/$$HLANG/LC_MESSAGES/cpupower.mo; \
33362306a36Sopenharmony_ci	  done;
33462306a36Sopenharmony_ci
33562306a36Sopenharmony_ci.PHONY: all utils libcpupower update-po create-gmo install-lib install-tools install-man install-gmo install uninstall clean
336