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

TOMOYO Linux Cross Reference
Linux/tools/perf/Makefile

Version: ~ [ linux-6.4-rc3 ] ~ [ linux-6.3.4 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.30 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.113 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.180 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.243 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.283 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.315 ] ~ [ 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.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

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