xref: /linux/tools/scripts/Makefile.include (revision c883122acc0d97648d8b8f4726709017674e4420)
198d89bfdSBorislav Petkovifeq ("$(origin O)", "command line")
2*c883122aSSteven Rostedt	dummy := $(if $(shell test -d $(O) || echo $(O)),$(error O=$(O) does not exist),)
3*c883122aSSteven Rostedt	ABSOLUTE_O := $(shell cd $(O) ; pwd)
4*c883122aSSteven Rostedt	OUTPUT := $(ABSOLUTE_O)/
5*c883122aSSteven Rostedt	COMMAND_O := O=$(ABSOLUTE_O)
698d89bfdSBorislav Petkovendif
798d89bfdSBorislav Petkov
898d89bfdSBorislav Petkovifneq ($(OUTPUT),)
998d89bfdSBorislav Petkov# check that the output directory actually exists
1098d89bfdSBorislav PetkovOUTDIR := $(shell cd $(OUTPUT) && /bin/pwd)
1198d89bfdSBorislav Petkov$(if $(OUTDIR),, $(error output directory "$(OUTPUT)" does not exist))
1298d89bfdSBorislav Petkovendif
1398d89bfdSBorislav Petkov
1498d89bfdSBorislav Petkov#
1598d89bfdSBorislav Petkov# Include saner warnings here, which can catch bugs:
1698d89bfdSBorislav Petkov#
17d8caf3ebSBorislav PetkovEXTRA_WARNINGS := -Wbad-function-cast
18d8caf3ebSBorislav PetkovEXTRA_WARNINGS += -Wdeclaration-after-statement
19d8caf3ebSBorislav PetkovEXTRA_WARNINGS += -Wformat-security
20d8caf3ebSBorislav PetkovEXTRA_WARNINGS += -Wformat-y2k
21d8caf3ebSBorislav PetkovEXTRA_WARNINGS += -Winit-self
22d8caf3ebSBorislav PetkovEXTRA_WARNINGS += -Wmissing-declarations
23d8caf3ebSBorislav PetkovEXTRA_WARNINGS += -Wmissing-prototypes
24d8caf3ebSBorislav PetkovEXTRA_WARNINGS += -Wnested-externs
25d8caf3ebSBorislav PetkovEXTRA_WARNINGS += -Wno-system-headers
26d8caf3ebSBorislav PetkovEXTRA_WARNINGS += -Wold-style-definition
27d8caf3ebSBorislav PetkovEXTRA_WARNINGS += -Wpacked
28d8caf3ebSBorislav PetkovEXTRA_WARNINGS += -Wredundant-decls
29d8caf3ebSBorislav PetkovEXTRA_WARNINGS += -Wshadow
30d8caf3ebSBorislav PetkovEXTRA_WARNINGS += -Wstrict-aliasing=3
31d8caf3ebSBorislav PetkovEXTRA_WARNINGS += -Wstrict-prototypes
32d8caf3ebSBorislav PetkovEXTRA_WARNINGS += -Wswitch-default
33d8caf3ebSBorislav PetkovEXTRA_WARNINGS += -Wswitch-enum
34d8caf3ebSBorislav PetkovEXTRA_WARNINGS += -Wundef
35d8caf3ebSBorislav PetkovEXTRA_WARNINGS += -Wwrite-strings
36d8caf3ebSBorislav PetkovEXTRA_WARNINGS += -Wformat
3798d89bfdSBorislav Petkov
3898d89bfdSBorislav Petkovifneq ($(findstring $(MAKEFLAGS), w),w)
3998d89bfdSBorislav PetkovPRINT_DIR = --no-print-directory
4098d89bfdSBorislav Petkovelse
4198d89bfdSBorislav PetkovNO_SUBDIR = :
4298d89bfdSBorislav Petkovendif
4398d89bfdSBorislav Petkov
4498d89bfdSBorislav PetkovQUIET_SUBDIR0  = +$(MAKE) -C # space to separate -C and subdir
4598d89bfdSBorislav PetkovQUIET_SUBDIR1  =
4698d89bfdSBorislav Petkov
4798d89bfdSBorislav Petkovifneq ($(findstring $(MAKEFLAGS),s),s)
4898d89bfdSBorislav Petkovifndef V
4998d89bfdSBorislav Petkov	QUIET_CC       = @echo '   ' CC $@;
5098d89bfdSBorislav Petkov	QUIET_AR       = @echo '   ' AR $@;
5198d89bfdSBorislav Petkov	QUIET_LINK     = @echo '   ' LINK $@;
5298d89bfdSBorislav Petkov	QUIET_MKDIR    = @echo '   ' MKDIR $@;
5398d89bfdSBorislav Petkov	QUIET_GEN      = @echo '   ' GEN $@;
5498d89bfdSBorislav Petkov	QUIET_SUBDIR0  = +@subdir=
5598d89bfdSBorislav Petkov	QUIET_SUBDIR1  = ;$(NO_SUBDIR) echo '   ' SUBDIR $$subdir; \
5698d89bfdSBorislav Petkov			 $(MAKE) $(PRINT_DIR) -C $$subdir
5798d89bfdSBorislav Petkov	QUIET_FLEX     = @echo '   ' FLEX $@;
5898d89bfdSBorislav Petkov	QUIET_BISON    = @echo '   ' BISON $@;
5998d89bfdSBorislav Petkovendif
6098d89bfdSBorislav Petkovendif
61