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

TOMOYO Linux Cross Reference
Linux/tools/perf/Makefile

Version: ~ [ linux-6.0-rc6 ] ~ [ linux-5.19.10 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.69 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.144 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.214 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.259 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.294 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.329 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.302 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ 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.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

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

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

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | 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.

osdn.jp