diff options
author | Borislav Petkov <borislav.petkov@amd.com> | 2012-04-11 12:36:14 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-04-11 13:57:36 -0400 |
commit | 98d89bfd0d4b2f218ec709e90ddcab6d82d7671e (patch) | |
tree | eac8ed677e18a9f5f16050bddff8191d496c4552 /tools | |
parent | 2381da7a11ef5fcfbad1f1ca2f6ddaa7a153694f (diff) |
tools: Add Makefile.include
Put generic enough build settings which could be reused by other tools
into a common Makefile.include file.
This commit reintroduces QUIET_SUBDIR{0,1} (see a3d1ee10d1bf) which are
going to be used in the following patches.
Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Michal Marek <mmarek@suse.cz>
Cc: Sam Ravnborg <sam@ravnborg.org>
Link: http://lkml.kernel.org/r/1334162178-17152-2-git-send-email-bp@amd64.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/Makefile | 47 | ||||
-rw-r--r-- | tools/scripts/Makefile.include | 57 |
2 files changed, 58 insertions, 46 deletions
diff --git a/tools/perf/Makefile b/tools/perf/Makefile index 820371f10d1..4ca77cc0f28 100644 --- a/tools/perf/Makefile +++ b/tools/perf/Makefile | |||
@@ -1,18 +1,10 @@ | |||
1 | ifeq ("$(origin O)", "command line") | 1 | include ../scripts/Makefile.include |
2 | OUTPUT := $(O)/ | ||
3 | endif | ||
4 | 2 | ||
5 | # The default target of this Makefile is... | 3 | # The default target of this Makefile is... |
6 | all: | 4 | all: |
7 | 5 | ||
8 | include config/utilities.mak | 6 | include config/utilities.mak |
9 | 7 | ||
10 | ifneq ($(OUTPUT),) | ||
11 | # check that the output directory actually exists | ||
12 | OUTDIR := $(shell cd $(OUTPUT) && /bin/pwd) | ||
13 | $(if $(OUTDIR),, $(error output directory "$(OUTPUT)" does not exist)) | ||
14 | endif | ||
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 |
85 | endif | 77 | endif |
86 | 78 | ||
87 | # | ||
88 | # Include saner warnings here, which can catch bugs: | ||
89 | # | ||
90 | |||
91 | EXTRA_WARNINGS := -Wformat | ||
92 | EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wformat-security | ||
93 | EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wformat-y2k | ||
94 | EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wshadow | ||
95 | EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Winit-self | ||
96 | EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wpacked | ||
97 | EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wredundant-decls | ||
98 | EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wstrict-aliasing=3 | ||
99 | EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wswitch-default | ||
100 | EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wswitch-enum | ||
101 | EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wno-system-headers | ||
102 | EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wundef | ||
103 | EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wwrite-strings | ||
104 | EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wbad-function-cast | ||
105 | EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wmissing-declarations | ||
106 | EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wmissing-prototypes | ||
107 | EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wnested-externs | ||
108 | EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wold-style-definition | ||
109 | EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wstrict-prototypes | ||
110 | EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wdeclaration-after-statement | ||
111 | |||
112 | ifeq ("$(origin DEBUG)", "command line") | 79 | ifeq ("$(origin DEBUG)", "command line") |
113 | PERF_DEBUG = $(DEBUG) | 80 | PERF_DEBUG = $(DEBUG) |
114 | endif | 81 | endif |
@@ -679,18 +646,6 @@ else | |||
679 | endif | 646 | endif |
680 | endif | 647 | endif |
681 | 648 | ||
682 | ifneq ($(findstring $(MAKEFLAGS),s),s) | ||
683 | ifndef 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 $@; | ||
691 | endif | ||
692 | endif | ||
693 | |||
694 | ifdef ASCIIDOC8 | 649 | ifdef ASCIIDOC8 |
695 | export ASCIIDOC8 | 650 | export ASCIIDOC8 |
696 | endif | 651 | endif |
diff --git a/tools/scripts/Makefile.include b/tools/scripts/Makefile.include new file mode 100644 index 00000000000..52348d3bd8d --- /dev/null +++ b/tools/scripts/Makefile.include | |||
@@ -0,0 +1,57 @@ | |||
1 | ifeq ("$(origin O)", "command line") | ||
2 | OUTPUT := $(O)/ | ||
3 | endif | ||
4 | |||
5 | ifneq ($(OUTPUT),) | ||
6 | # check that the output directory actually exists | ||
7 | OUTDIR := $(shell cd $(OUTPUT) && /bin/pwd) | ||
8 | $(if $(OUTDIR),, $(error output directory "$(OUTPUT)" does not exist)) | ||
9 | endif | ||
10 | |||
11 | # | ||
12 | # Include saner warnings here, which can catch bugs: | ||
13 | # | ||
14 | EXTRA_WARNINGS := -Wformat | ||
15 | EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wformat-security | ||
16 | EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wformat-y2k | ||
17 | EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wshadow | ||
18 | EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Winit-self | ||
19 | EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wpacked | ||
20 | EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wredundant-decls | ||
21 | EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wstrict-aliasing=3 | ||
22 | EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wswitch-default | ||
23 | EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wswitch-enum | ||
24 | EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wno-system-headers | ||
25 | EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wundef | ||
26 | EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wwrite-strings | ||
27 | EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wbad-function-cast | ||
28 | EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wmissing-declarations | ||
29 | EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wmissing-prototypes | ||
30 | EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wnested-externs | ||
31 | EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wold-style-definition | ||
32 | EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wstrict-prototypes | ||
33 | EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wdeclaration-after-statement | ||
34 | |||
35 | ifneq ($(findstring $(MAKEFLAGS), w),w) | ||
36 | PRINT_DIR = --no-print-directory | ||
37 | else | ||
38 | NO_SUBDIR = : | ||
39 | endif | ||
40 | |||
41 | QUIET_SUBDIR0 = +$(MAKE) -C # space to separate -C and subdir | ||
42 | QUIET_SUBDIR1 = | ||
43 | |||
44 | ifneq ($(findstring $(MAKEFLAGS),s),s) | ||
45 | ifndef 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 $@; | ||
56 | endif | ||
57 | endif | ||