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