~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/tools/perf/Makefile

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /tools/perf/Makefile (Version linux-6.12-rc7) and /tools/perf/Makefile (Version linux-4.10.17)


  1 # SPDX-License-Identifier: GPL-2.0             << 
  2 #                                                   1 #
  3 # This is a simple wrapper Makefile that calls      2 # This is a simple wrapper Makefile that calls the main Makefile.perf
  4 # with a -j option to do parallel builds            3 # with a -j option to do parallel builds
  5 #                                                   4 #
  6 # If you want to invoke the perf build in some      5 # If you want to invoke the perf build in some non-standard way then
  7 # you can use the 'make -f Makefile.perf' meth      6 # you can use the 'make -f Makefile.perf' method to invoke it.
  8 #                                                   7 #
  9                                                     8 
 10 #                                                   9 #
 11 # Clear out the built-in rules GNU make define     10 # Clear out the built-in rules GNU make defines by default (such as .o targets),
 12 # so that we pass through all targets to Makef     11 # so that we pass through all targets to Makefile.perf:
 13 #                                                  12 #
 14 .SUFFIXES:                                         13 .SUFFIXES:
 15                                                    14 
 16 #                                                  15 #
 17 # We don't want to pass along options like -j:     16 # We don't want to pass along options like -j:
 18 #                                                  17 #
 19 unexport MAKEFLAGS                                 18 unexport MAKEFLAGS
 20                                                    19 
 21 #                                                  20 #
 22 # Do a parallel build with multiple jobs, base     21 # Do a parallel build with multiple jobs, based on the number of CPUs online
 23 # in this system: 'make -j8' on a 8-CPU system     22 # in this system: 'make -j8' on a 8-CPU system, etc.
 24 #                                                  23 #
 25 # (To override it, run 'make JOBS=1' and simil     24 # (To override it, run 'make JOBS=1' and similar.)
 26 #                                                  25 #
 27 ifeq ($(JOBS),)                                    26 ifeq ($(JOBS),)
 28   JOBS := $(shell (getconf _NPROCESSORS_ONLN | !!  27   JOBS := $(shell (getconf _NPROCESSORS_ONLN || egrep -c '^processor|^CPU[0-9]' /proc/cpuinfo) 2>/dev/null)
 29   ifeq ($(JOBS),0)                                 28   ifeq ($(JOBS),0)
 30     JOBS := 1                                      29     JOBS := 1
 31   endif                                            30   endif
 32 endif                                              31 endif
 33                                                    32 
 34 #                                                  33 #
 35 # Only pass canonical directory names as the o     34 # Only pass canonical directory names as the output directory:
 36 #                                                  35 #
 37 ifneq ($(O),)                                      36 ifneq ($(O),)
 38   FULL_O := $(shell cd $(PWD); readlink -f $(O !!  37   FULL_O := $(shell readlink -f $(O) || echo $(O))
 39 endif                                              38 endif
 40                                                    39 
 41 #                                                  40 #
 42 # Only accept the 'DEBUG' variable from the co     41 # Only accept the 'DEBUG' variable from the command line:
 43 #                                                  42 #
 44 ifeq ("$(origin DEBUG)", "command line")           43 ifeq ("$(origin DEBUG)", "command line")
 45   ifeq ($(DEBUG),)                                 44   ifeq ($(DEBUG),)
 46     override DEBUG = 0                             45     override DEBUG = 0
 47   else                                             46   else
 48     SET_DEBUG = "DEBUG=$(DEBUG)"                   47     SET_DEBUG = "DEBUG=$(DEBUG)"
 49   endif                                            48   endif
 50 else                                               49 else
 51   override DEBUG = 0                               50   override DEBUG = 0
 52 endif                                              51 endif
 53                                                    52 
 54 ifeq ($(JOBS),1)                               << 
 55   BUILD_TYPE := sequential                     << 
 56 else                                           << 
 57   BUILD_TYPE := parallel                       << 
 58 endif                                          << 
 59                                                << 
 60 define print_msg                                   53 define print_msg
 61   @printf '  BUILD:   Doing '\''make \033[33m- !!  54   @printf '  BUILD:   Doing '\''make \033[33m-j'$(JOBS)'\033[m'\'' parallel build\n'
 62 endef                                              55 endef
 63                                                    56 
 64 define make                                        57 define make
 65   @$(MAKE) -f Makefile.perf --no-print-directo     58   @$(MAKE) -f Makefile.perf --no-print-directory -j$(JOBS) O=$(FULL_O) $(SET_DEBUG) $@
 66 endef                                              59 endef
 67                                                    60 
 68 #                                                  61 #
 69 # Needed if no target specified:                   62 # Needed if no target specified:
 70 # (Except for tags and TAGS targets. The reaso     63 # (Except for tags and TAGS targets. The reason is that the
 71 # Makefile does not treat tags/TAGS as targets     64 # Makefile does not treat tags/TAGS as targets but as files
 72 # and thus won't rebuilt them once they are in     65 # and thus won't rebuilt them once they are in place.)
 73 #                                                  66 #
 74 all tags TAGS:                                     67 all tags TAGS:
 75         $(print_msg)                               68         $(print_msg)
 76         $(make)                                    69         $(make)
 77                                                    70 
 78 ifdef MAKECMDGOALS                                 71 ifdef MAKECMDGOALS
 79 has_clean := 0                                     72 has_clean := 0
 80 ifneq ($(filter clean,$(MAKECMDGOALS)),)           73 ifneq ($(filter clean,$(MAKECMDGOALS)),)
 81   has_clean := 1                                   74   has_clean := 1
 82 endif # clean                                      75 endif # clean
 83                                                    76 
 84 ifeq ($(has_clean),1)                              77 ifeq ($(has_clean),1)
 85   rest := $(filter-out clean,$(MAKECMDGOALS))      78   rest := $(filter-out clean,$(MAKECMDGOALS))
 86   ifneq ($(rest),)                                 79   ifneq ($(rest),)
 87 $(rest): clean                                     80 $(rest): clean
 88   endif # rest                                     81   endif # rest
 89 endif # has_clean                                  82 endif # has_clean
 90 endif # MAKECMDGOALS                               83 endif # MAKECMDGOALS
 91                                                    84 
 92 #                                                  85 #
 93 # Explicitly disable parallelism for the clean !!  86 # The clean target is not really parallel, don't print the jobs info:
 94 #                                                  87 #
 95 clean:                                             88 clean:
 96         $(make) -j1                            !!  89         $(make)
 97                                                    90 
 98 #                                                  91 #
 99 # The build-test target is not really parallel     92 # The build-test target is not really parallel, don't print the jobs info,
100 # it also uses only the tests/make targets tha     93 # it also uses only the tests/make targets that don't pollute the source
101 # repository, i.e. that uses O= or builds the      94 # repository, i.e. that uses O= or builds the tarpkg outside the source
102 # repo directories.                                95 # repo directories.
103 #                                                  96 #
104 # For a full test, use:                            97 # For a full test, use:
105 #                                                  98 #
106 # make -C tools/perf -f tests/make                 99 # make -C tools/perf -f tests/make
107 #                                                 100 #
108 build-test:                                       101 build-test:
109         @$(MAKE) SHUF=1 -f tests/make REUSE_FE !! 102         @$(MAKE) SHUF=1 -f tests/make REUSE_FEATURES_DUMP=1 MK=Makefile SET_PARALLEL=1 --no-print-directory tarpkg out
110                                                << 
111 build-test-tarball:                            << 
112         @$(MAKE) -f tests/make REUSE_FEATURES_ << 
113                                                   103 
114 #                                                 104 #
115 # All other targets get passed through:           105 # All other targets get passed through:
116 #                                                 106 #
117 %: FORCE                                          107 %: FORCE
118         $(print_msg)                              108         $(print_msg)
119         $(make)                                   109         $(make)
120                                                   110 
121 .PHONY: tags TAGS FORCE Makefile                  111 .PHONY: tags TAGS FORCE Makefile
                                                      

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php