Blame view
tools/perf/Makefile
2.52 KB
b24413180 License cleanup: ... |
1 |
# SPDX-License-Identifier: GPL-2.0 |
684f434cc tools/perf/build:... |
2 3 4 5 6 7 8 |
# # This is a simple wrapper Makefile that calls the main Makefile.perf # with a -j option to do parallel builds # # If you want to invoke the perf build in some non-standard way then # you can use the 'make -f Makefile.perf' method to invoke it. # |
b016a0dd0 tools/perf/build:... |
9 10 11 12 13 14 |
# # Clear out the built-in rules GNU make defines by default (such as .o targets), # so that we pass through all targets to Makefile.perf: # .SUFFIXES: |
4e34d9588 perf tools: Conve... |
15 |
# |
684f434cc tools/perf/build:... |
16 17 18 19 20 |
# We don't want to pass along options like -j: # unexport MAKEFLAGS # |
bd69cc286 tools/perf/build:... |
21 22 |
# Do a parallel build with multiple jobs, based on the number of CPUs online # in this system: 'make -j8' on a 8-CPU system, etc. |
79d824e31 perf tools: Make ... |
23 |
# |
bd69cc286 tools/perf/build:... |
24 |
# (To override it, run 'make JOBS=1' and similar.) |
4e22db464 perf tools: Add N... |
25 |
# |
bd69cc286 tools/perf/build:... |
26 |
ifeq ($(JOBS),) |
762abdc0c perf tools: Use g... |
27 |
JOBS := $(shell (getconf _NPROCESSORS_ONLN || egrep -c '^processor|^CPU[0-9]' /proc/cpuinfo) 2>/dev/null) |
c65568c54 perf tools: Compa... |
28 |
ifeq ($(JOBS),0) |
bd69cc286 tools/perf/build:... |
29 |
JOBS := 1 |
8e1b3f686 perf tools: Repla... |
30 |
endif |
2bcd355b7 perf tools: Add i... |
31 |
endif |
f4e7ac0a2 perf tools: add t... |
32 |
|
b102420b5 tools/perf/build:... |
33 34 35 36 |
# # Only pass canonical directory names as the output directory: # ifneq ($(O),) |
3fb66335e tools/perf/build:... |
37 |
FULL_O := $(shell readlink -f $(O) || echo $(O)) |
b102420b5 tools/perf/build:... |
38 |
endif |
fcf925850 tools/perf/build:... |
39 40 41 42 43 44 45 46 47 48 49 50 |
# # Only accept the 'DEBUG' variable from the command line: # ifeq ("$(origin DEBUG)", "command line") ifeq ($(DEBUG),) override DEBUG = 0 else SET_DEBUG = "DEBUG=$(DEBUG)" endif else override DEBUG = 0 endif |
73a725f00 tools/perf/build:... |
51 |
define print_msg |
65fb09922 tools: Harmonize ... |
52 53 |
@printf ' BUILD: Doing '\''make \033[33m-j'$(JOBS)'\033[m'\'' parallel build ' |
73a725f00 tools/perf/build:... |
54 55 56 |
endef define make |
fcf925850 tools/perf/build:... |
57 |
@$(MAKE) -f Makefile.perf --no-print-directory -j$(JOBS) O=$(FULL_O) $(SET_DEBUG) $@ |
73a725f00 tools/perf/build:... |
58 |
endef |
d24e473e5 perf_counter: cop... |
59 |
|
de0f03fb8 tools/perf/build:... |
60 |
# |
bd69cc286 tools/perf/build:... |
61 |
# Needed if no target specified: |
26286141a perf tools: Fix t... |
62 63 64 |
# (Except for tags and TAGS targets. The reason is that the # Makefile does not treat tags/TAGS as targets but as files # and thus won't rebuilt them once they are in place.) |
de0f03fb8 tools/perf/build:... |
65 |
# |
26286141a perf tools: Fix t... |
66 |
all tags TAGS: |
73a725f00 tools/perf/build:... |
67 68 |
$(print_msg) $(make) |
3e2751d91 perf tools: Fix p... |
69 70 71 72 73 74 75 76 77 78 79 80 81 |
ifdef MAKECMDGOALS has_clean := 0 ifneq ($(filter clean,$(MAKECMDGOALS)),) has_clean := 1 endif # clean ifeq ($(has_clean),1) rest := $(filter-out clean,$(MAKECMDGOALS)) ifneq ($(rest),) $(rest): clean endif # rest endif # has_clean endif # MAKECMDGOALS |
73a725f00 tools/perf/build:... |
82 |
# |
da15fc2fa perf tools: Disab... |
83 |
# Explicitly disable parallelism for the clean target. |
73a725f00 tools/perf/build:... |
84 85 |
# clean: |
da15fc2fa perf tools: Disab... |
86 |
$(make) -j1 |
c72e3f04b tools/perf/build:... |
87 |
|
73a725f00 tools/perf/build:... |
88 |
# |
a639a6239 perf tools: Speed... |
89 90 91 92 93 94 95 96 |
# The build-test target is not really parallel, don't print the jobs info, # it also uses only the tests/make targets that don't pollute the source # repository, i.e. that uses O= or builds the tarpkg outside the source # repo directories. # # For a full test, use: # # make -C tools/perf -f tests/make |
a7077234d perf tools: Add '... |
97 98 |
# build-test: |
be9e49911 perf build tests:... |
99 |
@$(MAKE) SHUF=1 -f tests/make REUSE_FEATURES_DUMP=1 MK=Makefile SET_PARALLEL=1 --no-print-directory tarpkg out |
a7077234d perf tools: Add '... |
100 101 |
# |
73a725f00 tools/perf/build:... |
102 103 |
# All other targets get passed through: # |
8e5573515 perf build: Fix s... |
104 |
%: FORCE |
73a725f00 tools/perf/build:... |
105 106 |
$(print_msg) $(make) |
26286141a perf tools: Fix t... |
107 |
|
8e5573515 perf build: Fix s... |
108 |
.PHONY: tags TAGS FORCE Makefile |