1 ifeq ("$(origin O)", "command line")
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))
13 # Include saner warnings here, which can catch bugs:
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
36 ifneq ($(findstring $(MAKEFLAGS), w),w)
37 PRINT_DIR = --no-print-directory
42 QUIET_SUBDIR0 = +$(MAKE) -C # space to separate -C and subdir
45 ifneq ($(findstring $(MAKEFLAGS),s),s)
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 $@;