18c2ecf20Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0-only
28c2ecf20Sopenharmony_ci# Makefile for cpupower
38c2ecf20Sopenharmony_ci#
48c2ecf20Sopenharmony_ci# Copyright (C) 2005,2006 Dominik Brodowski <linux@dominikbrodowski.net>
58c2ecf20Sopenharmony_ci#
68c2ecf20Sopenharmony_ci# Based largely on the Makefile for udev by:
78c2ecf20Sopenharmony_ci#
88c2ecf20Sopenharmony_ci# Copyright (C) 2003,2004 Greg Kroah-Hartman <greg@kroah.com>
98c2ecf20Sopenharmony_ci#
108c2ecf20Sopenharmony_ciOUTPUT=./
118c2ecf20Sopenharmony_ciifeq ("$(origin O)", "command line")
128c2ecf20Sopenharmony_ci	OUTPUT := $(O)/
138c2ecf20Sopenharmony_ciendif
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ciifneq ($(OUTPUT),)
168c2ecf20Sopenharmony_ci# check that the output directory actually exists
178c2ecf20Sopenharmony_ciOUTDIR := $(shell cd $(OUTPUT) && pwd)
188c2ecf20Sopenharmony_ci$(if $(OUTDIR),, $(error output directory "$(OUTPUT)" does not exist))
198c2ecf20Sopenharmony_ciendif
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ci# --- CONFIGURATION BEGIN ---
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ci# Set the following to `true' to make a unstripped, unoptimized
258c2ecf20Sopenharmony_ci# binary. Leave this set to `false' for production use.
268c2ecf20Sopenharmony_ciDEBUG ?=	true
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_ci# make the build silent. Set this to something else to make it noisy again.
298c2ecf20Sopenharmony_ciV ?=		false
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_ci# Internationalization support (output in different languages).
328c2ecf20Sopenharmony_ci# Requires gettext.
338c2ecf20Sopenharmony_ciNLS ?=		true
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ci# Set the following to 'true' to build/install the
368c2ecf20Sopenharmony_ci# cpufreq-bench benchmarking tool
378c2ecf20Sopenharmony_ciCPUFREQ_BENCH ?= true
388c2ecf20Sopenharmony_ci
398c2ecf20Sopenharmony_ci# Do not build libraries, but build the code in statically
408c2ecf20Sopenharmony_ci# Libraries are still built, otherwise the Makefile code would
418c2ecf20Sopenharmony_ci# be rather ugly.
428c2ecf20Sopenharmony_ciexport STATIC ?= false
438c2ecf20Sopenharmony_ci
448c2ecf20Sopenharmony_ci# Prefix to the directories we're installing to
458c2ecf20Sopenharmony_ciDESTDIR ?=
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_ci# --- CONFIGURATION END ---
488c2ecf20Sopenharmony_ci
498c2ecf20Sopenharmony_ci
508c2ecf20Sopenharmony_ci
518c2ecf20Sopenharmony_ci# Package-related definitions. Distributions can modify the version
528c2ecf20Sopenharmony_ci# and _should_ modify the PACKAGE_BUGREPORT definition
538c2ecf20Sopenharmony_ci
548c2ecf20Sopenharmony_ciVERSION:=			$(shell ./utils/version-gen.sh)
558c2ecf20Sopenharmony_ciLIB_MAJ=			0.0.1
568c2ecf20Sopenharmony_ciLIB_MIN=			0
578c2ecf20Sopenharmony_ci
588c2ecf20Sopenharmony_ciPACKAGE =			cpupower
598c2ecf20Sopenharmony_ciPACKAGE_BUGREPORT =		linux-pm@vger.kernel.org
608c2ecf20Sopenharmony_ciLANGUAGES = 			de fr it cs pt
618c2ecf20Sopenharmony_ci
628c2ecf20Sopenharmony_ci
638c2ecf20Sopenharmony_ci# Directory definitions. These are default and most probably
648c2ecf20Sopenharmony_ci# do not need to be changed. Please note that DESTDIR is
658c2ecf20Sopenharmony_ci# added in front of any of them
668c2ecf20Sopenharmony_ci
678c2ecf20Sopenharmony_cibindir ?=	/usr/bin
688c2ecf20Sopenharmony_cisbindir ?=	/usr/sbin
698c2ecf20Sopenharmony_cimandir ?=	/usr/man
708c2ecf20Sopenharmony_ciincludedir ?=	/usr/include
718c2ecf20Sopenharmony_cilocaledir ?=	/usr/share/locale
728c2ecf20Sopenharmony_cidocdir ?=       /usr/share/doc/packages/cpupower
738c2ecf20Sopenharmony_ciconfdir ?=      /etc/
748c2ecf20Sopenharmony_cibash_completion_dir ?= /usr/share/bash-completion/completions
758c2ecf20Sopenharmony_ci
768c2ecf20Sopenharmony_ci# Toolchain: what tools do we use, and what options do they need:
778c2ecf20Sopenharmony_ci
788c2ecf20Sopenharmony_ciCP = cp -fpR
798c2ecf20Sopenharmony_ciINSTALL = /usr/bin/install -c
808c2ecf20Sopenharmony_ciINSTALL_PROGRAM = ${INSTALL}
818c2ecf20Sopenharmony_ciINSTALL_DATA  = ${INSTALL} -m 644
828c2ecf20Sopenharmony_ci#bash completion scripts get sourced and so they should be rw only.
838c2ecf20Sopenharmony_ciINSTALL_SCRIPT = ${INSTALL} -m 644
848c2ecf20Sopenharmony_ci
858c2ecf20Sopenharmony_ci# If you are running a cross compiler, you may want to set this
868c2ecf20Sopenharmony_ci# to something more interesting, like "arm-linux-".  If you want
878c2ecf20Sopenharmony_ci# to compile vs uClibc, that can be done here as well.
888c2ecf20Sopenharmony_ciCROSS = #/usr/i386-linux-uclibc/usr/bin/i386-uclibc-
898c2ecf20Sopenharmony_ciCC = $(CROSS)gcc
908c2ecf20Sopenharmony_ciLD = $(CROSS)gcc
918c2ecf20Sopenharmony_ciAR = $(CROSS)ar
928c2ecf20Sopenharmony_ciSTRIP = $(CROSS)strip
938c2ecf20Sopenharmony_ciRANLIB = $(CROSS)ranlib
948c2ecf20Sopenharmony_ciHOSTCC = gcc
958c2ecf20Sopenharmony_ciMKDIR = mkdir
968c2ecf20Sopenharmony_ci
978c2ecf20Sopenharmony_ci# 64bit library detection
988c2ecf20Sopenharmony_ciinclude ../../scripts/Makefile.arch
998c2ecf20Sopenharmony_ci
1008c2ecf20Sopenharmony_ciifeq ($(IS_64_BIT), 1)
1018c2ecf20Sopenharmony_cilibdir ?=	/usr/lib64
1028c2ecf20Sopenharmony_cielse
1038c2ecf20Sopenharmony_cilibdir ?=	/usr/lib
1048c2ecf20Sopenharmony_ciendif
1058c2ecf20Sopenharmony_ci
1068c2ecf20Sopenharmony_ci# Now we set up the build system
1078c2ecf20Sopenharmony_ci#
1088c2ecf20Sopenharmony_ci
1098c2ecf20Sopenharmony_ciGMO_FILES = ${shell for HLANG in ${LANGUAGES}; do echo $(OUTPUT)po/$$HLANG.gmo; done;}
1108c2ecf20Sopenharmony_ci
1118c2ecf20Sopenharmony_ciexport CROSS CC AR STRIP RANLIB CFLAGS LDFLAGS LIB_OBJS
1128c2ecf20Sopenharmony_ci
1138c2ecf20Sopenharmony_ci# check if compiler option is supported
1148c2ecf20Sopenharmony_cicc-supports = ${shell if $(CC) ${1} -S -o /dev/null -x c /dev/null > /dev/null 2>&1; then echo "$(1)"; fi;}
1158c2ecf20Sopenharmony_ci
1168c2ecf20Sopenharmony_ci# use '-Os' optimization if available, else use -O2
1178c2ecf20Sopenharmony_ciOPTIMIZATION := $(call cc-supports,-Os,-O2)
1188c2ecf20Sopenharmony_ci
1198c2ecf20Sopenharmony_ciWARNINGS := -Wall -Wchar-subscripts -Wpointer-arith -Wsign-compare
1208c2ecf20Sopenharmony_ciWARNINGS += $(call cc-supports,-Wno-pointer-sign)
1218c2ecf20Sopenharmony_ciWARNINGS += $(call cc-supports,-Wdeclaration-after-statement)
1228c2ecf20Sopenharmony_ciWARNINGS += -Wshadow
1238c2ecf20Sopenharmony_ci
1248c2ecf20Sopenharmony_cioverride CFLAGS += -DVERSION=\"$(VERSION)\" -DPACKAGE=\"$(PACKAGE)\" \
1258c2ecf20Sopenharmony_ci		-DPACKAGE_BUGREPORT=\"$(PACKAGE_BUGREPORT)\" -D_GNU_SOURCE
1268c2ecf20Sopenharmony_ci
1278c2ecf20Sopenharmony_ciUTIL_OBJS =  utils/helpers/amd.o utils/helpers/msr.o \
1288c2ecf20Sopenharmony_ci	utils/helpers/sysfs.o utils/helpers/misc.o utils/helpers/cpuid.o \
1298c2ecf20Sopenharmony_ci	utils/helpers/pci.o utils/helpers/bitmask.o \
1308c2ecf20Sopenharmony_ci	utils/idle_monitor/nhm_idle.o utils/idle_monitor/snb_idle.o \
1318c2ecf20Sopenharmony_ci	utils/idle_monitor/hsw_ext_idle.o \
1328c2ecf20Sopenharmony_ci	utils/idle_monitor/amd_fam14h_idle.o utils/idle_monitor/cpuidle_sysfs.o \
1338c2ecf20Sopenharmony_ci	utils/idle_monitor/mperf_monitor.o utils/idle_monitor/cpupower-monitor.o \
1348c2ecf20Sopenharmony_ci	utils/cpupower.o utils/cpufreq-info.o utils/cpufreq-set.o \
1358c2ecf20Sopenharmony_ci	utils/cpupower-set.o utils/cpupower-info.o utils/cpuidle-info.o \
1368c2ecf20Sopenharmony_ci	utils/cpuidle-set.o
1378c2ecf20Sopenharmony_ci
1388c2ecf20Sopenharmony_ciUTIL_SRC := $(UTIL_OBJS:.o=.c)
1398c2ecf20Sopenharmony_ci
1408c2ecf20Sopenharmony_ciUTIL_OBJS := $(addprefix $(OUTPUT),$(UTIL_OBJS))
1418c2ecf20Sopenharmony_ci
1428c2ecf20Sopenharmony_ciUTIL_HEADERS = utils/helpers/helpers.h utils/idle_monitor/cpupower-monitor.h \
1438c2ecf20Sopenharmony_ci	utils/helpers/bitmask.h \
1448c2ecf20Sopenharmony_ci	utils/idle_monitor/idle_monitors.h utils/idle_monitor/idle_monitors.def
1458c2ecf20Sopenharmony_ci
1468c2ecf20Sopenharmony_ciLIB_HEADERS = 	lib/cpufreq.h lib/cpupower.h lib/cpuidle.h
1478c2ecf20Sopenharmony_ciLIB_SRC = 	lib/cpufreq.c lib/cpupower.c lib/cpuidle.c
1488c2ecf20Sopenharmony_ciLIB_OBJS = 	lib/cpufreq.o lib/cpupower.o lib/cpuidle.o
1498c2ecf20Sopenharmony_ciLIB_OBJS :=	$(addprefix $(OUTPUT),$(LIB_OBJS))
1508c2ecf20Sopenharmony_ci
1518c2ecf20Sopenharmony_cioverride CFLAGS +=	-pipe
1528c2ecf20Sopenharmony_ci
1538c2ecf20Sopenharmony_ciifeq ($(strip $(NLS)),true)
1548c2ecf20Sopenharmony_ci	INSTALL_NLS += install-gmo
1558c2ecf20Sopenharmony_ci	COMPILE_NLS += create-gmo
1568c2ecf20Sopenharmony_ci	override CFLAGS += -DNLS
1578c2ecf20Sopenharmony_ciendif
1588c2ecf20Sopenharmony_ci
1598c2ecf20Sopenharmony_ciifeq ($(strip $(CPUFREQ_BENCH)),true)
1608c2ecf20Sopenharmony_ci	INSTALL_BENCH += install-bench
1618c2ecf20Sopenharmony_ci	COMPILE_BENCH += compile-bench
1628c2ecf20Sopenharmony_ciendif
1638c2ecf20Sopenharmony_ci
1648c2ecf20Sopenharmony_ciifeq ($(strip $(STATIC)),true)
1658c2ecf20Sopenharmony_ci        UTIL_OBJS += $(LIB_OBJS)
1668c2ecf20Sopenharmony_ci        UTIL_HEADERS += $(LIB_HEADERS)
1678c2ecf20Sopenharmony_ci        UTIL_SRC += $(LIB_SRC)
1688c2ecf20Sopenharmony_ciendif
1698c2ecf20Sopenharmony_ci
1708c2ecf20Sopenharmony_cioverride CFLAGS += $(WARNINGS)
1718c2ecf20Sopenharmony_ci
1728c2ecf20Sopenharmony_ciifeq ($(strip $(V)),false)
1738c2ecf20Sopenharmony_ci	QUIET=@
1748c2ecf20Sopenharmony_ci	ECHO=@echo
1758c2ecf20Sopenharmony_cielse
1768c2ecf20Sopenharmony_ci	QUIET=
1778c2ecf20Sopenharmony_ci	ECHO=@\#
1788c2ecf20Sopenharmony_ciendif
1798c2ecf20Sopenharmony_ciexport QUIET ECHO
1808c2ecf20Sopenharmony_ci
1818c2ecf20Sopenharmony_ci# if DEBUG is enabled, then we do not strip or optimize
1828c2ecf20Sopenharmony_ciifeq ($(strip $(DEBUG)),true)
1838c2ecf20Sopenharmony_ci	override CFLAGS += -O1 -g -DDEBUG
1848c2ecf20Sopenharmony_ci	STRIPCMD = /bin/true -Since_we_are_debugging
1858c2ecf20Sopenharmony_cielse
1868c2ecf20Sopenharmony_ci	override CFLAGS += $(OPTIMIZATION) -fomit-frame-pointer
1878c2ecf20Sopenharmony_ci	STRIPCMD = $(STRIP) -s --remove-section=.note --remove-section=.comment
1888c2ecf20Sopenharmony_ciendif
1898c2ecf20Sopenharmony_ci
1908c2ecf20Sopenharmony_ci
1918c2ecf20Sopenharmony_ci# the actual make rules
1928c2ecf20Sopenharmony_ci
1938c2ecf20Sopenharmony_ciall: libcpupower $(OUTPUT)cpupower $(COMPILE_NLS) $(COMPILE_BENCH)
1948c2ecf20Sopenharmony_ci
1958c2ecf20Sopenharmony_ci$(OUTPUT)lib/%.o: $(LIB_SRC) $(LIB_HEADERS)
1968c2ecf20Sopenharmony_ci	$(ECHO) "  CC      " $@
1978c2ecf20Sopenharmony_ci	$(QUIET) $(CC) $(CFLAGS) -fPIC -o $@ -c lib/$*.c
1988c2ecf20Sopenharmony_ci
1998c2ecf20Sopenharmony_ci$(OUTPUT)libcpupower.so.$(LIB_MAJ): $(LIB_OBJS)
2008c2ecf20Sopenharmony_ci	$(ECHO) "  LD      " $@
2018c2ecf20Sopenharmony_ci	$(QUIET) $(CC) -shared $(CFLAGS) $(LDFLAGS) -o $@ \
2028c2ecf20Sopenharmony_ci		-Wl,-soname,libcpupower.so.$(LIB_MIN) $(LIB_OBJS)
2038c2ecf20Sopenharmony_ci	@ln -sf $(@F) $(OUTPUT)libcpupower.so
2048c2ecf20Sopenharmony_ci	@ln -sf $(@F) $(OUTPUT)libcpupower.so.$(LIB_MIN)
2058c2ecf20Sopenharmony_ci
2068c2ecf20Sopenharmony_cilibcpupower: $(OUTPUT)libcpupower.so.$(LIB_MAJ)
2078c2ecf20Sopenharmony_ci
2088c2ecf20Sopenharmony_ci# Let all .o files depend on its .c file and all headers
2098c2ecf20Sopenharmony_ci# Might be worth to put this into utils/Makefile at some point of time
2108c2ecf20Sopenharmony_ci$(UTIL_OBJS): $(UTIL_HEADERS)
2118c2ecf20Sopenharmony_ci
2128c2ecf20Sopenharmony_ci$(OUTPUT)%.o: %.c
2138c2ecf20Sopenharmony_ci	$(ECHO) "  CC      " $@
2148c2ecf20Sopenharmony_ci	$(QUIET) $(CC) $(CFLAGS) -I./lib -I ./utils -o $@ -c $*.c
2158c2ecf20Sopenharmony_ci
2168c2ecf20Sopenharmony_ci$(OUTPUT)cpupower: $(UTIL_OBJS) $(OUTPUT)libcpupower.so.$(LIB_MAJ)
2178c2ecf20Sopenharmony_ci	$(ECHO) "  CC      " $@
2188c2ecf20Sopenharmony_ciifeq ($(strip $(STATIC)),true)
2198c2ecf20Sopenharmony_ci	$(QUIET) $(CC) $(CFLAGS) $(LDFLAGS) $(UTIL_OBJS) -lrt -lpci -L$(OUTPUT) -o $@
2208c2ecf20Sopenharmony_cielse
2218c2ecf20Sopenharmony_ci	$(QUIET) $(CC) $(CFLAGS) $(LDFLAGS) $(UTIL_OBJS) -lcpupower -lrt -lpci -L$(OUTPUT) -o $@
2228c2ecf20Sopenharmony_ciendif
2238c2ecf20Sopenharmony_ci	$(QUIET) $(STRIPCMD) $@
2248c2ecf20Sopenharmony_ci
2258c2ecf20Sopenharmony_ci$(OUTPUT)po/$(PACKAGE).pot: $(UTIL_SRC)
2268c2ecf20Sopenharmony_ci	$(ECHO) "  GETTEXT " $@
2278c2ecf20Sopenharmony_ci	$(QUIET) xgettext --default-domain=$(PACKAGE) --add-comments \
2288c2ecf20Sopenharmony_ci		--keyword=_ --keyword=N_ $(UTIL_SRC) -p $(@D) -o $(@F)
2298c2ecf20Sopenharmony_ci
2308c2ecf20Sopenharmony_ci$(OUTPUT)po/%.gmo: po/%.po
2318c2ecf20Sopenharmony_ci	$(ECHO) "  MSGFMT  " $@
2328c2ecf20Sopenharmony_ci	$(QUIET) msgfmt -o $@ po/$*.po
2338c2ecf20Sopenharmony_ci
2348c2ecf20Sopenharmony_cicreate-gmo: ${GMO_FILES}
2358c2ecf20Sopenharmony_ci
2368c2ecf20Sopenharmony_ciupdate-po: $(OUTPUT)po/$(PACKAGE).pot
2378c2ecf20Sopenharmony_ci	$(ECHO) "  MSGMRG  " $@
2388c2ecf20Sopenharmony_ci	$(QUIET) @for HLANG in $(LANGUAGES); do \
2398c2ecf20Sopenharmony_ci		echo -n "Updating $$HLANG "; \
2408c2ecf20Sopenharmony_ci		if msgmerge po/$$HLANG.po $< -o \
2418c2ecf20Sopenharmony_ci		   $(OUTPUT)po/$$HLANG.new.po; then \
2428c2ecf20Sopenharmony_ci			mv -f $(OUTPUT)po/$$HLANG.new.po $(OUTPUT)po/$$HLANG.po; \
2438c2ecf20Sopenharmony_ci		else \
2448c2ecf20Sopenharmony_ci			echo "msgmerge for $$HLANG failed!"; \
2458c2ecf20Sopenharmony_ci			rm -f $(OUTPUT)po/$$HLANG.new.po; \
2468c2ecf20Sopenharmony_ci		fi; \
2478c2ecf20Sopenharmony_ci	done;
2488c2ecf20Sopenharmony_ci
2498c2ecf20Sopenharmony_cicompile-bench: $(OUTPUT)libcpupower.so.$(LIB_MAJ)
2508c2ecf20Sopenharmony_ci	@V=$(V) confdir=$(confdir) $(MAKE) -C bench O=$(OUTPUT)
2518c2ecf20Sopenharmony_ci
2528c2ecf20Sopenharmony_ci# we compile into subdirectories. if the target directory is not the
2538c2ecf20Sopenharmony_ci# source directory, they might not exists. So we depend the various
2548c2ecf20Sopenharmony_ci# files onto their directories.
2558c2ecf20Sopenharmony_ciDIRECTORY_DEPS = $(LIB_OBJS) $(UTIL_OBJS) $(GMO_FILES)
2568c2ecf20Sopenharmony_ci$(DIRECTORY_DEPS): | $(sort $(dir $(DIRECTORY_DEPS)))
2578c2ecf20Sopenharmony_ci
2588c2ecf20Sopenharmony_ci# In the second step, we make a rule to actually create these directories
2598c2ecf20Sopenharmony_ci$(sort $(dir $(DIRECTORY_DEPS))):
2608c2ecf20Sopenharmony_ci	$(ECHO) "  MKDIR      " $@
2618c2ecf20Sopenharmony_ci	$(QUIET) $(MKDIR) -p $@ 2>/dev/null
2628c2ecf20Sopenharmony_ci
2638c2ecf20Sopenharmony_ciclean:
2648c2ecf20Sopenharmony_ci	-find $(OUTPUT) \( -not -type d \) -and \( -name '*~' -o -name '*.[oas]' \) -type f -print \
2658c2ecf20Sopenharmony_ci	 | xargs rm -f
2668c2ecf20Sopenharmony_ci	-rm -f $(OUTPUT)cpupower
2678c2ecf20Sopenharmony_ci	-rm -f $(OUTPUT)libcpupower.so*
2688c2ecf20Sopenharmony_ci	-rm -rf $(OUTPUT)po/*.gmo
2698c2ecf20Sopenharmony_ci	-rm -rf $(OUTPUT)po/*.pot
2708c2ecf20Sopenharmony_ci	$(MAKE) -C bench O=$(OUTPUT) clean
2718c2ecf20Sopenharmony_ci
2728c2ecf20Sopenharmony_ci
2738c2ecf20Sopenharmony_ciinstall-lib: libcpupower
2748c2ecf20Sopenharmony_ci	$(INSTALL) -d $(DESTDIR)${libdir}
2758c2ecf20Sopenharmony_ci	$(CP) $(OUTPUT)libcpupower.so* $(DESTDIR)${libdir}/
2768c2ecf20Sopenharmony_ci	$(INSTALL) -d $(DESTDIR)${includedir}
2778c2ecf20Sopenharmony_ci	$(INSTALL_DATA) lib/cpufreq.h $(DESTDIR)${includedir}/cpufreq.h
2788c2ecf20Sopenharmony_ci	$(INSTALL_DATA) lib/cpuidle.h $(DESTDIR)${includedir}/cpuidle.h
2798c2ecf20Sopenharmony_ci
2808c2ecf20Sopenharmony_ciinstall-tools: $(OUTPUT)cpupower
2818c2ecf20Sopenharmony_ci	$(INSTALL) -d $(DESTDIR)${bindir}
2828c2ecf20Sopenharmony_ci	$(INSTALL_PROGRAM) $(OUTPUT)cpupower $(DESTDIR)${bindir}
2838c2ecf20Sopenharmony_ci	$(INSTALL) -d $(DESTDIR)${bash_completion_dir}
2848c2ecf20Sopenharmony_ci	$(INSTALL_SCRIPT) cpupower-completion.sh '$(DESTDIR)${bash_completion_dir}/cpupower'
2858c2ecf20Sopenharmony_ci
2868c2ecf20Sopenharmony_ciinstall-man:
2878c2ecf20Sopenharmony_ci	$(INSTALL_DATA) -D man/cpupower.1 $(DESTDIR)${mandir}/man1/cpupower.1
2888c2ecf20Sopenharmony_ci	$(INSTALL_DATA) -D man/cpupower-frequency-set.1 $(DESTDIR)${mandir}/man1/cpupower-frequency-set.1
2898c2ecf20Sopenharmony_ci	$(INSTALL_DATA) -D man/cpupower-frequency-info.1 $(DESTDIR)${mandir}/man1/cpupower-frequency-info.1
2908c2ecf20Sopenharmony_ci	$(INSTALL_DATA) -D man/cpupower-idle-set.1 $(DESTDIR)${mandir}/man1/cpupower-idle-set.1
2918c2ecf20Sopenharmony_ci	$(INSTALL_DATA) -D man/cpupower-idle-info.1 $(DESTDIR)${mandir}/man1/cpupower-idle-info.1
2928c2ecf20Sopenharmony_ci	$(INSTALL_DATA) -D man/cpupower-set.1 $(DESTDIR)${mandir}/man1/cpupower-set.1
2938c2ecf20Sopenharmony_ci	$(INSTALL_DATA) -D man/cpupower-info.1 $(DESTDIR)${mandir}/man1/cpupower-info.1
2948c2ecf20Sopenharmony_ci	$(INSTALL_DATA) -D man/cpupower-monitor.1 $(DESTDIR)${mandir}/man1/cpupower-monitor.1
2958c2ecf20Sopenharmony_ci
2968c2ecf20Sopenharmony_ciinstall-gmo: create-gmo
2978c2ecf20Sopenharmony_ci	$(INSTALL) -d $(DESTDIR)${localedir}
2988c2ecf20Sopenharmony_ci	for HLANG in $(LANGUAGES); do \
2998c2ecf20Sopenharmony_ci		echo '$(INSTALL_DATA) -D $(OUTPUT)po/$$HLANG.gmo $(DESTDIR)${localedir}/$$HLANG/LC_MESSAGES/cpupower.mo'; \
3008c2ecf20Sopenharmony_ci		$(INSTALL_DATA) -D $(OUTPUT)po/$$HLANG.gmo $(DESTDIR)${localedir}/$$HLANG/LC_MESSAGES/cpupower.mo; \
3018c2ecf20Sopenharmony_ci	done;
3028c2ecf20Sopenharmony_ci
3038c2ecf20Sopenharmony_ciinstall-bench: compile-bench
3048c2ecf20Sopenharmony_ci	@#DESTDIR must be set from outside to survive
3058c2ecf20Sopenharmony_ci	@sbindir=$(sbindir) bindir=$(bindir) docdir=$(docdir) confdir=$(confdir) $(MAKE) -C bench O=$(OUTPUT) install
3068c2ecf20Sopenharmony_ci
3078c2ecf20Sopenharmony_ciifeq ($(strip $(STATIC)),true)
3088c2ecf20Sopenharmony_ciinstall: all install-tools install-man $(INSTALL_NLS) $(INSTALL_BENCH)
3098c2ecf20Sopenharmony_cielse
3108c2ecf20Sopenharmony_ciinstall: all install-lib install-tools install-man $(INSTALL_NLS) $(INSTALL_BENCH)
3118c2ecf20Sopenharmony_ciendif
3128c2ecf20Sopenharmony_ci
3138c2ecf20Sopenharmony_ciuninstall:
3148c2ecf20Sopenharmony_ci	- rm -f $(DESTDIR)${libdir}/libcpupower.*
3158c2ecf20Sopenharmony_ci	- rm -f $(DESTDIR)${includedir}/cpufreq.h
3168c2ecf20Sopenharmony_ci	- rm -f $(DESTDIR)${includedir}/cpuidle.h
3178c2ecf20Sopenharmony_ci	- rm -f $(DESTDIR)${bindir}/utils/cpupower
3188c2ecf20Sopenharmony_ci	- rm -f $(DESTDIR)${mandir}/man1/cpupower.1
3198c2ecf20Sopenharmony_ci	- rm -f $(DESTDIR)${mandir}/man1/cpupower-frequency-set.1
3208c2ecf20Sopenharmony_ci	- rm -f $(DESTDIR)${mandir}/man1/cpupower-frequency-info.1
3218c2ecf20Sopenharmony_ci	- rm -f $(DESTDIR)${mandir}/man1/cpupower-set.1
3228c2ecf20Sopenharmony_ci	- rm -f $(DESTDIR)${mandir}/man1/cpupower-info.1
3238c2ecf20Sopenharmony_ci	- rm -f $(DESTDIR)${mandir}/man1/cpupower-monitor.1
3248c2ecf20Sopenharmony_ci	- for HLANG in $(LANGUAGES); do \
3258c2ecf20Sopenharmony_ci		rm -f $(DESTDIR)${localedir}/$$HLANG/LC_MESSAGES/cpupower.mo; \
3268c2ecf20Sopenharmony_ci	  done;
3278c2ecf20Sopenharmony_ci
3288c2ecf20Sopenharmony_ci.PHONY: all utils libcpupower update-po create-gmo install-lib install-tools install-man install-gmo install uninstall clean
329