From edac7e6f33c70036f1f60c394127f51a77eb5d2b Mon Sep 17 00:00:00 2001 From: Konrad Rzeszutek Wilk Date: Fri, 15 Jun 2012 11:48:04 -0400 Subject: [PATCH] Makefile: build perf and oprofile (also add cpupower) Signed-off-by: Konrad Rzeszutek Wilk --- root_image/Makefile | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/root_image/Makefile b/root_image/Makefile index 9c8c471..fb3fc05 100644 --- a/root_image/Makefile +++ b/root_image/Makefile @@ -41,7 +41,7 @@ FC12_RPM = 1 endif NCPUS := $(shell grep processor /proc/cpuinfo | wc -l) -TOP = ../ +TOP = $(shell pwd)/../ include $(TOP)/sources.mk LINUX_DST = $(TOP)/linux-build LINUX_SRC = $(dir $(CURDIR))linux @@ -188,7 +188,7 @@ distdir: # This target includes all userspace tools and images # It does not include the Linux drivers/modules found in the modulespace target .PHONY: root_image-userspace-install -root_image-userspace-install: $(USERSPACE_INSTALL) add-libs add-bins add-debug-bins tools-install wget-install vim-install rsync-install openssh-install xtt-tools-install netperf-install lvm2-install plymouth-install pciutils-install iscsi-install bridge-utils-install xend-install nfs-install fio-install directfb-install irqbalance-install pm-utils-install cpufrequtils-install kexec-tools-install +root_image-userspace-install: $(USERSPACE_INSTALL) add-libs add-bins add-debug-bins tools-install wget-install vim-install rsync-install openssh-install xtt-tools-install netperf-install lvm2-install plymouth-install pciutils-install iscsi-install bridge-utils-install xend-install nfs-install fio-install directfb-install irqbalance-install pm-utils-install cpufrequtils-install kexec-tools-install perf-install oprofile-install rm -rf userspace/man rm -rf userspace/usr/share/man @@ -805,6 +805,36 @@ xen-4.2-depend: $(call RPM_TO_USERSPACE,*libldap*.so*,$(RPM_DIR)/openldap) $(call RPM_TO_USERSPACE,*libgthread*.so*,$(RPM_DIR)/glib2) +.PHONY: power-depend +power-depend: + +.PHONY: perf-depend +perf-depend: + $(call RPM_TO_USERSPACE,*libelf*.so*,$(RPM_DIR)/elfutils-libelf) + $(call RPM_TO_USERSPACE,*libdw*.so*,$(RPM_DIR)/elfutils-libs) + $(call RPM_TO_USERSPACE,*libnewt*.so*,$(RPM_DIR)/newt) + $(call RPM_TO_USERSPACE,*libslang*.so*,$(RPM_DIR)/slang) + $(call RPM_TO_USERSPACE,*libnewt*.so*,$(RPM_DIR)/newt) + $(call RPM_TO_USERSPACE,./usr/bin/less,$(RPM_DIR)/less) + $(call RPM_TO_USERSPACE,./usr/bin/expand,$(RPM_DIR)/coreutils) + +.PHONY: perf-install +perf-install: perf-depend + $(MAKE) -j$$(($(NCPUS) * 2)) $(MFLAGS) V=1 NO_GTK2=1 DESTDIR=$(shell pwd)/userspace/ -C $(LINUX_SRC)/tools O=$(LINUX_DST) perf_install + +.PHONY: power-install +power-install: power-depend + $(MAKE) $(MFLAGS) V=1 DESTDIR=$(shell pwd)/userspace/ -C $(LINUX_SRC)/tools O=$(LINUX_DST) cpupower_install +ifeq ($(RPM_ARCH), x86_64) + (cd userspace/usr$(LIBSDIR); ln -fs ../lib/libcpupower.so.0) +endif + +.PHONY: oprofile-install +oprofile-install: + if ! [ -e oprofile/config.h ]; then (cd oprofile; ./autogen.sh;./configure --prefix=/usr); fi + $(MAKE) $(MFLAGS) -j$$(($(NCPUS) * 2)) -C oprofile + $(MAKE) $(MFLAGS) -j$$(($(NCPUS) * 2)) -C oprofile prefix=$(CURDIR)/userspace install + XEN_SRC = $(dir $(CURDIR))xen XEN_DISTDIR = $(dir $(CURDIR))xen/dist/install -- 2.39.5