make: Define default rule for .c when V=1 or V=2
The default .o:.c rule passes a short file name to gcc to when doing "make -C <dir>", we do this a lot for all the libraries. The file names printed in gcc errors are relative to <dir> and this prevents vim from navigating through errors. This passes the full file name to gcc to make it print errors with absolute path so vim can navigate through errors nicely. This makes it optional when V=1 or V=2 is passed. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
This commit is contained in:
parent
8e012d6fdd
commit
283d88c46c
|
@ -49,6 +49,10 @@ ifeq ($(V),0)
|
|||
Q := @
|
||||
MAKEFLAGS += --silent
|
||||
MAKE += -s
|
||||
else
|
||||
CURDIR=$(shell pwd)
|
||||
%.o: %.c
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ -c $(CURDIR)/$<
|
||||
endif
|
||||
|
||||
ifeq ($(V),1)
|
||||
|
@ -78,4 +82,3 @@ CFLAGS ?= -g -O2 -fno-builtin -ffreestanding -nostdinc -msoft-float \
|
|||
-fno-stack-protector -fno-asynchronous-unwind-tables $(WARNFLAGS)
|
||||
|
||||
export CC AS LD CLEAN OBJCOPY OBJDUMP STRIP AR RANLIB CFLAGS
|
||||
|
||||
|
|
Loading…
Reference in New Issue