diff options
Diffstat (limited to 'tools/scripts/Makefile.include')
| -rw-r--r-- | tools/scripts/Makefile.include | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/tools/scripts/Makefile.include b/tools/scripts/Makefile.include new file mode 100644 index 000000000000..bde8521d56bb --- /dev/null +++ b/tools/scripts/Makefile.include | |||
| @@ -0,0 +1,58 @@ | |||
| 1 | ifeq ("$(origin O)", "command line") | ||
| 2 | OUTPUT := $(O)/ | ||
| 3 | COMMAND_O := O=$(O) | ||
| 4 | endif | ||
| 5 | |||
| 6 | ifneq ($(OUTPUT),) | ||
| 7 | # check that the output directory actually exists | ||
| 8 | OUTDIR := $(shell cd $(OUTPUT) && /bin/pwd) | ||
| 9 | $(if $(OUTDIR),, $(error output directory "$(OUTPUT)" does not exist)) | ||
| 10 | endif | ||
| 11 | |||
| 12 | # | ||
| 13 | # Include saner warnings here, which can catch bugs: | ||
| 14 | # | ||
| 15 | EXTRA_WARNINGS := -Wbad-function-cast | ||
| 16 | EXTRA_WARNINGS += -Wdeclaration-after-statement | ||
| 17 | EXTRA_WARNINGS += -Wformat-security | ||
| 18 | EXTRA_WARNINGS += -Wformat-y2k | ||
| 19 | EXTRA_WARNINGS += -Winit-self | ||
| 20 | EXTRA_WARNINGS += -Wmissing-declarations | ||
| 21 | EXTRA_WARNINGS += -Wmissing-prototypes | ||
| 22 | EXTRA_WARNINGS += -Wnested-externs | ||
| 23 | EXTRA_WARNINGS += -Wno-system-headers | ||
| 24 | EXTRA_WARNINGS += -Wold-style-definition | ||
| 25 | EXTRA_WARNINGS += -Wpacked | ||
| 26 | EXTRA_WARNINGS += -Wredundant-decls | ||
| 27 | EXTRA_WARNINGS += -Wshadow | ||
| 28 | EXTRA_WARNINGS += -Wstrict-aliasing=3 | ||
| 29 | EXTRA_WARNINGS += -Wstrict-prototypes | ||
| 30 | EXTRA_WARNINGS += -Wswitch-default | ||
| 31 | EXTRA_WARNINGS += -Wswitch-enum | ||
| 32 | EXTRA_WARNINGS += -Wundef | ||
| 33 | EXTRA_WARNINGS += -Wwrite-strings | ||
| 34 | EXTRA_WARNINGS += -Wformat | ||
| 35 | |||
| 36 | ifneq ($(findstring $(MAKEFLAGS), w),w) | ||
| 37 | PRINT_DIR = --no-print-directory | ||
| 38 | else | ||
| 39 | NO_SUBDIR = : | ||
| 40 | endif | ||
| 41 | |||
| 42 | QUIET_SUBDIR0 = +$(MAKE) -C # space to separate -C and subdir | ||
| 43 | QUIET_SUBDIR1 = | ||
| 44 | |||
| 45 | ifneq ($(findstring $(MAKEFLAGS),s),s) | ||
| 46 | ifndef V | ||
| 47 | QUIET_CC = @echo ' ' CC $@; | ||
| 48 | QUIET_AR = @echo ' ' AR $@; | ||
| 49 | QUIET_LINK = @echo ' ' LINK $@; | ||
| 50 | QUIET_MKDIR = @echo ' ' MKDIR $@; | ||
| 51 | QUIET_GEN = @echo ' ' GEN $@; | ||
| 52 | QUIET_SUBDIR0 = +@subdir= | ||
| 53 | QUIET_SUBDIR1 = ;$(NO_SUBDIR) echo ' ' SUBDIR $$subdir; \ | ||
| 54 | $(MAKE) $(PRINT_DIR) -C $$subdir | ||
| 55 | QUIET_FLEX = @echo ' ' FLEX $@; | ||
| 56 | QUIET_BISON = @echo ' ' BISON $@; | ||
| 57 | endif | ||
| 58 | endif | ||
