1*98d89bfdSBorislav Petkovifeq ("$(origin O)", "command line") 2*98d89bfdSBorislav Petkov OUTPUT := $(O)/ 3*98d89bfdSBorislav Petkovendif 4*98d89bfdSBorislav Petkov 5*98d89bfdSBorislav Petkovifneq ($(OUTPUT),) 6*98d89bfdSBorislav Petkov# check that the output directory actually exists 7*98d89bfdSBorislav PetkovOUTDIR := $(shell cd $(OUTPUT) && /bin/pwd) 8*98d89bfdSBorislav Petkov$(if $(OUTDIR),, $(error output directory "$(OUTPUT)" does not exist)) 9*98d89bfdSBorislav Petkovendif 10*98d89bfdSBorislav Petkov 11*98d89bfdSBorislav Petkov# 12*98d89bfdSBorislav Petkov# Include saner warnings here, which can catch bugs: 13*98d89bfdSBorislav Petkov# 14*98d89bfdSBorislav PetkovEXTRA_WARNINGS := -Wformat 15*98d89bfdSBorislav PetkovEXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wformat-security 16*98d89bfdSBorislav PetkovEXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wformat-y2k 17*98d89bfdSBorislav PetkovEXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wshadow 18*98d89bfdSBorislav PetkovEXTRA_WARNINGS := $(EXTRA_WARNINGS) -Winit-self 19*98d89bfdSBorislav PetkovEXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wpacked 20*98d89bfdSBorislav PetkovEXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wredundant-decls 21*98d89bfdSBorislav PetkovEXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wstrict-aliasing=3 22*98d89bfdSBorislav PetkovEXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wswitch-default 23*98d89bfdSBorislav PetkovEXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wswitch-enum 24*98d89bfdSBorislav PetkovEXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wno-system-headers 25*98d89bfdSBorislav PetkovEXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wundef 26*98d89bfdSBorislav PetkovEXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wwrite-strings 27*98d89bfdSBorislav PetkovEXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wbad-function-cast 28*98d89bfdSBorislav PetkovEXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wmissing-declarations 29*98d89bfdSBorislav PetkovEXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wmissing-prototypes 30*98d89bfdSBorislav PetkovEXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wnested-externs 31*98d89bfdSBorislav PetkovEXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wold-style-definition 32*98d89bfdSBorislav PetkovEXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wstrict-prototypes 33*98d89bfdSBorislav PetkovEXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wdeclaration-after-statement 34*98d89bfdSBorislav Petkov 35*98d89bfdSBorislav Petkovifneq ($(findstring $(MAKEFLAGS), w),w) 36*98d89bfdSBorislav PetkovPRINT_DIR = --no-print-directory 37*98d89bfdSBorislav Petkovelse 38*98d89bfdSBorislav PetkovNO_SUBDIR = : 39*98d89bfdSBorislav Petkovendif 40*98d89bfdSBorislav Petkov 41*98d89bfdSBorislav PetkovQUIET_SUBDIR0 = +$(MAKE) -C # space to separate -C and subdir 42*98d89bfdSBorislav PetkovQUIET_SUBDIR1 = 43*98d89bfdSBorislav Petkov 44*98d89bfdSBorislav Petkovifneq ($(findstring $(MAKEFLAGS),s),s) 45*98d89bfdSBorislav Petkovifndef V 46*98d89bfdSBorislav Petkov QUIET_CC = @echo ' ' CC $@; 47*98d89bfdSBorislav Petkov QUIET_AR = @echo ' ' AR $@; 48*98d89bfdSBorislav Petkov QUIET_LINK = @echo ' ' LINK $@; 49*98d89bfdSBorislav Petkov QUIET_MKDIR = @echo ' ' MKDIR $@; 50*98d89bfdSBorislav Petkov QUIET_GEN = @echo ' ' GEN $@; 51*98d89bfdSBorislav Petkov QUIET_SUBDIR0 = +@subdir= 52*98d89bfdSBorislav Petkov QUIET_SUBDIR1 = ;$(NO_SUBDIR) echo ' ' SUBDIR $$subdir; \ 53*98d89bfdSBorislav Petkov $(MAKE) $(PRINT_DIR) -C $$subdir 54*98d89bfdSBorislav Petkov QUIET_FLEX = @echo ' ' FLEX $@; 55*98d89bfdSBorislav Petkov QUIET_BISON = @echo ' ' BISON $@; 56*98d89bfdSBorislav Petkovendif 57*98d89bfdSBorislav Petkovendif 58