aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/perf/Makefile47
-rw-r--r--tools/scripts/Makefile.include57
2 files changed, 58 insertions, 46 deletions
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 820371f10d1b..4ca77cc0f284 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -1,18 +1,10 @@
1ifeq ("$(origin O)", "command line") 1include ../scripts/Makefile.include
2 OUTPUT := $(O)/
3endif
4 2
5# The default target of this Makefile is... 3# The default target of this Makefile is...
6all: 4all:
7 5
8include config/utilities.mak 6include config/utilities.mak
9 7
10ifneq ($(OUTPUT),)
11# check that the output directory actually exists
12OUTDIR := $(shell cd $(OUTPUT) && /bin/pwd)
13$(if $(OUTDIR),, $(error output directory "$(OUTPUT)" does not exist))
14endif
15
16# Define V to have a more verbose compile. 8# Define V to have a more verbose compile.
17# 9#
18# Define O to save output files in a separate directory. 10# Define O to save output files in a separate directory.
@@ -84,31 +76,6 @@ ifneq ($(WERROR),0)
84 CFLAGS_WERROR := -Werror 76 CFLAGS_WERROR := -Werror
85endif 77endif
86 78
87#
88# Include saner warnings here, which can catch bugs:
89#
90
91EXTRA_WARNINGS := -Wformat
92EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wformat-security
93EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wformat-y2k
94EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wshadow
95EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Winit-self
96EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wpacked
97EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wredundant-decls
98EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wstrict-aliasing=3
99EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wswitch-default
100EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wswitch-enum
101EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wno-system-headers
102EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wundef
103EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wwrite-strings
104EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wbad-function-cast
105EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wmissing-declarations
106EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wmissing-prototypes
107EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wnested-externs
108EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wold-style-definition
109EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wstrict-prototypes
110EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wdeclaration-after-statement
111
112ifeq ("$(origin DEBUG)", "command line") 79ifeq ("$(origin DEBUG)", "command line")
113 PERF_DEBUG = $(DEBUG) 80 PERF_DEBUG = $(DEBUG)
114endif 81endif
@@ -679,18 +646,6 @@ else
679 endif 646 endif
680endif 647endif
681 648
682ifneq ($(findstring $(MAKEFLAGS),s),s)
683ifndef V
684 QUIET_CC = @echo ' ' CC $@;
685 QUIET_AR = @echo ' ' AR $@;
686 QUIET_LINK = @echo ' ' LINK $@;
687 QUIET_MKDIR = @echo ' ' MKDIR $@;
688 QUIET_GEN = @echo ' ' GEN $@;
689 QUIET_FLEX = @echo ' ' FLEX $@;
690 QUIET_BISON = @echo ' ' BISON $@;
691endif
692endif
693
694ifdef ASCIIDOC8 649ifdef ASCIIDOC8
695 export ASCIIDOC8 650 export ASCIIDOC8
696endif 651endif
diff --git a/tools/scripts/Makefile.include b/tools/scripts/Makefile.include
new file mode 100644
index 000000000000..52348d3bd8d3
--- /dev/null
+++ b/tools/scripts/Makefile.include
@@ -0,0 +1,57 @@
1ifeq ("$(origin O)", "command line")
2 OUTPUT := $(O)/
3endif
4
5ifneq ($(OUTPUT),)
6# check that the output directory actually exists
7OUTDIR := $(shell cd $(OUTPUT) && /bin/pwd)
8$(if $(OUTDIR),, $(error output directory "$(OUTPUT)" does not exist))
9endif
10
11#
12# Include saner warnings here, which can catch bugs:
13#
14EXTRA_WARNINGS := -Wformat
15EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wformat-security
16EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wformat-y2k
17EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wshadow
18EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Winit-self
19EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wpacked
20EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wredundant-decls
21EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wstrict-aliasing=3
22EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wswitch-default
23EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wswitch-enum
24EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wno-system-headers
25EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wundef
26EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wwrite-strings
27EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wbad-function-cast
28EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wmissing-declarations
29EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wmissing-prototypes
30EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wnested-externs
31EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wold-style-definition
32EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wstrict-prototypes
33EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wdeclaration-after-statement
34
35ifneq ($(findstring $(MAKEFLAGS), w),w)
36PRINT_DIR = --no-print-directory
37else
38NO_SUBDIR = :
39endif
40
41QUIET_SUBDIR0 = +$(MAKE) -C # space to separate -C and subdir
42QUIET_SUBDIR1 =
43
44ifneq ($(findstring $(MAKEFLAGS),s),s)
45ifndef V
46 QUIET_CC = @echo ' ' CC $@;
47 QUIET_AR = @echo ' ' AR $@;
48 QUIET_LINK = @echo ' ' LINK $@;
49 QUIET_MKDIR = @echo ' ' MKDIR $@;
50 QUIET_GEN = @echo ' ' GEN $@;
51 QUIET_SUBDIR0 = +@subdir=
52 QUIET_SUBDIR1 = ;$(NO_SUBDIR) echo ' ' SUBDIR $$subdir; \
53 $(MAKE) $(PRINT_DIR) -C $$subdir
54 QUIET_FLEX = @echo ' ' FLEX $@;
55 QUIET_BISON = @echo ' ' BISON $@;
56endif
57endif