Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

tools/power x86_energy_perf_policy: Add make snapshot target

$ make snapshot
creates x86_energy_perf_policy-$(DATE).tar.gz

Which can be transported to a target machine
without needing a kernel tree to build on the target.

Useful for creating debug versions.

Signed-off-by: Len Brown <len.brown@intel.com>

Len Brown a648e089 2734fdbc

+28 -1
+28 -1
tools/power/x86/x86_energy_perf_policy/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 CC = $(CROSS_COMPILE)gcc 3 - BUILD_OUTPUT := $(CURDIR) 3 + BUILD_OUTPUT := $(CURDIR) 4 4 PREFIX := /usr 5 5 DESTDIR := 6 + DAY := $(shell date +%Y.%m.%d) 7 + SNAPSHOT = x86_energy_perf_policy-$(DAY) 8 + 9 + 6 10 7 11 ifeq ("$(origin O)", "command line") 8 12 BUILD_OUTPUT := $(O) ··· 30 26 install $(BUILD_OUTPUT)/x86_energy_perf_policy $(DESTDIR)$(PREFIX)/bin/x86_energy_perf_policy 31 27 install -d $(DESTDIR)$(PREFIX)/share/man/man8 32 28 install -m 644 x86_energy_perf_policy.8 $(DESTDIR)$(PREFIX)/share/man/man8 29 + 30 + snapshot: x86_energy_perf_policy 31 + @rm -rf $(SNAPSHOT) 32 + @mkdir $(SNAPSHOT) 33 + @cp x86_energy_perf_policy Makefile x86_energy_perf_policy.c x86_energy_perf_policy.8 $(SNAPSHOT) 34 + 35 + @sed -e 's/^#include <linux\/bits.h>/#include "bits.h"/' -e 's/u64/unsigned long long/' ../../../../arch/x86/include/asm/msr-index.h > $(SNAPSHOT)/msr-index.h 36 + @echo '#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))' >> $(SNAPSHOT)/msr-index.h 37 + @echo "#define BIT(x) (1 << (x))" > $(SNAPSHOT)/bits.h 38 + @echo "#define BIT_ULL(nr) (1ULL << (nr))" >> $(SNAPSHOT)/bits.h 39 + @echo "#define GENMASK(h, l) (((~0UL) << (l)) & (~0UL >> (sizeof(long) * 8 - 1 - (h))))" >> $(SNAPSHOT)/bits.h 40 + @echo "#define GENMASK_ULL(h, l) (((~0ULL) << (l)) & (~0ULL >> (sizeof(long long) * 8 - 1 - (h))))" >> $(SNAPSHOT)/bits.h 41 + 42 + @echo '#define BUILD_BUG_ON(cond) do { enum { compile_time_check ## __COUNTER__ = 1/(!(cond)) }; } while (0)' > $(SNAPSHOT)/build_bug.h 43 + @echo '#define __must_be_array(arr) 0' >> $(SNAPSHOT)/build_bug.h 44 + 45 + @echo PWD=. > $(SNAPSHOT)/Makefile 46 + @echo "CFLAGS += -DMSRHEADER='\"msr-index.h\"'" >> $(SNAPSHOT)/Makefile 47 + @echo "CFLAGS += -DBUILD_BUG_HEADER='\"build_bug.h\"'" >> $(SNAPSHOT)/Makefile 48 + @sed -e's/.*MSRHEADER.*//' Makefile >> $(SNAPSHOT)/Makefile 49 + 50 + @rm -f $(SNAPSHOT).tar.gz 51 + tar cvzf $(SNAPSHOT).tar.gz $(SNAPSHOT) 33 52