tools/perf/tests/make

Source file repositories/reference/linux-study-clean/tools/perf/tests/make

File Facts

System
Linux kernel
Corpus path
tools/perf/tests/make
Extension
[no extension]
Size
13377 bytes
Lines
423
Domain
Support Tooling And Documentation
Bucket
tools
Inferred role
Support Tooling And Documentation: tools
Status
atlas-only

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

include ../scripts/Makefile.include

ifndef MK
ifeq ($(MAKECMDGOALS),)
# no target specified, trigger the whole suite
all:
	@echo "Testing Makefile";      $(MAKE) -sf tests/make MK=Makefile
	@echo "Testing Makefile.perf"; $(MAKE) -sf tests/make MK=Makefile.perf SET_PARALLEL=1 SET_O=1
else
# run only specific test over 'Makefile'
%:
	@echo "Testing Makefile";      $(MAKE) -sf tests/make MK=Makefile $@
endif
else
PERF := .
PERF_O := $(PERF)
O_OPT :=
FULL_O := $(shell readlink -f $(PERF_O) || echo $(PERF_O))

ifneq ($(O),)
  FULL_O := $(shell readlink -f $(O) || echo $(O))
  PERF_O := $(FULL_O)
  ifeq ($(SET_O),1)
    O_OPT := 'O=$(FULL_O)'
  endif
  K_O_OPT := 'O=$(FULL_O)'
endif

PARALLEL_OPT=
ifeq ($(SET_PARALLEL),1)
  ifeq ($(JOBS),)
    cores := $(shell (getconf _NPROCESSORS_ONLN || grep -E -c '^processor|^CPU[0-9]' /proc/cpuinfo) 2>/dev/null)
    ifeq ($(cores),0)
      cores := 1
    endif
  else
    cores=$(JOBS)
  endif
  PARALLEL_OPT="-j$(cores)"
endif

# As per kernel Makefile, avoid funny character set dependencies
unexport LC_ALL
LC_COLLATE=C
LC_NUMERIC=C
export LC_COLLATE LC_NUMERIC

ifeq ($(srctree),)
srctree := $(patsubst %/,%,$(dir $(CURDIR)))
srctree := $(patsubst %/,%,$(dir $(srctree)))
#$(info Determined 'srctree' to be $(srctree))
endif

include $(srctree)/tools/scripts/Makefile.arch

# FIXME looks like x86 is the only arch running tests ;-)
# we need some IS_(32/64) flag to make this generic
ifeq ($(ARCH)$(IS_64_BIT), x861)
lib = lib64
else
lib = lib
endif

has = $(shell which $1 2>/dev/null)
python_perf_so := $(shell $(MAKE) python_perf_target|grep "Target is:"|awk '{print $$3}')

# standard single make variable specified
make_clean_all      := clean all
make_python_perf_so := $(python_perf_so)
make_debug          := DEBUG=1

Annotation

Implementation Notes