Borislav Petkov | 98d89bf | 2012-04-11 18:36:14 +0200 | [diff] [blame] | 1 | ifeq ("$(origin O)", "command line") |
| 2 | OUTPUT := $(O)/ |
Steven Rostedt | d0e7b85 | 2012-04-06 00:47:54 +0200 | [diff] [blame] | 3 | COMMAND_O := O=$(O) |
Borislav Petkov | 98d89bf | 2012-04-11 18:36:14 +0200 | [diff] [blame] | 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 | # |
Borislav Petkov | d8caf3e | 2012-04-11 18:36:15 +0200 | [diff] [blame] | 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 |
Borislav Petkov | 98d89bf | 2012-04-11 18:36:14 +0200 | [diff] [blame] | 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 |