Borislav Petkov | 98d89bf | 2012-04-11 18:36:14 +0200 | [diff] [blame^] | 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 |